Skip to main content

pyvenezuela

Python library to query Venezuela's data

CI Package version Supported Python versions


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

Metadata

Release files for pyvenezuela 0.0.5

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

Source distribution (sdist)

Source distribution for pyvenezuela 0.0.5
File Size Uploaded
pyvenezuela-0.0.5.tar.gz 80.2 kB Details

Built distribution (wheel)

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

Total release size: 89.9 kB

Release files / pyvenezuela-0.0.5.tar.gz

Download URL pyvenezuela-0.0.5.tar.gz
Size 80.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9478ea7cbfdd7361cbf188b358c770f51e163023a8bb401c98edd09a49996069
BLAKE2b-256 checksum
How to use checksums
a582a3347a08a21e287a8f9b55fc99b36310be0a366f2deb934557978e1ae9a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 6, 2026.

Transparency log

Release files / pyvenezuela-0.0.5-py3-none-any.whl

Download URL pyvenezuela-0.0.5-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b5cbdb20ac1a05611426ad78fe9a99ed3c96624649675a4d44d19cfe73e4329
BLAKE2b-256 checksum
How to use checksums
392c41bb5bb6ece2dcea712bf937c4cf2b7be0314139943570d63af8c06c44ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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