luminus-py
A notebook-friendly Python client for luminus-mcp.
This package starts the existing Node MCP server under the hood, calls tools over stdio, and returns Python-native result objects with optional pandas helpers.
Any MCP tool exposed by luminus-mcp is callable directly as a Python method, so the SDK does not need a hand-written wrapper for every tool.
The SDK also includes geospatial helpers for notebook workflows: to_geojson() for lightweight mapping and to_geodataframe() for GeoPandas users.
Roadmap: see ../docs/python-sdk-roadmap.md.
Install
pip install luminus-py[notebook]
For GIS notebook work:
pip install luminus-py[all]
You also need luminus-mcp itself available on your machine, because the Python SDK starts the existing Node MCP server under the hood.
npm install -g luminus-mcp
Current published versions: luminus-mcp@0.5.1 and luminus-py==0.5.0.
API keys
Keyed tools use the same auth model as the Node server. Resolution order is:
- environment variables like
ENTSOE_API_KEY ~/.luminus/keys.json
Example ~/.luminus/keys.json:
{
"ENTSOE_API_KEY": "...",
"GIE_API_KEY": "...",
"FINGRID_API_KEY": "..."
}
Per-notebook overrides are also supported:
lum = Luminus(profile="trader", env={"ENTSOE_API_KEY": "..."})
Quick start
from luminus import Luminus
with Luminus(profile="trader") as lum:
prices = lum.get_day_ahead_prices(zone="DE")
df = prices.to_pandas()
# Any MCP tool can be called directly
flows = lum.get_cross_border_flows(from_zone="DE", to_zone="NL")
site = lum.compare_sites(sites=[
{"name": "A", "lat": 52.1, "lon": 0.1},
{"name": "B", "lat": 52.2, "lon": 0.2},
], country="GB")
# GIS-friendly exports
geojson = site.to_geojson(data_key="rankings")
# Batch several calls into one DataFrame
multi_zone = lum.call_many_to_pandas(
"get_day_ahead_prices",
[{"zone": "DE"}, {"zone": "FR"}, {"zone": "NL"}],
parallel=True,
)
# One-shot export helpers
prices_df = lum.call_tool_to_pandas("get_day_ahead_prices", {"zone": "DE"})
rankings_geojson = lum.call_tool_to_geojson("compare_sites", {
"country": "GB",
"sites": [
{"label": "A", "lat": 52.1, "lon": 0.1},
{"label": "B", "lat": 52.2, "lon": 0.2},
],
}, data_key="rankings")
Notebook demos
Polished notebook demos live in examples/:
Notebook-first helpers
The Python SDK now ships a few opinionated helpers for high-usage analyst flows:
lum.get_outages_frame(...)lum.get_cross_border_flows_many([...])lum.get_grid_proximity_substations(...)lum.get_grid_proximity_lines(...)lum.get_grid_proximity_snapshot(...)lum.get_grid_connection_queue_projects(...)lum.get_grid_connection_queue_sites(...)lum.get_grid_connection_queue_snapshot(...)lum.get_distribution_headroom_matches(...)lum.get_distribution_headroom_snapshot(...)lum.get_grid_connection_intelligence_snapshot(...)lum.estimate_site_revenue_frame(...)lum.estimate_site_revenue_estimate(...)
get_distribution_headroom_* currently supports operator="SSEN" and operator="NPG" against the public upstreams wired into the MCP server.
Example:
from luminus import (
DistributionHeadroomSnapshot,
GridConnectionIntelligenceSnapshot,
GridProximitySnapshot,
Luminus,
SiteRevenueEstimate,
)
with Luminus(profile="gis") as lum:
outages = lum.get_outages_frame(zone="DE", type="generation")
flows = lum.get_cross_border_flows_many([("DE", "NL"), ("FR", "DE")])
substations = lum.get_grid_proximity_substations(lat=52.0, lon=0.1)
queue = lum.get_grid_connection_queue_projects(connection_site_query="Berkswell")
headroom = lum.get_distribution_headroom_matches(lat=50.84, lon=-1.08, operator="SSEN")
revenue = lum.estimate_site_revenue_frame(
lat=52.0,
lon=0.1,
zone="GB",
technology="bess",
capacity_mw=20,
)
proximity: GridProximitySnapshot = lum.get_grid_proximity_snapshot(lat=52.0, lon=0.1)
headroom_snapshot: DistributionHeadroomSnapshot = lum.get_distribution_headroom_snapshot(
lat=50.84,
lon=-1.08,
operator="SSEN",
)
intelligence: GridConnectionIntelligenceSnapshot = lum.get_grid_connection_intelligence_snapshot(
lat=50.84,
lon=-1.08,
country="GB",
)
if intelligence.nged_connection_signal and intelligence.nged_connection_signal.queue_signal:
project_count = intelligence.nged_connection_signal.queue_signal.summary.matched_projects
estimate: SiteRevenueEstimate = lum.estimate_site_revenue_estimate(
lat=52.0,
lon=0.1,
zone="GB",
technology="bess",
)
Errors and typed models
- Startup failures now raise
LuminusStartupError. - Tool-side configuration failures raise
LuminusConfigurationError. - Tool-side upstream/data-source failures raise
LuminusUpstreamError. - Dynamic whole-surface access still works through
LuminusResult, and common GIS/revenue flows also expose opt-in typed models.
Notes
-
Use
lum.list_tools()to see the live tool surface for the active profile. -
Use
lum.describe_tool("tool_name")to inspect the MCP description/schema metadata. -
Use
lum.call_many()/lum.call_many_to_pandas()for generic multi-zone or multi-site notebook pulls. -
Use
parallel=Trueon batch helpers when you want the SDK to fan out across multiple MCP subprocesses. -
Use
lum.get_day_ahead_prices_many()andlum.get_generation_mix_many()for common analyst workflows. -
Use
lum.compare_sites_rankings()together withlum.compare_sites_rankings_geojson()andlum.compare_sites_rankings_geodataframe()for ranked siting output. -
Use the typed snapshots only when they help notebook readability; the raw dynamic MCP surface is still available.
-
Notebook demos live in
examples/. -
Use
to_geojson()for lightweight mapping andto_geodataframe()when GeoPandas is installed. -
Requires
luminus-mcpto be available onPATH, unless you pass an explicit command. -
By default the client starts
luminus-mcp --profile <profile>. -
For local repo development you can point it at the built server directly:
lum = Luminus(command=["node", r"C:\Users\skf_s\luminus\dist\index.js"], profile="gis")
Metadata
Release files for luminus-py 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| luminus_py-0.5.0.tar.gz | 19.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| luminus_py-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.1 kB
Release files / luminus_py-0.5.0.tar.gz
| Download URL | luminus_py-0.5.0.tar.gz |
|---|---|
| Size | 19.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b663a5819625b88480e11c53bf2f0a3516779c80638dac7fbb8010ebbf799680
|
|
BLAKE2b-256 checksum How to use checksums |
c549cde9359cb3cd52144e612d7892ff2a3bb7a8ca3fe842377479ac06fed352
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / luminus_py-0.5.0-py3-none-any.whl
| Download URL | luminus_py-0.5.0-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3822971862c0e7830bb0ff01658d1d72491f401330fa7457afed4977fea9487b
|
|
BLAKE2b-256 checksum How to use checksums |
2960bf30ff949b108a4a784e4a993ebfc79713217a3ea965c1d6644ae4fbf93f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logSecurity for luminus-py 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for luminus_py-0.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.