Skip to main content

Beginner-friendly Python client for the Bank of Japan Time-Series Statistics API

Project description

pyboj

Beginner-friendly Python client for the Bank of Japan Time-Series Statistics API.

PyPI License: MIT Python 3.10+ Open In Colab

Built on top of boj-ts-api for advanced users who need direct API access.

Installation

pip install pyboj

Quick Start

from pyboj import BOJ, Currency, Frequency

boj = BOJ()

# Exchange rates — no magic strings
rates = boj.exchange_rates(
    currency=Currency.USD_JPY,
    frequency=Frequency.D,
    start_date="202401",
)
for r in rates:
    print(r.currency_pair, r.rate_type, r.values[:3])
    df = r.to_dataframe()  # pandas DataFrame

# Interest rates
rates = boj.interest_rates(frequency=Frequency.D)
for r in rates:
    print(r.rate_category, r.collateralization, r.tenor)

# TANKAN survey
from pyboj import TankanIndustry, TankanSize
results = boj.tankan(
    industry=TankanIndustry.MANUFACTURING,
    size=TankanSize.LARGE,
)

# Price indices
indices = boj.price_indices(start_date="202401")

# Balance of payments, Money/Deposits, Loans, and more
bop = boj.balance_of_payments()
money = boj.money_deposits()
loans = boj.loans()

See the full documentation for all 14 methods, filter enums, and domain wrapper properties.

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

pyboj-0.3.0.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyboj-0.3.0-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file pyboj-0.3.0.tar.gz.

File metadata

  • Download URL: pyboj-0.3.0.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for pyboj-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3126323af521cfbad7e3d599019ec7bc8ae8035d41e6678527319c61b2e05a0c
MD5 ba986f50b35c7e30017b94ea20deef1d
BLAKE2b-256 6cbe91d6db809d94c19e82c8c7f56a824308756176575f23d42eb8ab07a9637c

See more details on using hashes here.

File details

Details for the file pyboj-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pyboj-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for pyboj-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99b7863ee9391bc09e21ae7e5d1878b5487420dbf28517870b76febab5ea0010
MD5 d24866f919db1f492ace79dcefa5c31b
BLAKE2b-256 b27a5290636b6ac5d11ce6ccfc963103e5cfec15b1d310aacccaf940b51002f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page