Skip to main content
https://travis-ci.org/regardscitoyens/lawfactory_utils.svg?branch=master

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')

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.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lawfactory_utils-0.2-py2.py3-none-any.whl (6.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file lawfactory_utils-0.2.tar.gz.

File metadata

  • Download URL: lawfactory_utils-0.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for lawfactory_utils-0.2.tar.gz
Algorithm Hash digest
SHA256 57bebb56ea22acac31c3827e4653942eaca71a4dfc9b3d82f4226c6b0e3bb419
MD5 6fa8a1e25d9e983b870ad236e0bafb96
BLAKE2b-256 eb896f4aefdc5784df803b40cbdcd529db4ab5fe526482ff9cc4c6ff7b4abf18

See more details on using hashes here.

File details

Details for the file lawfactory_utils-0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: lawfactory_utils-0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for lawfactory_utils-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b325657372f93da65f9ccaf222ab369ebaf26544adba79cd21bc8746c4be0af0
MD5 9b87ea99afbfa21f5b08d379321706a3
BLAKE2b-256 8936d2d4d919c95ed819975fb7833288561f5e44f265d11017aecd03681fa373

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page