You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

powergrid

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

powergrid

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

0.2.1
pipPyPI
Maintainers
1

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.1:

  • ✅ **Now handle TSO for Germany and Corsica.

📝 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 at https://pypi.org/project/powergrid/

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:

  • Fork the repo and create a branch.
  • Add your feature or fix a bug.
  • 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.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts