Skip to main content

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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nemdatatools-0.1.0.tar.gz (144.1 kB view details)

Uploaded Source

Built Distribution

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

nemdatatools-0.1.0-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

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

Hashes for nemdatatools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e8c79fa69ac5e7009041a035a80fd8818a3bc532a9e49b4f456dbd49be7ab5f0
MD5 82081c4e971313ebfd3519044ceec263
BLAKE2b-256 82ffdd15af6164567b32951221480701cd7737a6d7fa52352a5b34150ffe2e0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemdatatools-0.1.0.tar.gz:

Publisher: publish-pypi.yml on ZhipengHe/nemdatatools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for nemdatatools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5cf4632cd084695abb23705fe2030677138aa2cc486f882623edead5b38afb10
MD5 e28a776836686a07c53e6f0a4b986396
BLAKE2b-256 add9148478fbe2063881812ccdc5624d1848d5e56f9da5f2967a18b252045400

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemdatatools-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on ZhipengHe/nemdatatools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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