Skip to main content

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)

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'

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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for lawfactory_utils-0.0.4.tar.gz
Algorithm Hash digest
SHA256 9285b4f054446c779eab6747e6ee0c49972f48b5793ac433dd4a55981458b005
MD5 c3ade46bcb9ec9af138fd809549209df
BLAKE2b-256 7f356e37bfdf66109865e1b0c0a370f6a6675359f7c636936dc43024e39e6fa5

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