Skip to content

Latest commit

 

History

History
122 lines (92 loc) · 5.84 KB

README.md

File metadata and controls

122 lines (92 loc) · 5.84 KB

pyafipws

PyAfipWs contains Python modules to operate with web services regarding AFIP (Argentina's "IRS") and other government agencies, mainly related to electronic invoicing, several taxes and traceability.

Copyright 2008 - 2013 (C) Mariano Reingart reingart@gmail.com (creator and maintainter). All rights reserved.

License: GPLv3+, with "commercial" exception available to include it and distribute with propietary programs

General Information:

More information at Python Argentina Magazine article (English) and JAIIO 2012 paper (Spanish)

Project Structure:

  • Python library (a helper class for each webservice for easy use of their methods and attributes)
  • PyAfipWs: OCX-like Windows COM interface compatible with legacy programming languages (VB, VFP, Delphi, PHP, VB.NET, etc.)
  • LibPyAfipWs: DLL/.so compiled shared library (exposing python methods to C/C++/C#)
  • Console (command line) tools using simplified input & ouput files
  • PyRece GUI and FacturaLibre WEB apps as complete reference implementations
  • Examples for Visual Basic, Visual Fox Pro, Delphi, C, PHP.
  • Minor code fragment samples for SAP (ABAP), PowerBuilder, Fujitsu Net Cobol, Clarion, etc.
  • OpenERP module (comming soon)

Features implemented:

  • Supported alternate interchange formats: TXT (fixed lenght COBOL), CSV, DBF (Clipper/xBase/Harbour), XML, JSON, etc.
  • Full automation to request authentication and invoice authorization (CAE, COE, etc.)
  • Advanced XML manipulation, caching and proxy support.
  • Customizable PDF generation and visual designer (CSV templates)
  • Email, barcodes (PIL), installation (NSIS), configuration (.INI), debugging and other misc utilities

Web services supported so far:

AFIP:

  • WSAA: authorization & authentication, including digital cryptographic signature
  • WSFEv1: domestic market (electronic invoice) -English-
  • WSMTXCA: domestic market (electronic invoice) -detailing articles and barcodes-
  • WSBFE: tax bonus (electronic invoice)
  • WSFEXv1: foreign trade (electronic invoice) -English-
  • WSCTG: agriculture (grain traceability code)
  • WSLPG: agriculture (grain liquidation - invoice)
  • wDigDepFiel: customs (faithful depositary)
  • WSCOC: currency exchange operations autorization

ARBA:

  • COT: Provincial Operation Transport Code (aka electronic Shipping note)

ANMAT:

  • TrazaMed: National Medical Drug Traceability Program
  • Traza Renpre SEDRONAR: Controlled Chemical Precursors Traceability Program (comming soon)

Installation Instructions:

On Ubuntu (GNU/Linux), you will need to install the following dependencies:

httplib2 and openssl binding:

apt-get install python-httplib2 python-m2crypto

For SOAP webservices you will need PySimpleSOAP (spin-off of this library, inspired by the PHP SOAP extension):

hg clone https://code.google.com/p/pysimplesoap/ 
cd pysimplesoap
hg update reingart
sudo python setup.py install

For PDF generation, you will need the PyFPDF (PHP's FPDF library, python port):

hg clone https://code.google.com/p/pyfpdf/ 
cd pyfpdf
sudo python setup.py install

For the GUI app, you will need wxPython:

sudo apt-get install wxpython

PythonCard is being replaced by gui2py:

hg clone https://code.google.com/p/gui2py/ 
cd gui2py
sudo python setup.py install

For the WEB app, you will need web2py.

On Windows, you can see available installers released for evaluation purposes on Downloads