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.3.tar.gz (117.5 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.3-py3-none-any.whl (93.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rbadata-0.1.3.tar.gz
Algorithm Hash digest
SHA256 451ceae8877493c2bdd293905f6aaec9996ce67625974f6fae429fe6eef0f56c
MD5 c55fb14bf0392cdd47025f38abe70ea0
BLAKE2b-256 077a3d90e548e6b60b18d3847b08fd48083427328e6a8c68677b5d8d1919e138

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rbadata-0.1.3-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.11.13

File hashes

Hashes for rbadata-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 44c10fd3457cd3c0d843e83f5a215dc446ed00b55646138a2bc5ade861b1a522
MD5 af2ed4473c41c2490475f9d28f4cb93c
BLAKE2b-256 8413988cc8c9a143888d152708b27e43e55b24cbb90be5e425f0d64a5117109e

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