Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sat_gt_fel_invoices_downloader-0.5.0.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file sat_gt_fel_invoices_downloader-0.5.0.tar.gz.

File metadata

  • Download URL: sat_gt_fel_invoices_downloader-0.5.0.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for sat_gt_fel_invoices_downloader-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a8fdb254564da0885d3e4954daf3a96212d343a6e3fe1948104e23a333899e17
MD5 40c2d755786817787079722306b44855
BLAKE2b-256 4584f3e1cd3c541c4307f0659db2f9060ea0ade3ca8d27f71e6bf91d59b3d0fe

See more details on using hashes here.

File details

Details for the file sat_gt_fel_invoices_downloader-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: sat_gt_fel_invoices_downloader-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for sat_gt_fel_invoices_downloader-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b1c0b3635931174c9f6e39f8dd602a623a956b9ddeb1e89a37dd597ef2595a
MD5 9876c79d3afe7b13f4fe2d96e7524b09
BLAKE2b-256 950181b657a295ea7a7060e164a5278e5db0f20990bad961eb1fcc17cad3c348

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