Free Decimal Classification lookup library
Project description
fdc — Free Decimal Classification
A Python library for looking up Free Decimal Classification codes. Built from the FDC correspondence file.
Quick start
from fdc import Label
label = Label.parse("976.4")
label.best # '"Texas"'
for layer in label.layers:
print(f"{layer.code}: {layer.label}")
# 9: History & geography
# 970: "America" + "North America"
# 976: "Gulf States" + "Southwest, Old"
# 976.4: "Texas"
Use .best to get the most specific resolved label without walking layers:
label = Label.parse("999.9")
label.best # '"Outer Space"' (last resolved layer)
label.layers[-1].label # None (no entry for this exact code)
Pass raise_on_error=True for strict mode:
from fdc import Label
from fdc.label import LabelError
try:
Label.parse("999.9", raise_on_error=True)
except LabelError:
pass # no entry for this code
Installing from PyPI
pip install free-decimal-correspondence
The package ships with a pre-built lookup table (fdc/_table.py) so parsing is never
needed at runtime. The table is loaded into memory the first time you call
Label.parse() - after that, lookups take roughly two microseconds.
Contributing
The taxonomy data lives in the classification/ submodule. If you improve it,
rebuild the lookup table before committing:
python -m fdc.build
This regenerates fdc/_table.py from the text file. Commit both the
submodule change and the regenerated table.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file free_decimal_correspondence-0.1.2.tar.gz.
File metadata
- Download URL: free_decimal_correspondence-0.1.2.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecf85b0c5caec779362a0f9690e36541718f52eabaeaf378427ca07a52985e76
|
|
| MD5 |
05613ede25ff3b8d89335b522ca83e94
|
|
| BLAKE2b-256 |
0b6fc41c1841921fd23bd7ac6da8f92ceb6dc13dfb6350273e5b255daca0cc75
|
Provenance
The following attestation bundles were made for free_decimal_correspondence-0.1.2.tar.gz:
Publisher:
publish.yml on thien/fdc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
free_decimal_correspondence-0.1.2.tar.gz -
Subject digest:
ecf85b0c5caec779362a0f9690e36541718f52eabaeaf378427ca07a52985e76 - Sigstore transparency entry: 1499387771
- Sigstore integration time:
-
Permalink:
thien/fdc@6c3dde43d7af444bfcccf8a6b434af75c2e55a18 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/thien
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6c3dde43d7af444bfcccf8a6b434af75c2e55a18 -
Trigger Event:
release
-
Statement type:
File details
Details for the file free_decimal_correspondence-0.1.2-py3-none-any.whl.
File metadata
- Download URL: free_decimal_correspondence-0.1.2-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
029b7a59bd53a7b9b75f920badada7b1eefaa82e0cf09f8f4ef1db755b58f157
|
|
| MD5 |
3d7df43749d6c2118adc971bd9be1b30
|
|
| BLAKE2b-256 |
fa09e2081b2231e259d04c8c6a491304d5eb3bdb09e93c6bd0fea059b70e080a
|
Provenance
The following attestation bundles were made for free_decimal_correspondence-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on thien/fdc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
free_decimal_correspondence-0.1.2-py3-none-any.whl -
Subject digest:
029b7a59bd53a7b9b75f920badada7b1eefaa82e0cf09f8f4ef1db755b58f157 - Sigstore transparency entry: 1499387964
- Sigstore integration time:
-
Permalink:
thien/fdc@6c3dde43d7af444bfcccf8a6b434af75c2e55a18 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/thien
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6c3dde43d7af444bfcccf8a6b434af75c2e55a18 -
Trigger Event:
release
-
Statement type: