prometeo.sat

API Client

class prometeo.sat.client.SatAPIClient(api_key, environment)[source]

API Client for SAT API

login(rfc, password, scope)[source]

Log in to SAT

Parameters
  • rfc (str) – RFC of the person to log in

  • password (str) – Password used to login, also known as CIEC

  • scope (LoginScope) – Depending on the type of information to query, use LoginScope.CFDI to download bill xmls or LoginScope.SIAT to download acknowledgements.

Return type

Session

session_class

alias of Session

class prometeo.sat.client.Session(client, status, session_key)[source]
download_emitted_bills(date_start, date_end, status)[source]

Creates a request to download all the emitted bills in a range of dates.

Parameters
  • date_start (datetime) – Start date to filter

  • date_end (datetime) – End date to filter

  • status (BillStatus) – Status of the bills

Return type

List of DownloadRequest

download_received_bills(year, month, status)[source]

Creates a request to download all the received bills in a range of dates.

Parameters
  • date_start (datetime) – Start date to filter

  • date_end (datetime) – End date to filter

  • status (BillStatus) – Status of the bills

Return type

List of DownloadRequest

get_acknowledgements(year, month_start, month_end, motive, document_type, status, send_type)[source]

Gets a list of acknowledgements for a range of dates

Parameters
  • year (int) – The year of the acknowledgements

  • month_start (int) – Start month to filter

  • month_end (int) – End month to filter

  • motive (Motive) – Motive

  • document_type (DocumentType) – Document type

  • status (Status) – Status

  • send_type (SendType) – Send type

Return type

List of AcknowledgementResult

get_downloads()[source]

Gets a list of available downloads

Return type

List of DownloadRequest

get_emitted_bills(date_start, date_end, status)[source]

List all emitted bills in a range of dates.

Parameters
  • date_start (datetime) – Start date to filter

  • date_end (datetime) – End date to filter

  • status (BillStatus) – Status of the bills

Return type

List of CFDIBill

get_received_bills(year, month, status)[source]

List all received bills in a range of dates.

Parameters
  • year (int) – Year of the received bills

  • month (int) – Month of the received bills

  • status (BillStatus) – Status of the bills

Return type

List of CFDIBill

logout()[source]

Logs out of SAT. You won’t be able to use this session after logout.

class prometeo.sat.client.AcknowledgementResult(client, session_key, data)[source]

Info on an acknowledgement, returned by Session.get_acknowledgements()

get_download()[source]

Download the acknowledgement data

Return type

Download

class prometeo.sat.client.DownloadRequest(client, session_key, request_id)[source]

A request for bulk downloading of bills.

get_download()[source]

Download the generated zip file with all the xmls

Return type

Download

is_ready()[source]

Check if the request is ready to download.

Return type

bool

Enums

class prometeo.sat.client.LoginScope[source]

An enumeration.

CFDI = 'cfdi'
SIAT = 'siat'
class prometeo.sat.client.BillStatus[source]

An enumeration.

ANY = 'any'
CANCELLED = 'cancelled'
VALID = 'valid'
class prometeo.sat.client.Motive[source]

An enumeration.

AF = 'af'
ALL = 'all'
CO = 'co'
DE = 'de'
FC = 'fc'
MONTHLY = 'monthly'
class prometeo.sat.client.DocumentType[source]

An enumeration.

ALL = 'all'
B = 'b'
CT = 'ct'
PL = 'pl'
XC = 'xc'
XF = 'xf'
class prometeo.sat.client.Status[source]

An enumeration.

ACCEPTED = 'accepted'
ALL = 'all'
RECEIVED = 'received'
REJECTED = 'rejected'
class prometeo.sat.client.SendType[source]

An enumeration.

ALL = 'all'
C = 'c'
N = 'n'

Models

class prometeo.sat.models.AcknowledgementResult(id, period, motive, document_type, send_type, file_name, reception_date, status)
property document_type

Alias for field number 3

property file_name

Alias for field number 5

property id

Alias for field number 0

property motive

Alias for field number 2

property period

Alias for field number 1

property reception_date

Alias for field number 6

property send_type

Alias for field number 4

property status

Alias for field number 7

class prometeo.sat.models.CFDIBill(id, emitter_rfc, emitter_reason, receiver_rfc, receiver_reason, emitted_date, certification_date, certification_pac, total_value, effect, status)
property certification_date

Alias for field number 6

property certification_pac

Alias for field number 7

property effect

Alias for field number 9

property emitted_date

Alias for field number 5

property emitter_reason

Alias for field number 2

property emitter_rfc

Alias for field number 1

property id

Alias for field number 0

property receiver_reason

Alias for field number 4

property receiver_rfc

Alias for field number 3

property status

Alias for field number 10

property total_value

Alias for field number 8

class prometeo.sat.models.CFDIDownloadItem(request_id, type, count)
property count

Alias for field number 2

property request_id

Alias for field number 0

property type

Alias for field number 1

class prometeo.sat.models.DownloadFile(download_url)
property download_url

Alias for field number 0

class prometeo.sat.models.DownloadRequest(request_id)
property request_id

Alias for field number 0

class prometeo.sat.models.PdfFile(pdf_url)
property pdf_url

Alias for field number 0