GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - cuenca-mx/cep-python: Python client library for CEP (http://www.banxico.org.mx/cep/)

BranchesTags
Open more actions menu

Latest commit

 

History

72 Commits
72 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
cep
cep
 
 
tests
tests
 
 
.codecov.yml
.codecov.yml
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
requirements-test.txt
requirements-test.txt
 
 
requirements.txt
requirements.txt
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

Repository files navigation

CEP

test codecov PyPI

Python client library for CEP (http://www.banxico.org.mx/cep/)

Installation

pip install cepmex

Development & Testing

You can use a staging environment to test the library:

import cep

cep.configure(beta=True)

To run unit tests, use pytest.

pytest

Usage

from datetime import date
from cep import Transferencia
from cep.exc import TransferNotFoundError

try:
    tr = Transferencia.validar(
        fecha=date(2019, 4, 12),
        clave_rastreo='CUENCA1555093850',
        emisor='90646',  # STP
        receptor='40012',  # BBVA
        cuenta='012180004643051249',
        monto=817, # In cents
    )
    pdf = tr.descargar()
    with open('CUENCA1555093850.pdf', 'wb') as f:
        f.write(pdf)
except TransferNotFoundError as e:
    print('No se encontro la transferencia')

Validate Transfer Parameters

Use the validar method to validate a transfer with the following parameters:

Required Parameters:

  • fecha (datetime.date): Transfer date.
  • clave_rastreo (str): Transfer tracking key.
  • emisor (str): Transfer sender bank code.
  • receptor (str): Transfer receiver bank code.
  • cuenta (str): Transfer account number.
  • monto (int): Transfer amount in cents.

Optional Parameters:

  • pago_a_banco (bool, default=False): Set to True for transfer types 4 and 31.

Download Transfer Data

Use the descargar method to download a transfer in one of the following formats:

  • PDF (default)
  • XML
  • ZIP
tr.descargar(formato='XML')

Exceptions

  • TransferNotFoundError: The transfer was not found.
  • MaxRequestError: The maximum number of requests has been reached.
  • CepNotAvailableError: The transfer was found, but the CEP is not available.

About

Python client library for CEP (http://www.banxico.org.mx/cep/)

Resources

Readme
MIT license
Activity
Custom properties

Stars

20 stars

Watchers

6 watching

Forks

19 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.