Skip to main content

Bibliothèque souveraine pour parser les fichiers Dilicom déposés sur le serveur SFTP de Dilicom avec connecteur SFTP intégré.

Project description

Package de gestion des fichiers Dilicom sur serveur SFTP

PyPi version Licence Python version Pandas version Paramiko version python-dotenv version

dilicom-parser est une bibliothèque Python souveraine dédiée à la lecture, au parsing, à la validation et à la transformation des fichiers Dilicom (distributeurs, commandes, etc.). Elle fournit des modèles de données stricts, des parseurs robustes et des outils d’audit pour garantir une intégration fiable et reproductible.

🚀 Objectifs

  • Offrir une implémentation Python propre et moderne des structures Dilicom.
  • Fournir des dataclasses typées pour chaque bloc Dilicom.
  • Faciliter l’intégration dans des pipelines d’audit, d’ETL ou de synchronisation.
  • Proposer une base souveraine et open-source pour les acteurs du livre.

✨ Fonctionnalités

  • 📦 Modèles de données Dilicom (Bloc 1, Bloc 2, Bloc 3…)
  • 🧩 Parseur robuste basé sur l’ordre contractuel des champs
  • 🔍 Validation des types et des valeurs
  • 📊 Conversion DataFrame → objets Python
  • 🧪 Tests unitaires inclus

📄 Exemple d’utilisation

Créer le fichier .env avec les variables d’environnement nécessaires :

#.env

# Variables pour les dossier d’entrée et de sortie des fichiers
DILICOM_IN_DIR=/path/to/dilicom/files
DILICOM_OUT_DIR=/path/to/output

# Optionnel, variables pour la connexion FTP si nécessaire
DILICOM_HOST=ftp.example.com
DILICOM_PORT=11234
DILICOM_USER=username
DILICOM_SECRET=password

Ensuite, utiliser le parser dans votre code Python :

from dotenv import load_dotenv
from dilicom_parser import DistributorParser
from dilicom_parser.classifier

load_dotenv('path/to/.env')

parser = DistributorParser()
data = parser.parse_file("distributeur.txt")

for line in data.lines:
    print(line.bloc1.rs1)   # Raison sociale principale du distributeur
    print(line.bloc1.ville)  # Ville du distributeur

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

dilicom_parser-0.2.4.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

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

dilicom_parser-0.2.4-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file dilicom_parser-0.2.4.tar.gz.

File metadata

  • Download URL: dilicom_parser-0.2.4.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for dilicom_parser-0.2.4.tar.gz
Algorithm Hash digest
SHA256 74542a5849845eaf3e27253045d733071f6b6fdf77b9a8734fd67787a2b0ec73
MD5 e93f0a0a8fe7f75a0adce63c8b707205
BLAKE2b-256 193a08ea19a6bd8e773cbd3d051d187eb0a885284840245690f888a5ffd43e50

See more details on using hashes here.

File details

Details for the file dilicom_parser-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: dilicom_parser-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for dilicom_parser-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a4abf633e8878a87f8d6e92edf984cfc6e399279c4ba841e9af7c7c3723913ae
MD5 880622f3b4dfb0804336fbc7625f1584
BLAKE2b-256 c30f3c6991ac9d2b594318c3ea674226374e4402935f471e04001f8c24e2d831

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