factpulse 2.0.19__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. factpulse-2.0.19/LICENSE +21 -0
  2. factpulse-2.0.19/PKG-INFO +217 -0
  3. factpulse-2.0.19/README.md +197 -0
  4. factpulse-2.0.19/factpulse/__init__.py +258 -0
  5. factpulse-2.0.19/factpulse/api/__init__.py +11 -0
  6. factpulse-2.0.19/factpulse/api/afnorpdppa_api.py +284 -0
  7. factpulse-2.0.19/factpulse/api/afnorpdppa_directory_service_api.py +5046 -0
  8. factpulse-2.0.19/factpulse/api/afnorpdppa_flow_service_api.py +1075 -0
  9. factpulse-2.0.19/factpulse/api/chorus_pro_api.py +4506 -0
  10. factpulse-2.0.19/factpulse/api/sant_api.py +526 -0
  11. factpulse-2.0.19/factpulse/api/traitement_facture_api.py +3437 -0
  12. factpulse-2.0.19/factpulse/api/utilisateur_api.py +282 -0
  13. factpulse-2.0.19/factpulse/api_client.py +804 -0
  14. factpulse-2.0.19/factpulse/api_response.py +21 -0
  15. factpulse-2.0.19/factpulse/configuration.py +587 -0
  16. factpulse-2.0.19/factpulse/exceptions.py +219 -0
  17. factpulse-2.0.19/factpulse/models/__init__.py +115 -0
  18. factpulse-2.0.19/factpulse/models/adresse_electronique.py +90 -0
  19. factpulse-2.0.19/factpulse/models/adresse_postale.py +120 -0
  20. factpulse-2.0.19/factpulse/models/api_error.py +104 -0
  21. factpulse-2.0.19/factpulse/models/body_ajouter_fichier_api_v1_chorus_pro_transverses_ajouter_fichier_post.py +104 -0
  22. factpulse-2.0.19/factpulse/models/body_completer_facture_api_v1_chorus_pro_factures_completer_post.py +104 -0
  23. factpulse-2.0.19/factpulse/models/body_lister_services_structure_api_v1_chorus_pro_structures_id_structure_cpp_services_get.py +102 -0
  24. factpulse-2.0.19/factpulse/models/body_rechercher_factures_destinataire_api_v1_chorus_pro_factures_rechercher_destinataire_post.py +104 -0
  25. factpulse-2.0.19/factpulse/models/body_rechercher_factures_fournisseur_api_v1_chorus_pro_factures_rechercher_fournisseur_post.py +104 -0
  26. factpulse-2.0.19/factpulse/models/body_recycler_facture_api_v1_chorus_pro_factures_recycler_post.py +104 -0
  27. factpulse-2.0.19/factpulse/models/body_telecharger_groupe_factures_api_v1_chorus_pro_factures_telecharger_groupe_post.py +104 -0
  28. factpulse-2.0.19/factpulse/models/body_traiter_facture_recue_api_v1_chorus_pro_factures_traiter_facture_recue_post.py +104 -0
  29. factpulse-2.0.19/factpulse/models/body_valideur_consulter_facture_api_v1_chorus_pro_factures_valideur_consulter_post.py +104 -0
  30. factpulse-2.0.19/factpulse/models/body_valideur_rechercher_factures_api_v1_chorus_pro_factures_valideur_rechercher_post.py +104 -0
  31. factpulse-2.0.19/factpulse/models/body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.py +104 -0
  32. factpulse-2.0.19/factpulse/models/cadre_de_facturation.py +102 -0
  33. factpulse-2.0.19/factpulse/models/categorie_tva.py +44 -0
  34. factpulse-2.0.19/factpulse/models/certificate_info_response.py +114 -0
  35. factpulse-2.0.19/factpulse/models/chorus_pro_credentials.py +95 -0
  36. factpulse-2.0.19/factpulse/models/code_cadre_facturation.py +39 -0
  37. factpulse-2.0.19/factpulse/models/code_raison_reduction.py +42 -0
  38. factpulse-2.0.19/factpulse/models/consulter_facture_request.py +98 -0
  39. factpulse-2.0.19/factpulse/models/consulter_facture_response.py +142 -0
  40. factpulse-2.0.19/factpulse/models/consulter_structure_request.py +100 -0
  41. factpulse-2.0.19/factpulse/models/consulter_structure_response.py +142 -0
  42. factpulse-2.0.19/factpulse/models/credentials_afnor.py +106 -0
  43. factpulse-2.0.19/factpulse/models/credentials_chorus_pro.py +115 -0
  44. factpulse-2.0.19/factpulse/models/destinataire.py +130 -0
  45. factpulse-2.0.19/factpulse/models/destination.py +140 -0
  46. factpulse-2.0.19/factpulse/models/destination_afnor.py +127 -0
  47. factpulse-2.0.19/factpulse/models/destination_chorus_pro.py +108 -0
  48. factpulse-2.0.19/factpulse/models/donnees_facture_simplifiees.py +124 -0
  49. factpulse-2.0.19/factpulse/models/error_level.py +37 -0
  50. factpulse-2.0.19/factpulse/models/error_source.py +43 -0
  51. factpulse-2.0.19/factpulse/models/facture_enrichie_info.py +133 -0
  52. factpulse-2.0.19/factpulse/models/facture_factur_x.py +183 -0
  53. factpulse-2.0.19/factpulse/models/format_sortie.py +37 -0
  54. factpulse-2.0.19/factpulse/models/fournisseur.py +153 -0
  55. factpulse-2.0.19/factpulse/models/generate_certificate_request.py +118 -0
  56. factpulse-2.0.19/factpulse/models/generate_certificate_response.py +106 -0
  57. factpulse-2.0.19/factpulse/models/http_validation_error.py +95 -0
  58. factpulse-2.0.19/factpulse/models/information_signature_api.py +122 -0
  59. factpulse-2.0.19/factpulse/models/ligne_de_poste.py +183 -0
  60. factpulse-2.0.19/factpulse/models/ligne_de_poste_montant_remise_ht.py +145 -0
  61. factpulse-2.0.19/factpulse/models/ligne_de_poste_taux_tva_manuel.py +145 -0
  62. factpulse-2.0.19/factpulse/models/ligne_de_tva.py +118 -0
  63. factpulse-2.0.19/factpulse/models/mode_depot.py +38 -0
  64. factpulse-2.0.19/factpulse/models/mode_paiement.py +41 -0
  65. factpulse-2.0.19/factpulse/models/montant_a_payer.py +139 -0
  66. factpulse-2.0.19/factpulse/models/montant_base_ht.py +139 -0
  67. factpulse-2.0.19/factpulse/models/montant_ht_total.py +139 -0
  68. factpulse-2.0.19/factpulse/models/montant_remise_globale_ttc.py +139 -0
  69. factpulse-2.0.19/factpulse/models/montant_total.py +133 -0
  70. factpulse-2.0.19/factpulse/models/montant_total_acompte.py +145 -0
  71. factpulse-2.0.19/factpulse/models/montant_total_ligne_ht.py +139 -0
  72. factpulse-2.0.19/factpulse/models/montant_ttc_total.py +139 -0
  73. factpulse-2.0.19/factpulse/models/montant_tva.py +139 -0
  74. factpulse-2.0.19/factpulse/models/montant_tva_ligne.py +139 -0
  75. factpulse-2.0.19/factpulse/models/montant_tva_total.py +139 -0
  76. factpulse-2.0.19/factpulse/models/montant_unitaire_ht.py +139 -0
  77. factpulse-2.0.19/factpulse/models/note.py +94 -0
  78. factpulse-2.0.19/factpulse/models/obtenir_id_chorus_pro_request.py +100 -0
  79. factpulse-2.0.19/factpulse/models/obtenir_id_chorus_pro_response.py +98 -0
  80. factpulse-2.0.19/factpulse/models/options_processing.py +94 -0
  81. factpulse-2.0.19/factpulse/models/parametres_signature.py +133 -0
  82. factpulse-2.0.19/factpulse/models/parametres_structure.py +91 -0
  83. factpulse-2.0.19/factpulse/models/pdf_factur_x_info.py +91 -0
  84. factpulse-2.0.19/factpulse/models/piece_jointe_complementaire.py +95 -0
  85. factpulse-2.0.19/factpulse/models/profil_api.py +39 -0
  86. factpulse-2.0.19/factpulse/models/quantite.py +139 -0
  87. factpulse-2.0.19/factpulse/models/quota_info.py +95 -0
  88. factpulse-2.0.19/factpulse/models/rechercher_services_response.py +101 -0
  89. factpulse-2.0.19/factpulse/models/rechercher_structure_request.py +119 -0
  90. factpulse-2.0.19/factpulse/models/rechercher_structure_response.py +101 -0
  91. factpulse-2.0.19/factpulse/models/references.py +124 -0
  92. factpulse-2.0.19/factpulse/models/reponse_tache.py +87 -0
  93. factpulse-2.0.19/factpulse/models/reponse_validation_erreur.py +87 -0
  94. factpulse-2.0.19/factpulse/models/reponse_validation_succes.py +87 -0
  95. factpulse-2.0.19/factpulse/models/resultat_afnor.py +105 -0
  96. factpulse-2.0.19/factpulse/models/resultat_chorus_pro.py +101 -0
  97. factpulse-2.0.19/factpulse/models/resultat_validation_pdfapi.py +169 -0
  98. factpulse-2.0.19/factpulse/models/scheme_id.py +40 -0
  99. factpulse-2.0.19/factpulse/models/service_structure.py +93 -0
  100. factpulse-2.0.19/factpulse/models/signature_info.py +101 -0
  101. factpulse-2.0.19/factpulse/models/soumettre_facture_complete_request.py +116 -0
  102. factpulse-2.0.19/factpulse/models/soumettre_facture_complete_response.py +145 -0
  103. factpulse-2.0.19/factpulse/models/soumettre_facture_request.py +176 -0
  104. factpulse-2.0.19/factpulse/models/soumettre_facture_response.py +103 -0
  105. factpulse-2.0.19/factpulse/models/statut_celery.py +40 -0
  106. factpulse-2.0.19/factpulse/models/statut_facture.py +96 -0
  107. factpulse-2.0.19/factpulse/models/statut_tache.py +97 -0
  108. factpulse-2.0.19/factpulse/models/structure_info.py +95 -0
  109. factpulse-2.0.19/factpulse/models/tauxmanuel.py +139 -0
  110. factpulse-2.0.19/factpulse/models/type_facture.py +37 -0
  111. factpulse-2.0.19/factpulse/models/type_tva.py +39 -0
  112. factpulse-2.0.19/factpulse/models/unite.py +41 -0
  113. factpulse-2.0.19/factpulse/models/utilisateur.py +128 -0
  114. factpulse-2.0.19/factpulse/models/validation_error.py +99 -0
  115. factpulse-2.0.19/factpulse/models/validation_error_detail.py +107 -0
  116. factpulse-2.0.19/factpulse/models/validation_error_loc_inner.py +138 -0
  117. factpulse-2.0.19/factpulse/py.typed +0 -0
  118. factpulse-2.0.19/factpulse/rest.py +258 -0
  119. factpulse-2.0.19/factpulse.egg-info/PKG-INFO +217 -0
  120. factpulse-2.0.19/factpulse.egg-info/SOURCES.txt +234 -0
  121. factpulse-2.0.19/factpulse.egg-info/dependency_links.txt +1 -0
  122. factpulse-2.0.19/factpulse.egg-info/requires.txt +4 -0
  123. factpulse-2.0.19/factpulse.egg-info/top_level.txt +2 -0
  124. factpulse-2.0.19/factpulse_helpers/__init__.py +69 -0
  125. factpulse-2.0.19/factpulse_helpers/client.py +537 -0
  126. factpulse-2.0.19/factpulse_helpers/exceptions.py +46 -0
  127. factpulse-2.0.19/pyproject.toml +94 -0
  128. factpulse-2.0.19/setup.cfg +7 -0
  129. factpulse-2.0.19/setup.py +49 -0
  130. factpulse-2.0.19/test/test_adresse_electronique.py +53 -0
  131. factpulse-2.0.19/test/test_adresse_postale.py +55 -0
  132. factpulse-2.0.19/test/test_afnorpdppa_api.py +38 -0
  133. factpulse-2.0.19/test/test_afnorpdppa_directory_service_api.py +164 -0
  134. factpulse-2.0.19/test/test_afnorpdppa_flow_service_api.py +59 -0
  135. factpulse-2.0.19/test/test_api_error.py +62 -0
  136. factpulse-2.0.19/test/test_body_ajouter_fichier_api_v1_chorus_pro_transverses_ajouter_fichier_post.py +79 -0
  137. factpulse-2.0.19/test/test_body_completer_facture_api_v1_chorus_pro_factures_completer_post.py +79 -0
  138. factpulse-2.0.19/test/test_body_lister_services_structure_api_v1_chorus_pro_structures_id_structure_cpp_services_get.py +77 -0
  139. factpulse-2.0.19/test/test_body_rechercher_factures_destinataire_api_v1_chorus_pro_factures_rechercher_destinataire_post.py +79 -0
  140. factpulse-2.0.19/test/test_body_rechercher_factures_fournisseur_api_v1_chorus_pro_factures_rechercher_fournisseur_post.py +79 -0
  141. factpulse-2.0.19/test/test_body_recycler_facture_api_v1_chorus_pro_factures_recycler_post.py +79 -0
  142. factpulse-2.0.19/test/test_body_telecharger_groupe_factures_api_v1_chorus_pro_factures_telecharger_groupe_post.py +79 -0
  143. factpulse-2.0.19/test/test_body_traiter_facture_recue_api_v1_chorus_pro_factures_traiter_facture_recue_post.py +79 -0
  144. factpulse-2.0.19/test/test_body_valideur_consulter_facture_api_v1_chorus_pro_factures_valideur_consulter_post.py +79 -0
  145. factpulse-2.0.19/test/test_body_valideur_rechercher_factures_api_v1_chorus_pro_factures_valideur_rechercher_post.py +79 -0
  146. factpulse-2.0.19/test/test_body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.py +79 -0
  147. factpulse-2.0.19/test/test_cadre_de_facturation.py +54 -0
  148. factpulse-2.0.19/test/test_categorie_tva.py +33 -0
  149. factpulse-2.0.19/test/test_certificate_info_response.py +73 -0
  150. factpulse-2.0.19/test/test_chorus_pro_api.py +143 -0
  151. factpulse-2.0.19/test/test_chorus_pro_credentials.py +59 -0
  152. factpulse-2.0.19/test/test_code_cadre_facturation.py +33 -0
  153. factpulse-2.0.19/test/test_code_raison_reduction.py +33 -0
  154. factpulse-2.0.19/test/test_consulter_facture_request.py +53 -0
  155. factpulse-2.0.19/test/test_consulter_facture_response.py +64 -0
  156. factpulse-2.0.19/test/test_consulter_structure_request.py +54 -0
  157. factpulse-2.0.19/test/test_consulter_structure_response.py +64 -0
  158. factpulse-2.0.19/test/test_credentials_afnor.py +53 -0
  159. factpulse-2.0.19/test/test_credentials_chorus_pro.py +55 -0
  160. factpulse-2.0.19/test/test_destinataire.py +66 -0
  161. factpulse-2.0.19/test/test_destination.py +54 -0
  162. factpulse-2.0.19/test/test_destination_afnor.py +54 -0
  163. factpulse-2.0.19/test/test_destination_chorus_pro.py +52 -0
  164. factpulse-2.0.19/test/test_donnees_facture_simplifiees.py +67 -0
  165. factpulse-2.0.19/test/test_error_level.py +33 -0
  166. factpulse-2.0.19/test/test_error_source.py +33 -0
  167. factpulse-2.0.19/test/test_facture_enrichie_info.py +64 -0
  168. factpulse-2.0.19/test/test_facture_factur_x.py +184 -0
  169. factpulse-2.0.19/test/test_format_sortie.py +33 -0
  170. factpulse-2.0.19/test/test_fournisseur.py +71 -0
  171. factpulse-2.0.19/test/test_generate_certificate_request.py +61 -0
  172. factpulse-2.0.19/test/test_generate_certificate_response.py +91 -0
  173. factpulse-2.0.19/test/test_http_validation_error.py +58 -0
  174. factpulse-2.0.19/test/test_information_signature_api.py +57 -0
  175. factpulse-2.0.19/test/test_ligne_de_poste.py +70 -0
  176. factpulse-2.0.19/test/test_ligne_de_poste_montant_remise_ht.py +50 -0
  177. factpulse-2.0.19/test/test_ligne_de_poste_taux_tva_manuel.py +50 -0
  178. factpulse-2.0.19/test/test_ligne_de_tva.py +57 -0
  179. factpulse-2.0.19/test/test_mode_depot.py +33 -0
  180. factpulse-2.0.19/test/test_mode_paiement.py +33 -0
  181. factpulse-2.0.19/test/test_montant_a_payer.py +50 -0
  182. factpulse-2.0.19/test/test_montant_base_ht.py +50 -0
  183. factpulse-2.0.19/test/test_montant_ht_total.py +50 -0
  184. factpulse-2.0.19/test/test_montant_remise_globale_ttc.py +50 -0
  185. factpulse-2.0.19/test/test_montant_total.py +61 -0
  186. factpulse-2.0.19/test/test_montant_total_acompte.py +50 -0
  187. factpulse-2.0.19/test/test_montant_total_ligne_ht.py +50 -0
  188. factpulse-2.0.19/test/test_montant_ttc_total.py +50 -0
  189. factpulse-2.0.19/test/test_montant_tva.py +50 -0
  190. factpulse-2.0.19/test/test_montant_tva_ligne.py +50 -0
  191. factpulse-2.0.19/test/test_montant_tva_total.py +50 -0
  192. factpulse-2.0.19/test/test_montant_unitaire_ht.py +50 -0
  193. factpulse-2.0.19/test/test_note.py +53 -0
  194. factpulse-2.0.19/test/test_obtenir_id_chorus_pro_request.py +54 -0
  195. factpulse-2.0.19/test/test_obtenir_id_chorus_pro_response.py +57 -0
  196. factpulse-2.0.19/test/test_options_processing.py +54 -0
  197. factpulse-2.0.19/test/test_parametres_signature.py +59 -0
  198. factpulse-2.0.19/test/test_parametres_structure.py +53 -0
  199. factpulse-2.0.19/test/test_pdf_factur_x_info.py +55 -0
  200. factpulse-2.0.19/test/test_piece_jointe_complementaire.py +60 -0
  201. factpulse-2.0.19/test/test_profil_api.py +33 -0
  202. factpulse-2.0.19/test/test_quantite.py +50 -0
  203. factpulse-2.0.19/test/test_quota_info.py +60 -0
  204. factpulse-2.0.19/test/test_rechercher_services_response.py +62 -0
  205. factpulse-2.0.19/test/test_rechercher_structure_request.py +55 -0
  206. factpulse-2.0.19/test/test_rechercher_structure_response.py +63 -0
  207. factpulse-2.0.19/test/test_references.py +61 -0
  208. factpulse-2.0.19/test/test_reponse_tache.py +52 -0
  209. factpulse-2.0.19/test/test_reponse_validation_erreur.py +56 -0
  210. factpulse-2.0.19/test/test_reponse_validation_succes.py +52 -0
  211. factpulse-2.0.19/test/test_resultat_afnor.py +58 -0
  212. factpulse-2.0.19/test/test_resultat_chorus_pro.py +54 -0
  213. factpulse-2.0.19/test/test_resultat_validation_pdfapi.py +99 -0
  214. factpulse-2.0.19/test/test_sant_api.py +45 -0
  215. factpulse-2.0.19/test/test_scheme_id.py +33 -0
  216. factpulse-2.0.19/test/test_service_structure.py +58 -0
  217. factpulse-2.0.19/test/test_signature_info.py +54 -0
  218. factpulse-2.0.19/test/test_soumettre_facture_complete_request.py +89 -0
  219. factpulse-2.0.19/test/test_soumettre_facture_complete_response.py +82 -0
  220. factpulse-2.0.19/test/test_soumettre_facture_request.py +71 -0
  221. factpulse-2.0.19/test/test_soumettre_facture_response.py +56 -0
  222. factpulse-2.0.19/test/test_statut_celery.py +33 -0
  223. factpulse-2.0.19/test/test_statut_facture.py +55 -0
  224. factpulse-2.0.19/test/test_statut_tache.py +55 -0
  225. factpulse-2.0.19/test/test_structure_info.py +60 -0
  226. factpulse-2.0.19/test/test_tauxmanuel.py +50 -0
  227. factpulse-2.0.19/test/test_traitement_facture_api.py +108 -0
  228. factpulse-2.0.19/test/test_type_facture.py +33 -0
  229. factpulse-2.0.19/test/test_type_tva.py +33 -0
  230. factpulse-2.0.19/test/test_unite.py +33 -0
  231. factpulse-2.0.19/test/test_utilisateur.py +71 -0
  232. factpulse-2.0.19/test/test_utilisateur_api.py +38 -0
  233. factpulse-2.0.19/test/test_validation_error.py +60 -0
  234. factpulse-2.0.19/test/test_validation_error_detail.py +57 -0
  235. factpulse-2.0.19/test/test_validation_error_loc_inner.py +50 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 FactPulse
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,217 @@
1
+ Metadata-Version: 2.4
2
+ Name: factpulse
3
+ Version: 2.0.19
4
+ Summary: API REST FactPulse
5
+ Home-page: https://github.com/factpulse/sdk-python
6
+ Author: OpenAPI Generator community
7
+ Author-email: OpenAPI Generator Community <team@openapitools.org>
8
+ Project-URL: Repository, https://github.com/GIT_USER_ID/GIT_REPO_ID
9
+ Keywords: OpenAPI,OpenAPI-Generator,API REST FactPulse
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: urllib3<3.0.0,>=2.1.0
14
+ Requires-Dist: python-dateutil>=2.8.2
15
+ Requires-Dist: pydantic>=2
16
+ Requires-Dist: typing-extensions>=4.7.1
17
+ Dynamic: author
18
+ Dynamic: home-page
19
+ Dynamic: license-file
20
+
21
+ # FactPulse SDK Python
22
+
23
+ Client Python officiel pour l'API FactPulse - Facturation électronique française.
24
+
25
+ ## 🎯 Fonctionnalités
26
+
27
+ - **Factur-X** : Génération et validation de factures électroniques (profils MINIMUM, BASIC, EN16931, EXTENDED)
28
+ - **Chorus Pro** : Intégration avec la plateforme de facturation publique française
29
+ - **AFNOR PDP/PA** : Soumission de flux conformes à la norme XP Z12-013
30
+ - **Signature électronique** : Signature PDF (PAdES-B-B, PAdES-B-T, PAdES-B-LT)
31
+ - **Client simplifié** : Authentification JWT et polling intégrés via `factpulse_helpers`
32
+
33
+ ## 🚀 Installation
34
+
35
+ ```bash
36
+ pip install factpulse
37
+ ```
38
+
39
+ ## 📖 Démarrage rapide
40
+
41
+ ### Méthode recommandée : Client simplifié avec helpers
42
+
43
+ Le module `factpulse_helpers` offre une API simplifiée avec authentification et polling automatiques :
44
+
45
+ ```python
46
+ from factpulse_helpers import FactPulseClient
47
+
48
+ # Créer le client (authentification automatique)
49
+ client = FactPulseClient(
50
+ email="votre_email@example.com",
51
+ password="votre_mot_de_passe"
52
+ )
53
+
54
+ # Données de la facture
55
+ facture_data = {
56
+ "numero_facture": "FAC-2025-001",
57
+ "date_facture": "2025-01-15",
58
+ "fournisseur": {
59
+ "nom": "Mon Entreprise SAS",
60
+ "siret": "12345678901234",
61
+ "adresse_postale": {
62
+ "ligne_un": "123 Rue Example",
63
+ "code_postal": "75001",
64
+ "nom_ville": "Paris",
65
+ "pays_code_iso": "FR"
66
+ }
67
+ },
68
+ "destinataire": {
69
+ "nom": "Client SARL",
70
+ "siret": "98765432109876",
71
+ "adresse_postale": {
72
+ "ligne_un": "456 Avenue Test",
73
+ "code_postal": "69001",
74
+ "nom_ville": "Lyon",
75
+ "pays_code_iso": "FR"
76
+ }
77
+ },
78
+ "montant_total": {
79
+ "montant_ht_total": "1000.00",
80
+ "montant_tva": "200.00",
81
+ "montant_ttc_total": "1200.00",
82
+ "montant_a_payer": "1200.00"
83
+ },
84
+ "lignes_de_poste": [{
85
+ "numero": 1,
86
+ "denomination": "Prestation de conseil",
87
+ "quantite": "10.00",
88
+ "unite": "PIECE",
89
+ "montant_unitaire_ht": "100.00"
90
+ }]
91
+ }
92
+
93
+ # Lire le PDF source
94
+ with open("facture_source.pdf", "rb") as f:
95
+ pdf_source = f.read()
96
+
97
+ # Générer le PDF Factur-X (polling automatique)
98
+ pdf_bytes = client.generer_facturx(
99
+ facture_data=facture_data,
100
+ pdf_source=pdf_source,
101
+ profil="EN16931",
102
+ sync=True # Attend le résultat automatiquement
103
+ )
104
+
105
+ # Sauvegarder
106
+ with open("facture_facturx.pdf", "wb") as f:
107
+ f.write(pdf_bytes)
108
+ ```
109
+
110
+ ### Méthode alternative : SDK brut
111
+
112
+ Pour un contrôle total, utilisez le SDK généré directement :
113
+
114
+ ```python
115
+ from factpulse import ApiClient, Configuration
116
+ from factpulse.api import TraitementFactureApi
117
+ import requests
118
+ import json
119
+
120
+ # 1. Obtenir le token JWT
121
+ response = requests.post(
122
+ 'https://factpulse.fr/api/token/',
123
+ json={
124
+ 'username': 'votre_email@example.com',
125
+ 'password': 'votre_mot_de_passe'
126
+ }
127
+ )
128
+ token = response.json()['access']
129
+
130
+ # 2. Configurer le client
131
+ config = Configuration(host='https://factpulse.fr/api/facturation')
132
+ config.access_token = token
133
+ client = ApiClient(configuration=config)
134
+
135
+ # 3. Appeler l'API
136
+ api = TraitementFactureApi(client)
137
+ response = api.generer_facture_api_v1_traitement_generer_facture_post(
138
+ donnees_facture=json.dumps(facture_data),
139
+ profil='EN16931',
140
+ format_sortie='pdf',
141
+ source_pdf=pdf_source
142
+ )
143
+
144
+ # 4. Polling manuel pour récupérer le résultat
145
+ task_id = response.id_tache
146
+ # ... (implémenter le polling)
147
+ ```
148
+
149
+ ## 🔧 Avantages de factpulse_helpers
150
+
151
+ | Fonctionnalité | SDK brut | factpulse_helpers |
152
+ |----------------|----------|-------------------|
153
+ | Authentification | Manuelle | Automatique |
154
+ | Refresh token | Manuel | Automatique |
155
+ | Polling tâches async | Manuel | Automatique (backoff) |
156
+ | Retry sur 401 | Manuel | Automatique |
157
+ | Conversion Decimal | Manuelle | Helper inclus |
158
+
159
+ ## 🔑 Options d'authentification
160
+
161
+ ### Client UID (multi-clients)
162
+
163
+ Si vous gérez plusieurs clients et souhaitez accéder aux credentials d'un client spécifique :
164
+
165
+ ```python
166
+ client = FactPulseClient(
167
+ email="votre_email@example.com",
168
+ password="votre_mot_de_passe",
169
+ client_uid="identifiant_client" # UID du client cible
170
+ )
171
+ ```
172
+
173
+ ### Configuration avancée
174
+
175
+ ```python
176
+ client = FactPulseClient(
177
+ email="votre_email@example.com",
178
+ password="votre_mot_de_passe",
179
+ api_url="https://factpulse.fr", # URL personnalisée
180
+ polling_interval=2, # Intervalle de polling initial (secondes)
181
+ polling_timeout=120, # Timeout de polling (secondes)
182
+ max_retries=2 # Tentatives en cas de 401
183
+ )
184
+ ```
185
+
186
+ ## 💡 Formats de montants acceptés
187
+
188
+ L'API accepte plusieurs formats pour les montants monétaires :
189
+
190
+ ```python
191
+ # String (recommandé pour la précision)
192
+ montant = "1234.56"
193
+
194
+ # Number (float)
195
+ montant = 1234.56
196
+
197
+ # Integer
198
+ montant = 1234
199
+
200
+ # Decimal Python
201
+ from decimal import Decimal
202
+ montant = Decimal("1234.56")
203
+
204
+ # Helper de formatage
205
+ montant_formate = FactPulseClient.format_montant(1234.5) # "1234.50"
206
+ ```
207
+
208
+ ## 📚 Ressources
209
+
210
+ - **Documentation API** : https://factpulse.fr/api/facturation/documentation
211
+ - **Code source** : https://github.com/factpulse/sdk-python
212
+ - **Issues** : https://github.com/factpulse/sdk-python/issues
213
+ - **Support** : contact@factpulse.fr
214
+
215
+ ## 📄 Licence
216
+
217
+ MIT License - Copyright (c) 2025 FactPulse
@@ -0,0 +1,197 @@
1
+ # FactPulse SDK Python
2
+
3
+ Client Python officiel pour l'API FactPulse - Facturation électronique française.
4
+
5
+ ## 🎯 Fonctionnalités
6
+
7
+ - **Factur-X** : Génération et validation de factures électroniques (profils MINIMUM, BASIC, EN16931, EXTENDED)
8
+ - **Chorus Pro** : Intégration avec la plateforme de facturation publique française
9
+ - **AFNOR PDP/PA** : Soumission de flux conformes à la norme XP Z12-013
10
+ - **Signature électronique** : Signature PDF (PAdES-B-B, PAdES-B-T, PAdES-B-LT)
11
+ - **Client simplifié** : Authentification JWT et polling intégrés via `factpulse_helpers`
12
+
13
+ ## 🚀 Installation
14
+
15
+ ```bash
16
+ pip install factpulse
17
+ ```
18
+
19
+ ## 📖 Démarrage rapide
20
+
21
+ ### Méthode recommandée : Client simplifié avec helpers
22
+
23
+ Le module `factpulse_helpers` offre une API simplifiée avec authentification et polling automatiques :
24
+
25
+ ```python
26
+ from factpulse_helpers import FactPulseClient
27
+
28
+ # Créer le client (authentification automatique)
29
+ client = FactPulseClient(
30
+ email="votre_email@example.com",
31
+ password="votre_mot_de_passe"
32
+ )
33
+
34
+ # Données de la facture
35
+ facture_data = {
36
+ "numero_facture": "FAC-2025-001",
37
+ "date_facture": "2025-01-15",
38
+ "fournisseur": {
39
+ "nom": "Mon Entreprise SAS",
40
+ "siret": "12345678901234",
41
+ "adresse_postale": {
42
+ "ligne_un": "123 Rue Example",
43
+ "code_postal": "75001",
44
+ "nom_ville": "Paris",
45
+ "pays_code_iso": "FR"
46
+ }
47
+ },
48
+ "destinataire": {
49
+ "nom": "Client SARL",
50
+ "siret": "98765432109876",
51
+ "adresse_postale": {
52
+ "ligne_un": "456 Avenue Test",
53
+ "code_postal": "69001",
54
+ "nom_ville": "Lyon",
55
+ "pays_code_iso": "FR"
56
+ }
57
+ },
58
+ "montant_total": {
59
+ "montant_ht_total": "1000.00",
60
+ "montant_tva": "200.00",
61
+ "montant_ttc_total": "1200.00",
62
+ "montant_a_payer": "1200.00"
63
+ },
64
+ "lignes_de_poste": [{
65
+ "numero": 1,
66
+ "denomination": "Prestation de conseil",
67
+ "quantite": "10.00",
68
+ "unite": "PIECE",
69
+ "montant_unitaire_ht": "100.00"
70
+ }]
71
+ }
72
+
73
+ # Lire le PDF source
74
+ with open("facture_source.pdf", "rb") as f:
75
+ pdf_source = f.read()
76
+
77
+ # Générer le PDF Factur-X (polling automatique)
78
+ pdf_bytes = client.generer_facturx(
79
+ facture_data=facture_data,
80
+ pdf_source=pdf_source,
81
+ profil="EN16931",
82
+ sync=True # Attend le résultat automatiquement
83
+ )
84
+
85
+ # Sauvegarder
86
+ with open("facture_facturx.pdf", "wb") as f:
87
+ f.write(pdf_bytes)
88
+ ```
89
+
90
+ ### Méthode alternative : SDK brut
91
+
92
+ Pour un contrôle total, utilisez le SDK généré directement :
93
+
94
+ ```python
95
+ from factpulse import ApiClient, Configuration
96
+ from factpulse.api import TraitementFactureApi
97
+ import requests
98
+ import json
99
+
100
+ # 1. Obtenir le token JWT
101
+ response = requests.post(
102
+ 'https://factpulse.fr/api/token/',
103
+ json={
104
+ 'username': 'votre_email@example.com',
105
+ 'password': 'votre_mot_de_passe'
106
+ }
107
+ )
108
+ token = response.json()['access']
109
+
110
+ # 2. Configurer le client
111
+ config = Configuration(host='https://factpulse.fr/api/facturation')
112
+ config.access_token = token
113
+ client = ApiClient(configuration=config)
114
+
115
+ # 3. Appeler l'API
116
+ api = TraitementFactureApi(client)
117
+ response = api.generer_facture_api_v1_traitement_generer_facture_post(
118
+ donnees_facture=json.dumps(facture_data),
119
+ profil='EN16931',
120
+ format_sortie='pdf',
121
+ source_pdf=pdf_source
122
+ )
123
+
124
+ # 4. Polling manuel pour récupérer le résultat
125
+ task_id = response.id_tache
126
+ # ... (implémenter le polling)
127
+ ```
128
+
129
+ ## 🔧 Avantages de factpulse_helpers
130
+
131
+ | Fonctionnalité | SDK brut | factpulse_helpers |
132
+ |----------------|----------|-------------------|
133
+ | Authentification | Manuelle | Automatique |
134
+ | Refresh token | Manuel | Automatique |
135
+ | Polling tâches async | Manuel | Automatique (backoff) |
136
+ | Retry sur 401 | Manuel | Automatique |
137
+ | Conversion Decimal | Manuelle | Helper inclus |
138
+
139
+ ## 🔑 Options d'authentification
140
+
141
+ ### Client UID (multi-clients)
142
+
143
+ Si vous gérez plusieurs clients et souhaitez accéder aux credentials d'un client spécifique :
144
+
145
+ ```python
146
+ client = FactPulseClient(
147
+ email="votre_email@example.com",
148
+ password="votre_mot_de_passe",
149
+ client_uid="identifiant_client" # UID du client cible
150
+ )
151
+ ```
152
+
153
+ ### Configuration avancée
154
+
155
+ ```python
156
+ client = FactPulseClient(
157
+ email="votre_email@example.com",
158
+ password="votre_mot_de_passe",
159
+ api_url="https://factpulse.fr", # URL personnalisée
160
+ polling_interval=2, # Intervalle de polling initial (secondes)
161
+ polling_timeout=120, # Timeout de polling (secondes)
162
+ max_retries=2 # Tentatives en cas de 401
163
+ )
164
+ ```
165
+
166
+ ## 💡 Formats de montants acceptés
167
+
168
+ L'API accepte plusieurs formats pour les montants monétaires :
169
+
170
+ ```python
171
+ # String (recommandé pour la précision)
172
+ montant = "1234.56"
173
+
174
+ # Number (float)
175
+ montant = 1234.56
176
+
177
+ # Integer
178
+ montant = 1234
179
+
180
+ # Decimal Python
181
+ from decimal import Decimal
182
+ montant = Decimal("1234.56")
183
+
184
+ # Helper de formatage
185
+ montant_formate = FactPulseClient.format_montant(1234.5) # "1234.50"
186
+ ```
187
+
188
+ ## 📚 Ressources
189
+
190
+ - **Documentation API** : https://factpulse.fr/api/facturation/documentation
191
+ - **Code source** : https://github.com/factpulse/sdk-python
192
+ - **Issues** : https://github.com/factpulse/sdk-python/issues
193
+ - **Support** : contact@factpulse.fr
194
+
195
+ ## 📄 Licence
196
+
197
+ MIT License - Copyright (c) 2025 FactPulse