Skip to main content

Python utils for The Law Factory parsers

Project description

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)

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/affichTexte.do?cidTexte=JORFTEXT000035567936&categorieLien=id'
  • 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


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.1.8.tar.gz (5.0 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.1.8-py2.py3-none-any.whl (6.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: lawfactory_utils-0.1.8.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9

File hashes

Hashes for lawfactory_utils-0.1.8.tar.gz
Algorithm Hash digest
SHA256 7112b72c4fdb0afd0298ad2e6f3dea74f6627d39c771694fe1d25dc6e888c9d8
MD5 87068d6fd80245133341e1ed5ab52576
BLAKE2b-256 177a3dd8f6edd66a4f15ab9b17d2c87cef0dbeaa212f7cb5449faea1464c3cee

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lawfactory_utils-0.1.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 895dcfa7ff30a36187a3c0e07bb5cbd950e342600e0e2b6472717f394e9827f8
MD5 b5876d74bae41b110ee7c49510a2c729
BLAKE2b-256 5faae1547cd60b9ecc8461fffc49d4d5d7c1b861dae92b424daaaccc24bd8c2f

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