Python utils for The Law Factory parsers
Project description
A few utilities for the-law-factory-parser project, shared by senapy and anpy.
A simple caching library:
from lawfactory_utils.urls import enable_requests_cache, download enable_requests_cache() ..... resp = download(url) print(resp.text)
Warning: To be able to download from Légifrance, you must set up a LEGIFRANCE_PROXY env variable, which is a running instance of legifrance-proxy.
The cached responses are stored in the directory where this lib is installed. You can use lawfactory_where_is_my_cache to print the path.
URL cleaning for senat/AN/legifrance/conseil-constit
>>> from lawfactory_utils.urls import clean_url >>> clean_url('https://www.legifrance.gouv.fr/eli/loi/2017/9/15/JUSC1715752L/jo/texte') 'https://www.legifrance.gouv.fr/jorf/id/JORFTEXT000035567936'
Parsing of National Assembly URLS
>>> from lawfactory_utils.urls import parse_national_assembly >>> parse_national_assembly_url("http://www.assemblee-nationale.fr/dyn/15/dossiers/retablissement_confiance_action_publique") (15, 'retablissement_confiance_action_publique')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lawfactory_utils-0.2.1.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for lawfactory_utils-0.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11ddb932170c9ab29723084aa4be792b9462111536a54d26894a5d1f90955896 |
|
MD5 | 82fc2269460b3f96ee656b3c00b61a9d |
|
BLAKE2b-256 | 12f46bca79c934381e2fe9250cac574fb859fc9528fa23e9d5ccae94bcfb36b7 |