Skip to main content

Download and tidy data from the Reserve Bank of Australia

Project description

rbadata

A Python package to download and tidy data from the Reserve Bank of Australia (RBA).

This package is a Python implementation inspired by the R package readrba, providing similar functionality for accessing RBA statistical tables and economic forecasts.

Python 3.9+ License: MIT Coverage Tests

Table of Contents

Installation

pip install rbadata

For development installation:

git clone https://github.com/caymandev/rbadata.git
cd rbadata
pip install -e ".[dev]"

Quick Start

import rbadata

# Read a single RBA table
cpi_table = rbadata.read_rba(table_no="g1")

# Read multiple tables
data = rbadata.read_rba(table_no=["a1", "g1"])

# Read by series ID
cpi_series = rbadata.read_rba(series_id="GCPIAG")

# Get RBA forecasts
forecasts = rbadata.rba_forecasts()

# Browse available tables and series
tables = rbadata.browse_rba_tables()
series = rbadata.browse_rba_series("inflation")

Advanced Usage

Inflation Calculator

# Calculate inflation-adjusted values
calc = rbadata.InflationCalculator()

# How much was $100 in 2000 worth in 2023?
value_2023 = calc.calculate_value(100, "2000", "2023")

# Calculate inflation rate
inflation_rate = calc.calculate_inflation_rate("2020", "2023")

# Quick calculation
adjusted_value = rbadata.inflation_calculator(1000, "2010", "2023")

Chart Pack

# Access RBA Chart Pack
chart_pack = rbadata.get_chart_pack()

# Get available categories
categories = chart_pack.get_categories()

# Get charts by category
inflation_charts = chart_pack.get_charts_by_category("inflation")

# Download the full Chart Pack PDF
chart_pack.download_chart_pack()

Economic Snapshots

# Get economic indicators snapshot
indicators = rbadata.get_economic_indicators()

# Access snapshots
snapshots = rbadata.get_snapshots()
snapshots.download_snapshot("economic-indicators")

Glossary

# Look up term definitions
definition = rbadata.define("CPI")

# Search for terms
glossary = rbadata.get_glossary()
inflation_terms = glossary.search("inflation")

Features

Core Features

  • Download current and historical RBA statistical tables
  • Access RBA economic forecasts since 1990
  • Search and browse available data series
  • Automatic data tidying into pandas DataFrames
  • Robust error handling and retry logic

Additional Features

  • Inflation Calculator: Calculate inflation-adjusted values and inflation rates
  • Chart Pack Access: Download and explore RBA Chart Pack data
  • Economic Snapshots: Access key economic indicators and visualizations
  • Statistical Alerts: Set up notifications for new data releases
  • Glossary: Look up definitions of economic and financial terms

Examples

The package includes comprehensive examples demonstrating all features:

  1. Basic Usage - Core functionality and data reading
  2. Data Browsing - Searching and discovering available data
  3. Forecasts - Working with RBA economic forecasts
  4. Inflation Calculator - Real-world inflation calculations
  5. Chart Pack - Accessing visual economic summaries
  6. Snapshots - Quick economic indicators
  7. Alerts - Setting up data release notifications
  8. Glossary - Economic terminology reference
  9. Advanced Usage - Performance optimization and bulk operations
  10. Data Analysis - Real-world economic analysis examples

See the examples directory for detailed code examples with inline documentation.

Documentation

Data Sources

  • Statistical Tables: Access to all RBA statistical tables (current and historical)
  • Forecasts: Public RBA forecasts since 1990 from Statement on Monetary Policy
  • Chart Pack: Visual summaries released 8 times per year
  • Snapshots: Key economic indicators, economy composition, and payment methods

Common Use Cases

# Monitor inflation
inflation = rbadata.read_rba(series_id="GCPIAG")
current_cpi = inflation.iloc[-1]['value']

# Track interest rates
cash_rate = rbadata.read_cashrate()
current_rate = cash_rate.iloc[-1]['value']

# Analyze employment
unemployment = rbadata.read_rba(series_id="GLFSURSA")

# Get latest economic forecasts
latest_forecasts = rbadata.rba_forecasts(all_or_latest="latest")

Requirements

  • Python 3.9+
  • pandas >= 1.3.0
  • requests >= 2.25.0
  • beautifulsoup4 >= 4.9.0
  • openpyxl >= 3.0.0

Testing

The package includes comprehensive tests with high coverage. To run tests locally:

# Run tests
pytest tests/

# Run tests with coverage report
pytest tests/ --cov=rbadata --cov-report=term-missing

# Generate coverage badge locally
python scripts/generate_coverage_badge.py --update-readme

Coverage

The project maintains high test coverage (currently 97%). Coverage is automatically tracked via GitHub Actions and reported using Codecov.

To set up Codecov for your fork:

  1. Sign up at codecov.io
  2. Add your repository
  3. Add the CODECOV_TOKEN to your GitHub repository secrets

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Before submitting:

  1. Run the test suite and ensure all tests pass
  2. Add tests for any new functionality
  3. Ensure code coverage remains high
  4. Run linting: flake8 rbadata/
  5. Format code: black rbadata/

License

MIT License

Disclaimer

This package is not affiliated with or endorsed by the Reserve Bank of Australia. All data is provided subject to any conditions and restrictions set out on the RBA website.

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

rbadata-0.1.5.tar.gz (116.9 kB view details)

Uploaded Source

Built Distribution

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

rbadata-0.1.5-py3-none-any.whl (93.4 kB view details)

Uploaded Python 3

File details

Details for the file rbadata-0.1.5.tar.gz.

File metadata

  • Download URL: rbadata-0.1.5.tar.gz
  • Upload date:
  • Size: 116.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rbadata-0.1.5.tar.gz
Algorithm Hash digest
SHA256 1601915f99fc21b039ef0132ddde3c8995e2ac952ba47b6c2e3fd265f0c4e74a
MD5 7780d25592ba132888a3574cf4554026
BLAKE2b-256 ae4ad22767a5b0a8e787156bd241ad4bdd9e9135d465719d3d8a0c09f081cceb

See more details on using hashes here.

File details

Details for the file rbadata-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: rbadata-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 93.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rbadata-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 364488f45c795aeaef7f3b6396b71d730f41931b03c60e4ab2177a30c6b66842
MD5 e780d575c2031038790e7df2493965ad
BLAKE2b-256 24883036aa5633a9dd0798d916ba059589505f023524afcfa3b347d347fa8347

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