Skip to main content

A high-performance lookup library for Transmission System Operators (TSOs)

Project description

PowerGrid - TSO Finder

PyPI Version License: MIT Python Versions

PowerGrid is a high-performance Python library for looking up Transmission System Operators (TSOs) based on ISO country-region codes.

📝 Note: This version currently supports French region codes only.
🎯 Contributors are welcome to extend it to other countries!

📝 Version 0.2.0:

  • Now returns full Tso objects instead of just IDs.
  • Uses a shared constants.py file for managing data source paths.
  • Case-insensitive searches for region codes & ENTSO-E codes.

🚀 Features

Blazing-fast in-memory lookup
Search by:

  • Region code (ISO 3166-2)
  • TSO ID
  • ENTSO-E Code

Case-insensitive searches
Optimized for REST APIs and large-scale queries


📦 Installation

Using PyPI

PowerGrid is available on PyPI. Install it with:

uv pip install powergrid

🛠 API Reference

TsoFinder

Initialize the Finder

from tso_finder import TsoFinder
finder = TsoFinder()

Lookup by Region Code

print(finder.by_region("FR-IDF"))  # Output: "TSO_FR_001"

Lookup by TSO ID

print(finder.by_tsoid("TSO_FR_001"))  # Output: ["FR-IDF", "FR-ARA", ...]

Lookup by ENTSO-E Code

print(finder.by_entsoe("10YFR-RTE------C"))  # Output: <Tso object for RTE>

🏗 Contributing

👥 We welcome contributions! To contribute:

  1. Fork the repo and create a branch.
  2. Add your feature or fix a bug.
  3. Submit a pull request.

📜 License

PowerGrid is MIT Licensed. See the LICENSE file for details.

💡 Why Use PowerGrid?

  • Fast: Precomputes mappings for instant lookups.
  • Scalable: Can handle large-scale queries efficiently.
  • Reliable: Designed for TSO data accuracy.

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

powergrid-0.2.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

powergrid-0.2.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file powergrid-0.2.0.tar.gz.

File metadata

  • Download URL: powergrid-0.2.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.29

File hashes

Hashes for powergrid-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7b09ba723280fb50cb32205bdf6edd64e1de61ac71545fcd9503867985e39fc6
MD5 caa6170bd957ac8abda6e4812b016bac
BLAKE2b-256 77a9d1a627f1dff45cc3f91f23fec567fa8b2ef8c2a3943a1344332589538784

See more details on using hashes here.

File details

Details for the file powergrid-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: powergrid-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.29

File hashes

Hashes for powergrid-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ac3d99b020c5f2adfa0271658a111c015aa1cfbe5a9dea2e0374ddbdfc00260
MD5 002d9d0b203dc48c34e9ffd5ee5d3869
BLAKE2b-256 d37ab2d034f6b2cb35e49cbdc42fcb617d7a956694b26d726a8c5589b96c8155

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