Python library to query Venezuela's data (BCV and CNE)
Project description
Python library to query Venezuela's data
Docs: https://pyvenezuela.jose2kk.com
Source Code: https://github.com/jose2kk/pyvenezuela
pyvenezuela is a Python library for querying Venezuelan public data sources, including exchange rates from the Central Bank of Venezuela (BCV) and voter data from the National Electoral Council (CNE).
Features
- BCV exchange rates — official rates (USD, EUR, CNY, TRY, RUB) from the BCV website
- Bank rates — buy/sell rates reported by all Venezuelan banks
- CNE voter lookup — query voter registration data by ID number
- In-memory cache — automatic TTL-based caching to reduce HTTP requests
- Custom cache backends — plug in Redis, Memcached, or any other store
- Typed responses — Pydantic v2 models with full type annotations
Installation
pip install pyvenezuela
Or with uv:
uv add pyvenezuela
Quick Start
BCV Exchange Rates
from pyvenezuela import get_rates_by_bcv, BCVCurrencyEnum
rates = get_rates_by_bcv()
if rates:
print(f"USD: {rates[BCVCurrencyEnum.USD]:.4f} Bs.")
print(f"EUR: {rates[BCVCurrencyEnum.EUR]:.4f} Bs.")
Bank Rates
from pyvenezuela import get_rates_by_bank, BankEnum
import datetime
today = datetime.date.today()
last_month = today - datetime.timedelta(days=30)
rates = get_rates_by_bank(
bank=BankEnum.BANESCO,
start_date=last_month,
end_date=today,
)
for rate in rates:
print(f"{rate.date} buy: {rate.buy_rate:.4f} sell: {rate.sell_rate:.4f}")
CNE Voter Lookup
from pyvenezuela import query_id, NationalityEnum
persona = query_id(nationality=NationalityEnum.VENEZUELAN, id="12345678")
if persona:
print(f"Name: {persona.full_name}")
print(f"State: {persona.state}")
print(f"Voting center: {persona.voting_center}")
Development
# Install dependencies
uv sync --locked
# Run tests
make test
# Lint + type check
make check
# Format code
make format
Requirements
- Python 3.10+
- Dependencies:
beautifulsoup4,pydantic>=2,requests
License
MIT
Project details
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 pyvenezuela-0.0.4.tar.gz.
File metadata
- Download URL: pyvenezuela-0.0.4.tar.gz
- Upload date:
- Size: 75.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb26ca16a468189e813e96ed2e315c078f0a152d6a26fe52d906cd204c753e17
|
|
| MD5 |
9e2df6fc219aa05316d88aea3409fa45
|
|
| BLAKE2b-256 |
7ed35077ed13b106785469a7b609e97bbd17b9f0c3c75b1cefa277410c563c0d
|
Provenance
The following attestation bundles were made for pyvenezuela-0.0.4.tar.gz:
Publisher:
publish.yml on jose2kk/pyvenezuela
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyvenezuela-0.0.4.tar.gz -
Subject digest:
bb26ca16a468189e813e96ed2e315c078f0a152d6a26fe52d906cd204c753e17 - Sigstore transparency entry: 1342969187
- Sigstore integration time:
-
Permalink:
jose2kk/pyvenezuela@f29fdfb104570f44cc52cf9927509f0718a954c1 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/jose2kk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f29fdfb104570f44cc52cf9927509f0718a954c1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyvenezuela-0.0.4-py3-none-any.whl.
File metadata
- Download URL: pyvenezuela-0.0.4-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfe12ae97aaa36643029a14855addd83336cc68e30f13ae415c093177ea4868d
|
|
| MD5 |
c79664c798827f812fa228df6aca5aac
|
|
| BLAKE2b-256 |
6c033e14ef5e4eb0be90ceac9a9d961ab29887a87a9f5159bac86045d3a2592f
|
Provenance
The following attestation bundles were made for pyvenezuela-0.0.4-py3-none-any.whl:
Publisher:
publish.yml on jose2kk/pyvenezuela
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyvenezuela-0.0.4-py3-none-any.whl -
Subject digest:
cfe12ae97aaa36643029a14855addd83336cc68e30f13ae415c093177ea4868d - Sigstore transparency entry: 1342969207
- Sigstore integration time:
-
Permalink:
jose2kk/pyvenezuela@f29fdfb104570f44cc52cf9927509f0718a954c1 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/jose2kk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f29fdfb104570f44cc52cf9927509f0718a954c1 -
Trigger Event:
push
-
Statement type: