GNU Lesser General Public License v3.0

项目介绍

reingart/pyafipws 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 GNU Lesser General Public License v3.0 许可证,目前获得 366 个 Star、283 次 Fork。

仓库全名
reingart/pyafipws
开源许可证
GNU Lesser General Public License v3.0
Star 数
366
Fork 数
283
未关闭 Issue
55

README 摘要

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 - 2022 (C) Mariano Reingart [email protected] (creator and maintainter). All rights reserved. License: LGPLv3+, with "commercial" exception available to include it and distribute with…

完整内容见 GitHub 原始 README 或本页 。

常见问题

pyafipws 用什么语言开发?

主要使用 Python 编写,采用 GNU Lesser General Public License v3.0 许可证,目前有 366 个 Star。

pyafipws 可以免费商用吗?

仓库标注的许可证为 GNU Lesser General Public License v3.0,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 pyafipws 的源码?

可以直接克隆仓库:git clone https://github.com/reingart/pyafipws.git,默认分支为 main;安装与运行步骤见仓库 README。

pyafipws 最近还在维护吗?

仓库最近一次更新为 2025年7月20日,当前有 55 个未关闭 Issue;Star 数为 366,可作为社区活跃度的参考。

关于

GitHub 原始描述

Factura Electrónica AFIP y otros servicios web (proyecto software libre) — Interfases, tools and apps for Argentina's gov't. webservices (soap, com/dll simil-ocx, pdf, dbf, xml, json, etc.) #python

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

Batchfile
C
C#
Java
Makefile
PHP
PowerShell
Python
VBScript
Visual Basic .NET
Visual Basic 6.0
xBase

README

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 - 2022 © Mariano Reingart [email protected] (creator and maintainter). All rights reserved.

License: LGPLv3+, with “commercial” exception available to include it and distribute with propietary programs

General Information:

Project Structure:

  • Python library (a helper class for each webservice for easy use of their methods and attributes)
  • PyAfipWs: OCX-like Windows Component-Object-Model 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 (TXT, DBF, JSON)
  • PyRece GUI and FacturaLibre WEB apps as complete reference implementations
  • Examples for Java, .NET (C#, VB.NET), Visual Basic, Visual Fox Pro, Delphi, C, PHP.
  • Minor code fragment samples for SAP (ABAP), PowerBuilder, Fujitsu Net Cobol, Clarion, etc.
  • Modules for OpenERP/Odoo - 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-
  • WSCT: tourism (electronic invoice) -“tax free” VAT refund for tourists-
  • WSBFEv1: tax bonus (electronic invoice)
  • WSFEXv1: foreign trade (electronic invoice) -English-
  • WSCTG: agriculture (grain traceability code)
  • WSLPG: agriculture (grain liquidation - invoice)
  • WSLTV: agriculture (green tobacco - invoice)
  • WSLUM: agriculture (milk - invoice)
  • WSLSP: agriculture (cattle/livestock - invoice)
  • 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:

Notes:

You could see the .github directory for detailed workflows and automated commands to build the project.

Quick-Start

These instructions are for Ubuntu/Debian. In Windows you can use PowerShell.

You can download the compressed file: https://github.com/reingart/pyafipws/archive/main.zip and unzip it.

Then install dependencies and the project itself:

pip download https://github.com/reingart/pyafipws/archive/main.zip
python -m zipfile -e main.zip  .
cd pyafipws-main
pip install -r requirements.txt --user
python setup.py install

You’ll need a digital certificate (.crt) and private key (.key) to authenticate (see certificate generation for more information and instructions). Provisionally, you can use author’s testing certificate/key:

wget https://www.sistemasagiles.com.ar/soft/pyafipws/reingart.zip -O reingart.zip
python -m zipfile -e reingart.zip .

You should copy and configure rece.ini to set up paths and URLs:

cp conf/*.ini .

Then, you could execute WSAA script to authenticate (getting Token and Sign) and WSFEv1 to process an electronic invoice:

python -m pyafipws.wsaa
python -m pyafipws.wsfev1 --prueba

With the last command, you should get the Electronic Autorization Code (CAE) for testing purposes (sample invoice data, do not use in production!).

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:

git clone https://github.com/reingart/pyafipws.git
cd pyafipws
python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt

Run python setup_win.py py2exe to build in windows and “compile” executables. See the GitHub Actions for specific steps and more details.

Just execute pytest to run automated Python tests. For Windows, see tests/powershell directory for Pester tests.

Dependency installation (development):

For SOAP webservices PySimpleSOAP is needed (spin-off of this library, inspired by the PHP SOAP extension):

git clone https://github.com/pysimplesoap/pysimplesoap.git -b stable_py3k
cd pysimplesoap
python setup.py install

Use “stable_py3k” branch reingart (see requirements.txt for more information)

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

git clone https://github.com/reingart/pyfpdf.git
cd pyfpdf
python setup.py install

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

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

评论

暂无评论