dsn-tools
Parseur et types Python pour fichiers DSN (Données Sociales Nominatives).
Installation
pip install dsn-tools
# ou avec uv
uv add dsn-tools
Utilisation rapide
En ligne de commande
# Parser un fichier DSN
dsn-tools declaration.dsn
# Sortie JSON
dsn-tools declaration.dsn --json
# Avec validation
dsn-tools declaration.dsn --validate
# Sans installer (avec uv)
uvx dsn-tools declaration.dsn --json
En Python
from dsn_tools import DSNParser
parser = DSNParser()
message = parser.parse_file("declaration.dsn")
# Accès aux données
print(message.header.nom_du_logiciel_utilise)
print(message.header.code_envoi_du_fichier_dessai_ou_reel)
# Export JSON
json_output = message.to_json()
# Conversion en dictionnaire
data = message.to_dict()
Caractéristiques
- ✅ 59 blocs DSN supportés (CT2026)
- ✅ Types Python fortement typés avec dataclasses
- ✅ Validation des données avec regex
- ✅ Export JSON natif
- ✅ Enums avec descriptions lisibles (pas seulement les codes)
- ✅ CLI simple et rapide
Exemple de sortie JSON
{
"header": {
"nom_du_logiciel_utilise": "MonLogiciel",
"code_envoi_du_fichier_dessai_ou_reel": "envoi fichier réel",
"type_de_lenvoi": "envoi normal"
},
"declarations": [...],
"footer": {...}
}
Licence
WTFPL - Do What The Fuck You Want To Public License
Metadata
Release files for dsn-tools 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dsn_tools-0.1.2.tar.gz | 368.4 kB | Without provenance | Details for dsn_tools-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dsn_tools-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for dsn_tools-0.1.2-py3-none-any.whl |
Total release size: 478.3 kB
Release files / dsn_tools-0.1.2.tar.gz
| Download URL | dsn_tools-0.1.2.tar.gz |
|---|---|
| Size | 368.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d613a7fd9a97ab596985f87170294c73943151d6371c544d5c25a9967961e17c
|
|
BLAKE2b-256 checksum How to use checksums |
6697e50f0c0347abe89c547269dff6c94cfe4be30114ed3df8e8d4b66180d34e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.8
|
Release files / dsn_tools-0.1.2-py3-none-any.whl
| Download URL | dsn_tools-0.1.2-py3-none-any.whl |
|---|---|
| Size | 110.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
73c74af89609dfadc010bf024cc6e823ea0ae0c0c48f4e01e03e3ec0ee39c15c
|
|
BLAKE2b-256 checksum How to use checksums |
d6a5026f6ff61551b77690049d06e2d7356d9b2801ae3e1aa9a09a66777885e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.8
|
Security for dsn-tools 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.