Python utils for The Law Factory parsers
Project description
# lawfactory-utils
A few utilities for [the-law-factory-parser](https://github.com/regardscitoyens/the-law-factory-parser) project, shared by [senapy](https://github.com/regardscitoyens/senapy) and [anpy](https://github.com/regardscitoyens/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'
```
A few utilities for [the-law-factory-parser](https://github.com/regardscitoyens/the-law-factory-parser) project, shared by [senapy](https://github.com/regardscitoyens/senapy) and [anpy](https://github.com/regardscitoyens/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
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
File details
Details for the file lawfactory_utils-0.0.2.tar.gz
.
File metadata
- Download URL: lawfactory_utils-0.0.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f6aee70fec15787265c5fd29c3cc8939317a50e33790a81f0445fca3333badf |
|
MD5 | 678b6a56c00b9f2399f48e1abdd49b99 |
|
BLAKE2b-256 | d155d3d4b9029240c91f2cc965203709230e84a445ba1cfcb1d2c7596484c33b |