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.
- ferenda.uriformats.generic(d)[source]¶
Converts any dict into a URL. The domain (netlog) is always example.org, and all keys/values of the dict is turned into a querystring.
>>> generic({'foo':'1', 'bar':'2'}) "http://example.org/?foo=1&bar=2"
- ferenda.uriformats.url(d)[source]¶
Converts a dict with keys scheme, netloc, path (and optionally query and/or fragment) into the corresponding URL.
>>> url({'scheme':'https', 'netloc':'example.org', 'path':'test'}) "https://example.org/test
- ferenda.uriformats.eulaw(d)[source]¶
Converts a dict with keys like LegalactType, Directive, ArticleId (produced by ferenda.citationpatterns.eulaw) into a CELEX-based URI.
Note
This is not yet implemented.