API para interactuar con los Web Services de AFIP
Project description
Cliente de Servicios Web de ARCA
Cliente en Python para acceder a los servicios web de ARCA (Administración Federal de Ingresos Públicos de Argentina). Maneja la autenticación y la comunicación con los servicios SOAP de ARCA.
Características
- Gestión de tokens de autenticación
- Integración con servicios SOAP de ARCA
- Consultas de metodos y elementos
- Soporte para entornos de producción y prueba
Requisitos
- Python 3.8+
- cryptography
- zeep
- python-dateutil
- Certificados de ARCA (prueba o producción)
Instalación
pip install arca_arg
Configuración
- Configurar los ajustes en
settings.py:
CUIT = "TU_CUIT_AQUI"
PROD = False # True para producción
CERT_PATH = "carpeta con el certificado de arca"
PRIVATE_KEY_PATH = "Carpeta con el la clave privada"
TA_FILES_PATH="donde se guardaran temporalmente los token de acceso"
Uso
import arca_arg.settings as confg
confg.PRIVATE_KEY_PATH = 'key/test.key'
confg.CERT_PATH = 'cert/TestCert.pem'
confg.TA_FILES_PATH = '/ta/'
confg.CUIT = '20293188204'
from arca_arg.webservice import ArcaWebService
from arca_arg.settings import WSDL_FEV1_HOM, WS_LIST
arca_service = ArcaWebService(WSDL_FEV1_HOM, 'wsfe') # Instancia del servicio web
print(arca_service.list_methods()) # Lista de métodos del servicio inicializado
print(arca_service.method_help('FECAESolicitar')) # Ayuda con el método consultarProvincias del servicio web
print(arca_service.get_type('FECAEDetRequest')) # Ayuda de composición del elemento a enviar.
auth = {'Token': arca_service.token, 'Sign': arca_service.sign, 'Cuit': arca_service.cuit,}
cabecera = { 'CantReg': 1, 'PtoVta': 1, 'CbteTipo':1}
detalle = {
'Concepto' : 1,
'DocTipo' : 80,
'DocNro': 27293188217,
'CbteDesde': 4,
'CbteHasta': 4,
'CbteFch': "20250124",
'ImpTotal':121,
'ImpTotConc': 0,
'ImpNeto': 100,
'ImpOpEx': 0,
'ImpIVA': 21,
'ImpTrib': 0,
'MonId': "PES",
'MonCotiz':1,
'Iva': {'AlicIva': {'Id': 5, 'BaseImp': 100, 'Importe': 21}}
}
# preparando los datos a enviar al ws
data = {'Auth': auth,
'FeCAEReq': { 'FeCabReq': cabecera, 'FeDetReq': {'FECAEDetRequest': detalle}}
}
# imprimir el xml que se va enviar antes de procesarlo
print(arca_service.create_message('FECAESolicitar', data)
# envio del request
arca_service.send_request('FECAESolicitar', data)
Estructura del Proyecto
arca_arg/
├── arca_arg/
│ ├── auth.py
│ ├── settings.py
│ ├── webservice.py
└── README.md
Contribuir
Cómo Contribuir
- Hacer un fork del repositorio
- Crear una rama para tu funcionalidad (
git checkout -b feature/amazing-feature) - Confirmar tus cambios (
git commit -m 'Add some amazing feature') - Subir a la rama(
git push origin feature/amazing-feature) - Abrir un Pull Request
Directrices de Desarrollo
- Seguir la guía de estilo PEP 8
- Añadir pruebas unitarias para nuevas funcionalidades
- Actualizar la documentación según sea necesario
- Usar anotaciones de tipo para el nuevo código
Licencia
Este proyecto está licenciado bajo la Licencia MIT - ver el archivo LICENSE para más detalles.
Soporte
Reporte de Problemas
Por favor, incluye la siguiente información al reportar problemas:
- Descripción detallada del problema
- Pasos para reproducir
- Comportamiento esperado vs comportamiento actual
- Versión de Python y detalles del entorno
Contacto
- GitHub Issues: Crear nuevo issue
- Email: relopezbriega@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arca_arg-1.0.1.tar.gz.
File metadata
- Download URL: arca_arg-1.0.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb8188d84dc96aad17dc50fdde432626316f05f1e99a2093b78b99df0ae934b5
|
|
| MD5 |
a356698b3c955b79b1d0b5b58c120241
|
|
| BLAKE2b-256 |
dc4915bc0f9c0906534c4a31c433fb4597a6aac3bd4234bb03f96e151f38a00d
|
File details
Details for the file arca_arg-1.0.1-py3-none-any.whl.
File metadata
- Download URL: arca_arg-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c392cc4afd9f6a91b57df3f90246677b0887ef540ed95144088f010be5c1170a
|
|
| MD5 |
ba3bb5fa8ba02ca154466c64c8fecb1a
|
|
| BLAKE2b-256 |
cf05c6f70025be3b98455a76b7279069372fff9d1f8b74a4adb9138af7e2f800
|