Cofy API
Cofy API is an open-source modular framework for ingesting, standardising, storing, and computing energy-related data.
This package contains the runtime API and module system: the piece you need for route 1 in the root README, running a single energy community yourself. If you'd rather start from a ready-made repo than from this package directly, see cofy-api-template.
Install
pip install "cofy-api[all]"
Cofy is modular — install only what you need via extras. Example — install with only the tarrif and members modules:
pip install "cofy-api[tariff,members]"
Quick start
Create an app.py file with a minimal Cofy API:
from cofy.api import CofyAPI
from cofy.modules.tariff import TariffModule
app = CofyAPI()
app.register_module(TariffModule(api_key="YOUR_ENTSOE_KEY", name="entsoe"))
Run it:
fastapi dev app.py
The API is now available at http://127.0.0.1:8000 with interactive docs at /docs.
Authentication
Protect the API with bearer-token authentication:
from cofy.api import CofyAPI, TokenAuth, TokenInfo
app = CofyAPI(auth=TokenAuth({"my-secret-token": TokenInfo(name="Admin")}))
Clients authenticate via header (Authorization: Bearer my-secret-token) or query parameter (?token=my-secret-token).
Development
We use astral python tooling for our development environment. We use poethepoet to define some essential tasks. The demo run task is also available as vscode execution task, making it easy to run and debug the demo application from within vscode.
Install/update dependencies:
First install uv if you don't have it yet.
Then install/update dependencies:
uv sync
Install poethepoet and pre-commit
uv tool install poethepoet
uv tool install pre-commit
Activate pre-commit hooks that enforce code style on every commit:
pre-commit install
Tests and linting
uv sync --group dev
poe test
poe lint
poe format
poe check
Metadata
Release files for cofy-api 0.8.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 | Actions |
|---|---|---|---|---|
| cofy_api-0.8.0.tar.gz | 34.7 kB | Without provenance | Details for cofy_api-0.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cofy_api-0.8.0-py3-none-any.whl | Python 3 | none | any | Details for cofy_api-0.8.0-py3-none-any.whl |
Total release size: 82.6 kB
Release files / cofy_api-0.8.0.tar.gz
| Download URL | cofy_api-0.8.0.tar.gz |
|---|---|
| Size | 34.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
133eff08b5de9f46d42b2ac5f91c5074446a7f0975f2404e95db788ccb538eef
|
|
BLAKE2b-256 checksum How to use checksums |
456ad24b8167efe461cc011a63a356bfe395fb7e0d1b0b40c05da1fdd0bd1771
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / cofy_api-0.8.0-py3-none-any.whl
| Download URL | cofy_api-0.8.0-py3-none-any.whl |
|---|---|
| Size | 47.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74cb405b9b40f77f91349502834c79efd412906c23b4bbcd2e64b9a111f332e5
|
|
BLAKE2b-256 checksum How to use checksums |
e3e82a76578b9b05298845110196283ae80770c5643a2b9bfffed7b3f8272f22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for cofy-api 0.8.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.