@@ -3,24 +3,20 @@ pyafipws
3
3
4
4
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.
5
5
6
- Copyright 2008 -
2016 (C) Mariano Reingart
[ [email protected] ] ( mailto:[email protected] ) (creator and maintainter). All rights reserved.
6
+ Copyright 2008 -
2022 (C) Mariano Reingart
[ [email protected] ] ( mailto:[email protected] ) (creator and maintainter). All rights reserved.
7
7
8
- License: GPLv3 +, with "commercial" exception available to include it and distribute with propietary programs
8
+ License: LGPLv3 +, with "commercial" exception available to include it and distribute with propietary programs
9
9
10
10
General Information:
11
11
--------------------
12
12
13
13
* Main Project Site: https://github.com/reingart/pyafipws (git repository)
14
- * Mirror (Historic): https://code.google.com/p/pyafipws/ (mercurial repository)
15
14
* User Manual: (http://www.sistemasagiles.com.ar/trac/wiki/ManualPyAfipWs (Spanish)
16
15
* Documentation: https://github.com/reingart/pyafipws/wiki (Spanish/English)
17
16
* Commercial Support: http://www.sistemasagiles.com.ar/ (Spanish)
18
17
* Community Site: http://www.pyafipws.com.ar/ (Spanish)
19
18
* Public Forum: http://groups.google.com/group/pyafipws (community support, no-charge "gratis" access)
20
19
21
- More information at [ Python Argentina Magazine article] ( http://revista.python.org.ar/2/en/html/pyafip.html ) (English)
22
- and [ JAIIO 2012 paper] ( http://41jaiio.sadio.org.ar/sites/default/files/15_JSL_2012.pdf ) (Spanish)
23
-
24
20
Project Structure:
25
21
------------------
26
22
58
54
* [ WSLTV] [ 17b ] : agriculture (green tobacco - invoice)
59
55
* [ WSLUM] [ 17c ] : agriculture (milk - invoice)
60
56
* [ WSLSP] [ 17d ] : agriculture (cattle/livestock - invoice)
61
- * [ wDigDepFiel] [ 18 ] : customs (faithful depositary)
62
- * [ WSCOC] [ 19 ] : currency exchange operations autorization
63
57
* [ WSCDC] [ 22 ] : invoice verification
64
58
* [ Taxpayers' Registe] [ 26 ] : database to check sellers and buyers register
65
59
@@ -76,39 +70,45 @@ ANMAT/SEDRONAR/SENASA (SNT):
76
70
Installation Instructions:
77
71
--------------------------
78
72
73
+ Notes:
74
+ * Python 3.9 is recommended for new apps: https://www.python.org/downloads/
75
+ * Python 2.7 is still supported for legacy apps but compatibility will be removed soon
76
+
77
+ You could see the ` .github ` directory for detailed workflows and automated commands to build the project.
78
+
79
79
## Quick-Start
80
80
81
- On Ubuntu (GNU/Linux), you will need to install httplib2 and openssl binding.
82
- Then you can download the compressed file, unzip it and use:
81
+ These instructions are for Ubuntu/Debian. In Windows you can use PowerShell.
83
82
83
+ You can download the compressed file: https://github.com/reingart/pyafipws/archive/main.zip and unzip it.
84
+
85
+ Then install dependencies and the project itself:
84
86
```
85
- sudo apt-get install python-httplib2 python-m2crypto
86
- wget https://github.com/reingart/pyafipws/archive/master. zip
87
- unzip master.zip
88
- cd pyafipws-master
89
- sudo pip install -r requirements.txt
87
+ pip download https://github.com/reingart/pyafipws/archive/main.zip
88
+ python -m zipfile -e main. zip .
89
+ cd pyafipws-main
90
+ pip install -r requirements.txt --user
91
+ python setup.py install
90
92
```
91
93
92
- ** Note:** M2Crypto is optional, the library will use OpenSSL directly (using
93
- subprocess)
94
-
95
94
You'll need a digital certificate (.crt) and private key (.key) to authenticate
96
95
(see [ certificate generation] [ 29 ] for more information and instructions).
97
96
Provisionally, you can use author's testing certificate/key:
98
-
99
97
```
100
- wget https://www.sistemasagiles.com.ar/soft/pyafipws/reingart.zip
101
- unzip reingart.zip
98
+ wget https://www.sistemasagiles.com.ar/soft/pyafipws/reingart.zip -O reingart.zip
99
+ python -m zipfile -e reingart.zip .
102
100
```
103
101
104
- You should configure ` rece.ini ` to set up paths and URLs if using other values
105
- than defaults.
102
+ You should copy and configure ` rece.ini ` to set up paths and URLs:
103
+ ```
104
+ cp conf/*.ini .
105
+ ```
106
106
107
107
Then, you could execute ` WSAA ` script to authenticate (getting Token and Sign)
108
108
and ` WSFEv1 ` to process an electronic invoice:
109
109
```
110
- python wsaa.py
111
- python wsfev1.py --prueba
110
+ python -m pyafipws.wsaa
111
+ python -m pyafipws.wsfev1 --prueba
112
112
```
113
113
114
114
With the last command, you should get the Electronic Autorization Code (CAE)
@@ -120,52 +120,42 @@ The following commands clone the repository, creates a virtualenv and install
120
120
the packages there (including the latest versions of the dependencies) to avoid
121
121
conflicts with other libraries:
122
122
```
123
- sudo apt-get install python-dev swig python-virtualenv mercurial python-pip libssl-dev python-dulwich
124
- hg clone git+https://github.com/reingart/pyafipws.git --config extensions.hggit=
123
+ git clone https://github.com/reingart/pyafipws.git
125
124
cd pyafipws
126
- virtualenv venv
127
- source venv/bin/activate
125
+ python -m venv . venv
126
+ . . venv/bin/activate
128
127
pip install -r requirements.txt
128
+ pip install -r requirements-dev.txt
129
129
```
130
130
131
- ** Note:** For convenience, development is done using mercurial;
132
- You could use [ hg-git] [ 30 ] or git directly.
131
+ Run ` python setup_win.py py2exe ` to build in windows and "compile" executables.
132
+ See the GitHub Actions for specific steps and more details.
133
+
134
+ Just execute ` pytest ` to run automated Python tests.
135
+ For Windows, see ` tests/powershell ` directory for Pester tests.
133
136
134
137
## Dependency installation (development):
135
138
136
139
For SOAP webservices [ PySimpleSOAP] ( https://github.com/pysimplesoap/pysimplesoap ) is
137
140
needed (spin-off of this library, inspired by the PHP SOAP extension):
138
141
139
142
```
140
- hg clone git+ https://github.com/pysimplesoap/pysimplesoap.git --config extensions.hggit=
143
+ git clone https://github.com/pysimplesoap/pysimplesoap.git -b stable_py3k
141
144
cd pysimplesoap
142
- hg up reingart
143
145
python setup.py install
144
146
```
145
147
146
- Use "stable " branch reingart (see ` requirements.txt ` for more information)
148
+ Use "stable_py3k " branch reingart (see ` requirements.txt ` for more information)
147
149
148
150
For PDF generation, you will need the [ PyFPDF] ( https://github.com/reingart/pyfpdf )
149
151
(PHP's FPDF library, python port):
150
152
151
153
```
152
- hg clone git+ https://github.com/reingart/pyfpdf.git --config extensions.hggit=
154
+ git clone https://github.com/reingart/pyfpdf.git
153
155
cd pyfpdf
154
156
python setup.py install
155
157
```
156
158
157
- For the GUI app, you will need [ wxPython] ( http://www.wxpython.org/ ) :
158
- ```
159
- sudo apt-get install wxpython
160
- ```
161
-
162
- PythonCard is being replaced by [ gui2py] ( https://github.com/reingart/gui2py/ ) :
163
- ```
164
- pip install gui2py
165
- ```
166
-
167
- For the WEB app, you will need [ web2py] ( http://www.web2py.com/ ) .
168
-
169
159
On Windows, you can see available installers released for evaluation purposes on
170
160
[ Download Releases] ( https://github.com/reingart/pyafipws/releases )
171
161
@@ -192,8 +182,6 @@ For more information see the source code installation steps in the
192
182
[ 17b ] : http://www.sistemasagiles.com.ar/trac/wiki/LiquidacionTabacoVerde
193
183
[ 17c ] : http://www.sistemasagiles.com.ar/trac/wiki/LiquidacionUnicaMensualLecheria
194
184
[ 17d ] : http://www.sistemasagiles.com.ar/trac/wiki/LiquidacionSectorPecuario
195
- [ 18 ] : http://www.sistemasagiles.com.ar/trac/wiki/ManualPyAfipWs#wDigDepFiel:DepositarioFiel
196
- [ 19 ] : http://www.sistemasagiles.com.ar/trac/wiki/ConsultaOperacionesCambiarias
197
185
[ 20 ] : http://www.sistemasagiles.com.ar/trac/wiki/RemitoElectronicoCotArba
198
186
[ 21 ] : http://www.sistemasagiles.com.ar/trac/wiki/TrazabilidadMedicamentos
199
187
[ 22 ] : http://www.sistemasagiles.com.ar/trac/wiki/FacturaElectronicaMTXCAService
@@ -205,4 +193,3 @@ For more information see the source code installation steps in the
205
193
[ 27 ] : https://github.com/reingart/openerp_pyafipws
206
194
[ 28 ] : https://github.com/tryton-ar/account_invoice_ar
207
195
[ 29 ] : http://www.sistemasagiles.com.ar/trac/wiki/ManualPyAfipWs#Certificados
208
- [ 30 ] : http://hg-git.github.io/
0 commit comments