The uriformats module

A small set of generic functions to convert (dicts or dict-like objects) to URIs. They are usually matched with a corresponding citationpattern like the ones found in ferenda.citationpatterns. See Citation parsing for examples.


Converts any dict into a URL. The domain (‘netloc’) is always, and all keys/values of the dict is turned into a querystring.

>>> generic({'foo':'1', 'bar':'2'})

Converts a dict with keys scheme, netloc, path (and optionally query and/or fragment) into the corresponding URL.

>>> url({'scheme':'https', 'netloc':'', 'path':'test'})

Converts a dict with keys like LegalactType, Directive, ArticleId (produced by ferenda.citationpatterns.eulaw) into a CELEX-based URI.


This is not yet implemented.