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.2.0.tar.gz (33.4 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.2.0-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyboj-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8f2ca69e375d4c96824b61fa69a9585b92c2616db6067849a82e073e7f1020b1
MD5 d7729176ee70746d30327065fb5c8bb9
BLAKE2b-256 9da90547bd2b5becd0307241918908a3f57bfae0072b25a9cc6dd3279dfadf32

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyboj-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 31.4 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 376eb3c9ad526c853311fdecb7bf4005b4e646fda9cb7540559d185248ae11c4
MD5 99e00fdd88abd14034dba1b835c52a10
BLAKE2b-256 cd89178a7c78f777e23be262158dc8c35a560f80067b459fed5f194abca23693

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