Skip to main content

california-midasapi

A Python wrapper for the California Energy Comission (CEC)'s Market Informed Demand Automation Server (MIDAS) energy price API.
This API lets you get info about energy prices in California from utilities regulated by the CEC, which is all the big ones (PG&E, SCE, SDG&E, SMUD, etc.) and some smaller municipal utilities. If you have a Rate Identification Number (RIN) QR Code on your electric bill you can use this API to get your electricity price in real time.

Usage

  1. Create a Midas object:
from california_midasapi import Midas

async with aiohttp.ClientSession() as session:
    midas = Midas(session)
asyncio.run(main())
  1. Access the API methods using this object:
# Get basic info about all rates
from california_midasapi.ratelist import RINFilter
rates = midas.GetAvailableRates(RINFilter.TARIFF)
print(rates) # ~40k+ items at writing

# Get specific info about one rate
ratedata = midas.GetRateInfo('USCA-SMSM-AD00-0000')
print(ratedata)
# Get the currently applicable value from a rate (local filtering)
print(ratedata.GetCurrentTariffs())

Contributing

Contributions are welcome, please submit a PR!

More Information & Thanks

More info about MIDAS can be found at https://midasapi.energy.ca.gov/
Thank you to the CEC for providing example code at https://github.com/morganmshep/MIDAS-Python-Repository

Projects using this library

ha-midas: A Home Assistant integration to expose MIDAS rate data to your smart home

If you have a project using this library, we'd love to hear about it! Let us know and we'll add it to this list.

Download files

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

Source Distribution

california_midasapi-2.1.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

california_midasapi-2.1.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file california_midasapi-2.1.1.tar.gz.

File metadata

  • Download URL: california_midasapi-2.1.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for california_midasapi-2.1.1.tar.gz
Algorithm Hash digest
SHA256 4dc80b479712bfd09d76f9c7b65e6cd2f68a66cf09890653df39fc9ccfacfd06
MD5 48e7a7cd56bac8eb21c1e88d53956e5c
BLAKE2b-256 3047f60c814f9b45e466c1eead51e94c60012fe4a4afb22a08e5661c27ce05a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for california_midasapi-2.1.1.tar.gz:

Publisher: python-publish.yml on MattDahEpic/california-midasapi

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

File details

Details for the file california_midasapi-2.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for california_midasapi-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 163d45360bb801872d534d50a76391c0799aec2de0acd8713ffed9e385af3f4f
MD5 fe00061775f8f4337716eae5fe8321b8
BLAKE2b-256 4e7b59bfa3a2ea449cc99f00b1f8a63a4a9becca7b1a9790dc1569520e978d96

See more details on using hashes here.

Provenance

The following attestation bundles were made for california_midasapi-2.1.1-py3-none-any.whl:

Publisher: python-publish.yml on MattDahEpic/california-midasapi

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

Release history Release notifications | RSS feed

This release

2.1.1 This release

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.1.0

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page