Python accessors to French NAF/APE codes
Project description
france-naf
Python accessors to NAF/APE codes.
From https://www.insee.fr/fr/information/2406147
Installation
pip install france-naf
Usage
from naf import DB
# Get one NAF object
my_naf = DB["02.30Z"]
print(my_naf)
# "Récolte de produits forestiers non ligneux poussant à l'état sauvage"
"02.30Z" in DB
# True
print(my_naf.section) or print(my_naf.section.code)
# 'A'
print(my_naf.section.description)
# 'AGRICULTURE, SYLVICULTURE ET PÊCHE'
dict(my_naf)
# {'code': '02.30Z',
# 'description': "Récolte de produits forestiers non ligneux poussant à l'état sauvage",
# 'classe': {'code': '02.30',
# 'description': "Récolte de produits forestiers non ligneux poussant à l'état sauvage"},
# 'group': {'code': '02.3',
# 'description': "Récolte de produits forestiers non ligneux poussant à l'état sauvage"},
# 'division': {'code': '02',
# 'description': 'Sylviculture et exploitation forestière'},
# 'section': {'code': 'A', 'description': 'AGRICULTURE, SYLVICULTURE ET PÊCHE'}}
# Iter over NAF objects
for naf in DB:
do_something_with(naf)
# Iter over code, description
for code, description in DB.pairs():
pass
# Get the whole DB as a json string
str(DB)
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
france-naf-20210301.tar.gz
(28.8 kB
view details)
Built Distribution
File details
Details for the file france-naf-20210301.tar.gz
.
File metadata
- Download URL: france-naf-20210301.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeaa542abd498a6f97060f62793f1cfa18599cf0489cdc81d62cde35f5433c52 |
|
MD5 | 6d0e1f7ed867cf0e051af5e69646564d |
|
BLAKE2b-256 | dc5e43bf5d1fbd7904e3d9ccb1b79f7155dd4ff87673fb8e75452a60b7551815 |
File details
Details for the file france_naf-20210301-py3-none-any.whl
.
File metadata
- Download URL: france_naf-20210301-py3-none-any.whl
- Upload date:
- Size: 30.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90caa5b6c33b728dacfee7be705935653cba70782933a1cbb7bfd409e8f13c99 |
|
MD5 | 8bb8f4cf16774b039c2686d82b4350dd |
|
BLAKE2b-256 | 18aca15041dc0513188b611ffdd67066fff9a334d1e2dca8126227e1e9522160 |