Skip to main content

Parseur et types pour fichiers DSN (Données Sociales Nominatives)

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dsn_tools-0.1.0.tar.gz (998.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dsn_tools-0.1.0-py3-none-any.whl (109.9 kB view details)

Uploaded Python 3

File details

Details for the file dsn_tools-0.1.0.tar.gz.

File metadata

  • Download URL: dsn_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 998.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dsn_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 16ce1937a07a9952993ea363ffafd9a53281929f44069aece66e33402916bfe1
MD5 16c35875d180ee3848d8cce222081e21
BLAKE2b-256 e72a87534560d5db16b2a62cc377fda83cdc24cc6c1739009ea41fcc18d71bdc

See more details on using hashes here.

File details

Details for the file dsn_tools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dsn_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 109.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dsn_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37a74170d126239ded791e1929320059742234f8a58a2afaa913b5c329b8a557
MD5 91a3420d5b52f412ea2f9747cef5434f
BLAKE2b-256 149fbec5b45886a206b570984b1d6cbed3c12c26766887a3fe0217eb19ba577a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page