Downloads PDFs and XMLs of invoices (received and emited) for later processing from Guatemalan SAT (Superintendencia de Administración Tributaria)
Project description
FEL Invoices Downloader for SAT of Guatemala
Downloads received and emited invoices in FEL (Factura En Linea) of Guatemala SAT
How to use it
Installation
pip install sat_gt_fel_invoices_downloader
Example
How to download invoice in PDF
from sat_gt_fel_invoices_downloader import SATDownloader
import datetime
import os.path
from sat_gt_fel_invoices_downloader.models import SatCredentials
sat_credentials = SatCredentials("YOUR AGENCIA DIGITAL USER", "YOUR AGENCIA DIGITAL PASSWORD")
sat = SATDownloader()
sat.setCredentials(credentials=sat_credentials)
invoices = sat.get_invoices(
datetime.date(2021, 10, 1), date_end=datetime.date.today(), received=True
)
dir = os.path.dirname(
'c:\\Users\\my-user\\Downloads\\"'
)
for invoice in invoices:
sat.get_pdf(invoice, save_in_dir=dir)
How to download invoice in XML
from sat_gt_fel_invoices_downloader import SATDownloader
import datetime
import os.path
from sat_gt_fel_invoices_downloader.models import SatCredentials
sat_credentials = SatCredentials("YOUR AGENCIA DIGITAL USER", "YOUR AGENCIA DIGITAL PASSWORD")
sat = SATDownloader()
sat.setCredentials(credentials=sat_credentials)
invoices = sat.get_invoices(
datetime.date(2021, 10, 1), date_end=datetime.date.today(), received=True
)
dir = os.path.dirname(
'c:\\Users\\my-user\\Downloads\\"'
)
for invoice in invoices:
sat.get_xml(invoice, save_in_dir=dir)
How to get invoices in model structure
from sat_gt_fel_invoices_downloader import SATDownloader
import datetime
import os.path
from sat_gt_fel_invoices_downloader.models import SatCredentials
sat_credentials = SatCredentials("YOUR AGENCIA DIGITAL USER", "YOUR AGENCIA DIGITAL PASSWORD")
sat = SATDownloader()
sat.setCredentials(credentials=sat_credentials)
invoices = sat.get_invoices(
datetime.date(2021, 10, 1), date_end=datetime.date.today(), received=True
)
dir = os.path.dirname(
'c:\\Users\\my-user\\Downloads\\"'
)
for invoice in invoices:
print(sat.get_model(invoice))
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
File details
Details for the file sat_gt_fel_invoices_downloader-0.5.11.tar.gz
.
File metadata
- Download URL: sat_gt_fel_invoices_downloader-0.5.11.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a18946013dbe8ac065f37eaf33d8715c1a7fcd0f3eaad7f5a91f8305f796e17c |
|
MD5 | 48b4fcdcce256e0486e0b6e7c11e5e80 |
|
BLAKE2b-256 | 081931bf726908aed2784bceef3ec2bee67cbca4d4cbff63546b1361242d0b2f |
File details
Details for the file sat_gt_fel_invoices_downloader-0.5.11-py3-none-any.whl
.
File metadata
- Download URL: sat_gt_fel_invoices_downloader-0.5.11-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa8213742e6652638650a7588334ef0e80c4741987ab31f5ba82eb193b940972 |
|
MD5 | e9d7fad84df7c8b87464946c878f1d6e |
|
BLAKE2b-256 | dac133286c4705f105d9b7df0fb9508f3689b09638da6266c9fe64848c5804c4 |