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"},
# 'groupe': {'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-20210302.tar.gz
(28.9 kB
view details)
Built Distribution
File details
Details for the file france-naf-20210302.tar.gz
.
File metadata
- Download URL: france-naf-20210302.tar.gz
- Upload date:
- Size: 28.9 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 | 683bf11b3cd103fe42147f73b4817a3c259822bcc2ffcf4e7bd8c0551c8570f3 |
|
MD5 | 47f19b80643409061eed954c9ef0cafb |
|
BLAKE2b-256 | a0adb15a55d13be4e908c9f4b883f36afd0e4ada7ee618605a2c42eeded39fd7 |
File details
Details for the file france_naf-20210302-py3-none-any.whl
.
File metadata
- Download URL: france_naf-20210302-py3-none-any.whl
- Upload date:
- Size: 30.1 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 | 9b35fc7f0e50b2dbbb7e9050155a74b7131e54a303467285374bc75d645a32dc |
|
MD5 | 8cb81c29a3b92881f95b1bb0efe37024 |
|
BLAKE2b-256 | 2cb8048e99b775b3f952d17c3dd9b4af6aabc17e612963596728553d83a41d25 |