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, useLoginScope.CFDI
to download bill xmls orLoginScope.SIAT
to download acknowledgements.
- Return type
-
-
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 filterdate_end (
datetime
) – End date to filterstatus (
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 filterdate_end (
datetime
) – End date to filterstatus (
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
) – Motivedocument_type (
DocumentType
) – Document typestatus (
Status
) – Statussend_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 filterdate_end (
datetime
) – End date to filterstatus (
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
-
-
class
prometeo.sat.client.
AcknowledgementResult
(client, session_key, data)[source]¶ Info on an acknowledgement, returned by
Session.get_acknowledgements()
Enums¶
-
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'¶
-
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
-
property
-
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
-
property
-
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
-
property
-
class
prometeo.sat.models.
DownloadFile
(download_url)¶ -
property
download_url
¶ Alias for field number 0
-
property