Tools for accessing and preprocessing AEMO data for the National Electricity Market
Project description
NEMDataTools
An MIT-licensed Python package for accessing and preprocessing data from the Australian Energy Market Operator (AEMO) for the National Electricity Market (NEM).
Overview
NEMDataTools provides a clean, efficient interface for:
- Downloading raw data from AEMO's public data sources
- Processing various AEMO data formats
- Managing time series data with appropriate timestamps
- Supporting multiple data tables and report types
- Delivering preprocessed data ready for analysis
This package is designed for researchers, analysts, and developers who need to work with AEMO data under a permissive MIT license.
Installation
From PyPI (Recommended)
pip install nemdatatools
From TestPyPI (Pre-releases)
pip install --index-url https://test.pypi.org/simple/ nemdatatools
From Source (Development)
# Clone the repository
git clone https://github.com/ZhipengHe/nemdatatools.git
cd nemdatatools
# Install in development mode with all dependencies
pip install -e ".[dev,docs]"
# Or install just the core package
pip install -e .
Requirements
- Python 3.10 or higher
- pandas, numpy, requests, pyarrow, tqdm
Quick Start
import nemdatatools as ndt
# Download and process dispatch price data with automatic caching
data = ndt.fetch_data(
data_type="DISPATCHPRICE",
start_date="2023/01/01",
end_date="2023/01/02",
regions=["NSW1", "VIC1"],
cache_path="./cache" # Enable local caching
)
# Data is already processed and standardized
print(f"Downloaded {len(data)} records")
print(data.head())
# Advanced analysis with built-in functions
stats = ndt.calculate_price_statistics(data)
resampled = ndt.resample_data(data, '1H') # Resample to hourly
windows = ndt.create_time_windows(data, window_size='4H') # 4-hour windows
Core Features
- 🚀 Complete Data Pipeline: Download → Extract → Process → Cache → Analyze in one API call
- 📊 Core Data Types: MMSDM dispatch data, pre-dispatch forecasts, with framework for expansion
- ⚡ Intelligent Caching: Metadata-based local caching with configurable TTL
- 🔄 Advanced Processing: Data standardization, time series resampling, statistical analysis
- ⏰ Time-Aware: Proper AEST timezone handling and dispatch interval management
- 🌏 Region Support: All NEM regions (NSW1, VIC1, QLD1, SA1, TAS1) with filtering
- 🛡️ Production Ready: Robust error handling, retry logic, comprehensive testing
Development Status
NEMDataTools has reached production readiness with core functionality complete and thoroughly tested.
✅ Completed Features
-
Complete Data Pipeline
- Multi-source data downloading (MMSDM, pre-dispatch, static)
- ZIP file extraction and CSV processing
- Intelligent caching with metadata management
- End-to-end data standardization and validation
-
Advanced Processing Capabilities
- Time series resampling and statistical analysis
- Price and demand calculation functions
- Time window creation for analysis
- AEST timezone and dispatch interval handling
-
Production Infrastructure
- Comprehensive error handling and retry logic
- 79 test functions with 58% coverage
- Pre-commit hooks with Black, Ruff, MyPy
- GitHub Actions CI/CD pipeline
- Type annotations throughout codebase
🚧 In Progress
- Data Type Expansion: Adding support for remaining MMSDM tables
- Documentation: API reference and advanced usage guides
📋 Tested Data Types
| Data Type | Status | Description |
|---|---|---|
DISPATCHPRICE |
✅ Fully Tested | 5-minute dispatch prices by region |
DISPATCHREGIONSUM |
✅ Fully Tested | 5-minute regional dispatch summary |
DISPATCH_UNIT_SCADA |
✅ Fully Tested | Generator SCADA readings |
PREDISPATCHPRICE |
✅ Fully Tested | Pre-dispatch price forecasts |
PRICE_AND_DEMAND |
✅ Tested | Direct CSV price and demand data |
P5MIN_REGIONSOLUTION |
⚠️ Framework Ready | 5-minute pre-dispatch (implementation complete, testing pending) |
| Static Data Types | ✅ Framework Ready | Registration lists and boundaries |
Documentation
Development Guide
Here are some documents to help you get started with developing NEMDataTools:
- Project Planning:
- Implementation Plan: Detailed plan for implementing core modules
- Project Board: Overview of the project structure and milestones
- Development Workflow:
- Quickstart with UV: Setting up the development environment with Universal Viewer
- UV Integration Guide: Using UV for dependency management
- Quickstart with Pre-Commit: Setting up pre-commit hooks for code quality
- Commitizen Guide: Using Commitizen for standardized commit messages
API Reference
Detailed documentation is available at Documentation (WIP).
API Reference
Core Functions
# Main data fetching function
data = ndt.fetch_data(
data_type="DISPATCHPRICE",
start_date="2023/01/01",
end_date="2023/01/02",
regions=["NSW1", "VIC1"],
cache_path="./cache"
)
# Check available data types
available_types = ndt.get_available_data_types()
# Batch operations
ndt.download_multiple_tables(
tables=["DISPATCHPRICE", "DISPATCHREGIONSUM"],
start_date="2023/01/01",
end_date="2023/01/02"
)
# Advanced analysis
stats = ndt.calculate_price_statistics(data)
resampled = ndt.resample_data(data, '1H')
windows = ndt.create_time_windows(data, window_size='4H')
Contributing
Contributions are welcome! Please see our Contributing Guide for details.
License
NEMDataTools is released under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nemdatatools-0.1.0.tar.gz.
File metadata
- Download URL: nemdatatools-0.1.0.tar.gz
- Upload date:
- Size: 144.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8c79fa69ac5e7009041a035a80fd8818a3bc532a9e49b4f456dbd49be7ab5f0
|
|
| MD5 |
82081c4e971313ebfd3519044ceec263
|
|
| BLAKE2b-256 |
82ffdd15af6164567b32951221480701cd7737a6d7fa52352a5b34150ffe2e0d
|
Provenance
The following attestation bundles were made for nemdatatools-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on ZhipengHe/nemdatatools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nemdatatools-0.1.0.tar.gz -
Subject digest:
e8c79fa69ac5e7009041a035a80fd8818a3bc532a9e49b4f456dbd49be7ab5f0 - Sigstore transparency entry: 473248795
- Sigstore integration time:
-
Permalink:
ZhipengHe/nemdatatools@5703a7f350e31b2f95a16a02116a2028c93deac1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ZhipengHe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5703a7f350e31b2f95a16a02116a2028c93deac1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nemdatatools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nemdatatools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 30.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cf4632cd084695abb23705fe2030677138aa2cc486f882623edead5b38afb10
|
|
| MD5 |
e28a776836686a07c53e6f0a4b986396
|
|
| BLAKE2b-256 |
add9148478fbe2063881812ccdc5624d1848d5e56f9da5f2967a18b252045400
|
Provenance
The following attestation bundles were made for nemdatatools-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on ZhipengHe/nemdatatools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nemdatatools-0.1.0-py3-none-any.whl -
Subject digest:
5cf4632cd084695abb23705fe2030677138aa2cc486f882623edead5b38afb10 - Sigstore transparency entry: 473248811
- Sigstore integration time:
-
Permalink:
ZhipengHe/nemdatatools@5703a7f350e31b2f95a16a02116a2028c93deac1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ZhipengHe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5703a7f350e31b2f95a16a02116a2028c93deac1 -
Trigger Event:
release
-
Statement type: