A package that helps you to scrap web pages. It shows you a lot of information about the page.
Project description
PyAgenciasBancos
PyAgenciasBancos is a Python library for retrieving Brazilian bank agency information from the BCB (Banco Central do Brasil) API.
Installation
pip install -U PyAgenciasBancos
Or install from source:
pip install -e .
Usage
from py_agencias_bancos import agencias_bancos
agencias = agencias_bancos.AgenciasBancos()
Get agencies by municipality
result = agencias.get_agencias_by_municipio("São Paulo", 10)
for agencia in result:
print(agencia['nome'], agencia['endereco'], agencia['telefone'])
Get agencies by CEP (postal code)
result = agencias.get_agencias_by_cep("01001-000", 5)
for agencia in result:
print(agencia['nome'], agencia['endereco'], agencia['telefone'])
Get agencies by municipality and bank name
result = agencias.get_agencias_by_municipio_e_banco("São Paulo", "Banco do Brasil", 5)
for agencia in result:
print(agencia['nome'], agencia['endereco'], agencia['telefone'])
API Reference
AgenciasBancos
Main class for retrieving bank agency information.
Methods
-
get_agencias_by_municipio(municipio: str, quantidade_retorno: int = 1) -> List[Dict]- Returns a list of agencies for a given municipality.
municipio: The municipality name (case-insensitive)quantidade_retorno: Maximum number of results to return (default: 1)
-
get_agencias_by_cep(cep: str, quantidade_retorno: int = 1) -> List[Dict]- Returns a list of agencies for a given postal code (CEP).
cep: The CEP format (e.g., "01001-000")quantidade_retorno: Maximum number of results to return (default: 1)
-
get_agencias_by_municipio_e_banco(municipio: str, nome_banco: str, quantidade_retorno: int = 1) -> List[Dict]- Returns a list of agencies for a given municipality and bank name.
municipio: The municipality name (case-insensitive)nome_banco: The bank name (case-insensitive)quantidade_retorno: Maximum number of results to return (default: 1)
Return Format
Each method returns a list of dictionaries with the following keys:
nome: Agency nameendereco: Agency addresstelefone: Agency phone number
Running Tests
pytest
Run a single test:
pytest tests/test_agencias.py::AgenciasTests::test_get_agencias_by_municipio
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyagenciasbancos-0.0.2.tar.gz.
File metadata
- Download URL: pyagenciasbancos-0.0.2.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52aabaf9d1068924de3423e5bc3f134cd1bb4e719d6b3d815410a2a3cd31e4c8
|
|
| MD5 |
df10ff4f2a15626efa0ff1cd68417a43
|
|
| BLAKE2b-256 |
a7cf0d1d4f23c064e515f071dec5540aea8aa243b73bc2f86e15cec344667b91
|
File details
Details for the file pyagenciasbancos-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pyagenciasbancos-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f290aca32a14e2a475b6d3dcc69246c582ae79a6d5c571cbe1eea348f8a2715
|
|
| MD5 |
be6c8a4a7209e88389e6b92cb3504921
|
|
| BLAKE2b-256 |
7dff879fa604c788157f2016e70482e20835360b48933992c1f0af25a8dd01a9
|