Skip to main content

Interfases, tools and apps for Argentina's gov't. webservices (soap, com/dll, pdf, dbf, xml, etc.)

Project description

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 - 2015 (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.

  • Modules for OpenERP - Tryton

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-

  • WSBFEv1: 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

  • WSCDC: invoice verification

  • Taxpayers’ Registe: database to check sellers and buyers register

ARBA:

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

ANMAT/SEDRONAR/SENASA (SNT):

  • TrazaMed: National Medical Drug Traceability Program

  • TrazaRenpre: Controlled Chemical Precursors Traceability Program

  • TrazaFito: Phytosanitary Products Traceability Program

Installation Instructions:

Quick-Start

On Ubuntu (GNU/Linux), you will need to install httplib2 and openssl binding. Then you can download the compressed file, unzip it and use:

sudo apt-get install python-httplib2 python-m2crypto
wget https://pyafipws.googlecode.com/archive/default.zip
unzip default.zip
cd pyafipws-default
sudo pip install -r requirements.txt

Note: M2Crypto is optional, the library will use OpenSSL directly (using subprocess)

Virtual environment (testing):

The following commands clone the repository, creates a virtualenv and install the packages there (including the latest versions of the dependencies) to avoid conflicts with other libraries:

sudo apt-get install python-dev swig python-virtualenv mercurial python-pip libssl-dev
hg clone https://code.google.com/p/pyafipws
cd pyafipws
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Dependency installation (development):

For SOAP webservices PySimpleSOAP is needed (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

For more information see the source code installation steps in the wiki

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

PyAfipWs-2.7.1859.tar.gz (257.1 kB view details)

Uploaded Source

File details

Details for the file PyAfipWs-2.7.1859.tar.gz.

File metadata

  • Download URL: PyAfipWs-2.7.1859.tar.gz
  • Upload date:
  • Size: 257.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyAfipWs-2.7.1859.tar.gz
Algorithm Hash digest
SHA256 27e89596bc44aafe9be561e2a30cd676c9ca5f3ad6848e8bdc88cabe1012b33c
MD5 586b806c8a3317dcfa116ca731c7e65a
BLAKE2b-256 b41b8ad87af69b1da31f11d677841cf3f16bf6c471111376993c3b43fa800116

See more details on using hashes here.

Supported by

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