From 5669e1cf0f64ef12929a53c8f5b4adb81886e7d8 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 15 May 2023 06:36:54 +0000 Subject: automatic import of python-stpmex --- .gitignore | 1 + python-stpmex.spec | 391 +++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 393 insertions(+) create mode 100644 python-stpmex.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..2c08790 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/stpmex-3.11.2.tar.gz diff --git a/python-stpmex.spec b/python-stpmex.spec new file mode 100644 index 0000000..08fa210 --- /dev/null +++ b/python-stpmex.spec @@ -0,0 +1,391 @@ +%global _empty_manifest_terminate_build 0 +Name: python-stpmex +Version: 3.11.2 +Release: 1 +Summary: Client library for stpmex.com +License: MIT License +URL: https://github.com/cuenca-mx/stpmex-python +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0d/3f/86ec30dd26c1f4c84f2c031aae19a557ebe014629539ff542784c0165366/stpmex-3.11.2.tar.gz +BuildArch: noarch + +Requires: python3-cryptography +Requires: python3-cuenca-validations +Requires: python3-requests +Requires: python3-workalendar + +%description +# STP python3.6+ client library + + +[![test](https://github.com/cuenca-mx/stpmex-python/workflows/test/badge.svg)](https://github.com/cuenca-mx/stpmex-python/actions?query=workflow%3Atest) +[![codecov](https://codecov.io/gh/cuenca-mx/stpmex-python/branch/main/graph/badge.svg)](https://codecov.io/gh/cuenca-mx/stpmex-python) +[![PyPI](https://img.shields.io/pypi/v/stpmex.svg)](https://pypi.org/project/stpmex/) +[![Downloads](https://pepy.tech/badge/stpmex)](https://pepy.tech/project/stpmex) + +Cliente para el servicio REST de STP + + +## Requerimientos + +Python v3.6 o superior. + +## Documentación de API + +[General](https://stpmex.zendesk.com/hc/es) y +[WADL](https://demo.stpmex.com:7024/speiws/rest/application.wadl?metadata=true&detail=true) + +## Instalación + +``` +pip install stpmex +``` + +## Correr pruebas + +``` +make venv +source venv/bin/activate +make test +``` + +## Uso básico + +```python +import datetime as dt + +from stpmex import Client +from stpmex.types import Pais + +client = Client( + empresa='TU_EMPRESA', + priv_key='PKEY_CONTENIDO', + priv_key_passphrase='supersecret', +) + +cuenta_persona_fisica = client.cuentas.alta( + nombre='Eduardo', + apellidoPaterno='Salvador', + apellidoMaterno='Hernández', + rfcCurp='SAHE800416HDFABC01', + cuenta='646180110400000007', + paisNacimiento=Pais.MX, + fechaNacimiento=dt.date(1980, 4, 14), +) + + +cuenta_persona_moral = client.cuentas_morales.alta( + nombre='LA TIENDITA DE LA ESQUINA SA DE CV', + cuenta='646180157036325892', + pais=Pais.MX, + fechaConstitucion=dt.date(2021, 1, 1), + rfcCurp='ABC200101AB0', +) + +# Si deseas dar de alta una nueva clabe para la misma +# razón social, haces el mismo request sustituyendo `cuenta` +# con la nueva clabe +cuenta_persona_moral = client.cuentas_morales.alta( + nombre='LA TIENDITA DE LA ESQUINA SA DE CV', + cuenta='646180157036325832', + pais=Pais.MX, + fechaConstitucion=dt.date(2021, 1, 1), + rfcCurp='ABC200101AB0', +) + +orden = client.ordenes.registra( + monto=1.2, + cuentaOrdenante=cuenta.cuenta, + nombreBeneficiario='Ricardo Sanchez', + cuentaBeneficiario='072691004495711499', + institucionContraparte='40072', + conceptoPago='Prueba', +) + +# Saldo +saldo = client.saldos.consulta(cuenta='646456789123456789') + +# Ordenes - enviadas +enviadas = client.ordenes.consulta_enviadas() # fecha_operacion es el día de hoy + +# Ordenes - recibidas +recibidas = client.ordenes.consulta_recibidas( + fecha_operacion=dt.date(2020, 4, 20) +) + +# Orden - consulta por clave rastreo +orden = client.ordenes.consulta_clave_rastreo( + claveRastreo='CR1234567890', + institucionOperante=90646, + fechaOperacion=dt.date(2020, 4, 20) +) +``` + + +%package -n python3-stpmex +Summary: Client library for stpmex.com +Provides: python-stpmex +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-stpmex +# STP python3.6+ client library + + +[![test](https://github.com/cuenca-mx/stpmex-python/workflows/test/badge.svg)](https://github.com/cuenca-mx/stpmex-python/actions?query=workflow%3Atest) +[![codecov](https://codecov.io/gh/cuenca-mx/stpmex-python/branch/main/graph/badge.svg)](https://codecov.io/gh/cuenca-mx/stpmex-python) +[![PyPI](https://img.shields.io/pypi/v/stpmex.svg)](https://pypi.org/project/stpmex/) +[![Downloads](https://pepy.tech/badge/stpmex)](https://pepy.tech/project/stpmex) + +Cliente para el servicio REST de STP + + +## Requerimientos + +Python v3.6 o superior. + +## Documentación de API + +[General](https://stpmex.zendesk.com/hc/es) y +[WADL](https://demo.stpmex.com:7024/speiws/rest/application.wadl?metadata=true&detail=true) + +## Instalación + +``` +pip install stpmex +``` + +## Correr pruebas + +``` +make venv +source venv/bin/activate +make test +``` + +## Uso básico + +```python +import datetime as dt + +from stpmex import Client +from stpmex.types import Pais + +client = Client( + empresa='TU_EMPRESA', + priv_key='PKEY_CONTENIDO', + priv_key_passphrase='supersecret', +) + +cuenta_persona_fisica = client.cuentas.alta( + nombre='Eduardo', + apellidoPaterno='Salvador', + apellidoMaterno='Hernández', + rfcCurp='SAHE800416HDFABC01', + cuenta='646180110400000007', + paisNacimiento=Pais.MX, + fechaNacimiento=dt.date(1980, 4, 14), +) + + +cuenta_persona_moral = client.cuentas_morales.alta( + nombre='LA TIENDITA DE LA ESQUINA SA DE CV', + cuenta='646180157036325892', + pais=Pais.MX, + fechaConstitucion=dt.date(2021, 1, 1), + rfcCurp='ABC200101AB0', +) + +# Si deseas dar de alta una nueva clabe para la misma +# razón social, haces el mismo request sustituyendo `cuenta` +# con la nueva clabe +cuenta_persona_moral = client.cuentas_morales.alta( + nombre='LA TIENDITA DE LA ESQUINA SA DE CV', + cuenta='646180157036325832', + pais=Pais.MX, + fechaConstitucion=dt.date(2021, 1, 1), + rfcCurp='ABC200101AB0', +) + +orden = client.ordenes.registra( + monto=1.2, + cuentaOrdenante=cuenta.cuenta, + nombreBeneficiario='Ricardo Sanchez', + cuentaBeneficiario='072691004495711499', + institucionContraparte='40072', + conceptoPago='Prueba', +) + +# Saldo +saldo = client.saldos.consulta(cuenta='646456789123456789') + +# Ordenes - enviadas +enviadas = client.ordenes.consulta_enviadas() # fecha_operacion es el día de hoy + +# Ordenes - recibidas +recibidas = client.ordenes.consulta_recibidas( + fecha_operacion=dt.date(2020, 4, 20) +) + +# Orden - consulta por clave rastreo +orden = client.ordenes.consulta_clave_rastreo( + claveRastreo='CR1234567890', + institucionOperante=90646, + fechaOperacion=dt.date(2020, 4, 20) +) +``` + + +%package help +Summary: Development documents and examples for stpmex +Provides: python3-stpmex-doc +%description help +# STP python3.6+ client library + + +[![test](https://github.com/cuenca-mx/stpmex-python/workflows/test/badge.svg)](https://github.com/cuenca-mx/stpmex-python/actions?query=workflow%3Atest) +[![codecov](https://codecov.io/gh/cuenca-mx/stpmex-python/branch/main/graph/badge.svg)](https://codecov.io/gh/cuenca-mx/stpmex-python) +[![PyPI](https://img.shields.io/pypi/v/stpmex.svg)](https://pypi.org/project/stpmex/) +[![Downloads](https://pepy.tech/badge/stpmex)](https://pepy.tech/project/stpmex) + +Cliente para el servicio REST de STP + + +## Requerimientos + +Python v3.6 o superior. + +## Documentación de API + +[General](https://stpmex.zendesk.com/hc/es) y +[WADL](https://demo.stpmex.com:7024/speiws/rest/application.wadl?metadata=true&detail=true) + +## Instalación + +``` +pip install stpmex +``` + +## Correr pruebas + +``` +make venv +source venv/bin/activate +make test +``` + +## Uso básico + +```python +import datetime as dt + +from stpmex import Client +from stpmex.types import Pais + +client = Client( + empresa='TU_EMPRESA', + priv_key='PKEY_CONTENIDO', + priv_key_passphrase='supersecret', +) + +cuenta_persona_fisica = client.cuentas.alta( + nombre='Eduardo', + apellidoPaterno='Salvador', + apellidoMaterno='Hernández', + rfcCurp='SAHE800416HDFABC01', + cuenta='646180110400000007', + paisNacimiento=Pais.MX, + fechaNacimiento=dt.date(1980, 4, 14), +) + + +cuenta_persona_moral = client.cuentas_morales.alta( + nombre='LA TIENDITA DE LA ESQUINA SA DE CV', + cuenta='646180157036325892', + pais=Pais.MX, + fechaConstitucion=dt.date(2021, 1, 1), + rfcCurp='ABC200101AB0', +) + +# Si deseas dar de alta una nueva clabe para la misma +# razón social, haces el mismo request sustituyendo `cuenta` +# con la nueva clabe +cuenta_persona_moral = client.cuentas_morales.alta( + nombre='LA TIENDITA DE LA ESQUINA SA DE CV', + cuenta='646180157036325832', + pais=Pais.MX, + fechaConstitucion=dt.date(2021, 1, 1), + rfcCurp='ABC200101AB0', +) + +orden = client.ordenes.registra( + monto=1.2, + cuentaOrdenante=cuenta.cuenta, + nombreBeneficiario='Ricardo Sanchez', + cuentaBeneficiario='072691004495711499', + institucionContraparte='40072', + conceptoPago='Prueba', +) + +# Saldo +saldo = client.saldos.consulta(cuenta='646456789123456789') + +# Ordenes - enviadas +enviadas = client.ordenes.consulta_enviadas() # fecha_operacion es el día de hoy + +# Ordenes - recibidas +recibidas = client.ordenes.consulta_recibidas( + fecha_operacion=dt.date(2020, 4, 20) +) + +# Orden - consulta por clave rastreo +orden = client.ordenes.consulta_clave_rastreo( + claveRastreo='CR1234567890', + institucionOperante=90646, + fechaOperacion=dt.date(2020, 4, 20) +) +``` + + +%prep +%autosetup -n stpmex-3.11.2 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-stpmex -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot - 3.11.2-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..3be94e2 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +85969e432d9969e460c82ba820c4631a stpmex-3.11.2.tar.gz -- cgit v1.2.3