Skip to main content

Factoring Total

PyPI version

Descripción

Libreria para obtener el tipo de cambio de SUNAT Y SBS junto al valor del dolar contable manejado por SBS. Ademas, se permiten realiar conversiones entre divisas.

Instalación

pip install FactoringTotal

Uso básico

from tipo_cambio import TipoCambioFactoring

ft = TipoCambioFactoring()
data = ft.get_exchange_rate('USD', '01/01/2023', '10/01/2023')
print(data)

Obtendremos el siguiente resultado:

{'01/01/2023': {'compra': '3.808', 'venta': '3.820'}, '02/01/2023': {'compra': '3.808', 'venta': '3.820'}, '03/01/2023': {'compra': '3.812', 'venta': '3.823'}, '04/01/2023': {'compra': '3.822', 'venta': '3.827'}, '05/01/2023': {'compra': '3.824', 'venta': '3.830'}, '06/01/2023': {'compra': '3.800', 'venta': '3.806'}, '07/01/2023': {'compra': '3.800', 'venta': '3.806'}, '08/01/2023': {'compra': '3.800', 'venta': '3.806'}, '09/01/2023': {'compra': '3.792', 'venta': '3.803'}, '10/01/2023': {'compra': '3.802', 'venta': '3.806'}}

Configuración

Opción Descripción Predeterminado Valores permitidos
source La fuente de dónde se obtendrán los datos. SBS SBS, SUNAT.
date_format Formato de fecha devuelto. %d/%m/%Y http://strftime.org

Ejemplo Resultado Sunat y SBS junto con el valor del dolar contable.

from tipo_cambio import TipoCambioFactoring

ft = TipoCambioFactoring()
data = ft.get_exchange_sbs_sunat('01/01/2023', '02/01/2023')
print(data)

Obtendremos el siguiente resultado:

{'status': 200, 'sunat': {'01-01-23': {'compra': '3.808', 'venta': '3.820'}, '02-01-23': {'compra': '3.808', 'venta': '3.820'}}, 'sbs': {'01-01-23': {'compra': '3.808', 'venta': '3.820'}, '02-01-23': {'compra': '3.808', 'venta': '3.820'}}, 'sbs_dolar_contable': '3.8250'}

Divisas

Listado de divisas permitidas.

Divisa ISO
Dólar estadounidense USD
Corona Sueca SEK
Franco Suizo CHF
Dólar canadiense CAD
Euro EUR
Yen japonés JPY
Libra esterlina GBP

Métodos

get_exchange_rate(currency, from_date, to_date=None)

Obtener el tipo de cambio de la moneda indicada por fecha o rango de fechas. Devolverá por defecto un diccionario (https://docs.python.org/3.6/tutorial/datastructures.html#dictionaries).

get_exchange_sbs_sunat(from_date, to_date)

Obtendra el tipo de cambio del dolar segun el rango de fechas, con la excepcion del dolar contable que, siempre sera el valor del dia en que se realice la consulta . Devolverá por defecto un diccionario (https://docs.python.org/3.6/tutorial/datastructures.html#dictionaries).

Consideraciones

  • Sólo se puede obtener el tipo de cambio desde el año 2000 en adelante.
  • El tipo de cambio de la SUNAT es el tipo de cambio del cierre del día anterior de la SBS (fuente http://www.sunat.gob.pe/cl-at-ittipcam/tcS01Alias).
  • El tipo de cambio no se publica en la SBS o SUNAT todos los díás. En estos casos se tomará el tipo de cambio del día anterior.

Metadata

Release files for FactoringTotal 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for FactoringTotal 1.0.2
File Size Uploaded Provenance Actions
FactoringTotal-1.0.2.tar.gz 4.3 kB Without provenance Details for FactoringTotal-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for FactoringTotal 1.0.2
File Interpreter ABI Platform Actions
FactoringTotal-1.0.2-py3-none-any.whl Python 3 none any Details for FactoringTotal-1.0.2-py3-none-any.whl

Total release size: 9.2 kB

Release files / FactoringTotal-1.0.2.tar.gz

Download URL FactoringTotal-1.0.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2d5838f9ba023803ca8660f3ae2fc920e7cf76209dbfa24aea75e31e14575ba0
BLAKE2b-256 checksum
How to use checksums
7fd7a7442b81bb078e7d964a7346ff3facdc1fe6bf48016146b49e4857be6820
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release files / FactoringTotal-1.0.2-py3-none-any.whl

Download URL FactoringTotal-1.0.2-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbe57a45088f7b2a53fa92f6f353fbc637d7e1ad75d0af4ae96c101971edb898
BLAKE2b-256 checksum
How to use checksums
08135c94802c42493ca43b725778663ffbc5a9f95a0573ba3e1f87df0a2b2485
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Security for FactoringTotal 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page