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.1.tar.gz (1.0 MB 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.1-py3-none-any.whl (110.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dsn_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • 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.1.tar.gz
Algorithm Hash digest
SHA256 aba1a3d912d1d62a1598fca02540aa5cdc1a133e5abcff41ab80728e865f8eda
MD5 51ed60d754008a112b23afd129bfb0bc
BLAKE2b-256 0bd2efa0fbb846b816edf0bd5fe45fa3e0292d32da05aa2e9a2d565a3ee3de46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsn_tools-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 110.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6133c19d0dedc85d790f7a73c76bc094f55a30cde319c938d9eb7eb4979f28bb
MD5 1fbcb3615a11bd90e4ffb30bf8220c04
BLAKE2b-256 d9b04a7659d623a83a6bbf1754f6609313c15335a65d5fed2523204d49b147a5

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