Skip to main content

EV Charging Status

Python app that polls charger APIs and writes station status events to TimescaleDB/PostgreSQL.

Setup

The CLI is published on PyPI as ev-charging-status. Run it with uvx (no install/checkout needed):

uvx ev-charging-status --help

Provide DB credentials and API tokens via a .env file. The CLI loads, in order, the first file found in the current directory: config/.ev.env, .env, then config/.env. Copy the example and fill it in:

cp .env.example .env

.env is ignored by git. Run uvx commands from the directory that holds your env file so it gets picked up.

Developing from a source checkout instead? Run uv sync and use uv run ev-charging-status <command> in place of uvx ev-charging-status <command>.

Database

Initialize schema and seed default sites/statuses/stations:

uvx ev-charging-status init-db

Only rows with sites.enabled = true are polled.

Run

First run, or after recreating/changing the database schema, initialize the database once:

uvx ev-charging-status init-db

Routine one-time poll:

uvx ev-charging-status poll

You can combine initialization and polling for a safe first run:

uvx ev-charging-status poll --init-db

--init-db is not required for every poll. It only ensures the database, tables, indexes, default sites, default statuses, default stations, and TimescaleDB setup exist before polling.

Continuous 5-minute loop (or POLL_INTERVAL_SECONDS):

uvx ev-charging-status run-loop

For a safe first continuous run:

uvx ev-charging-status run-loop --init-db

Sync historical rows from the public Google Sheet CSV into station_status_events:

uvx ev-charging-status sync-sheet

Set SYNC_SHEET_ID in .env. By default the command reads Sheet1 using:

https://docs.google.com/spreadsheets/d/<SYNC_SHEET_ID>/gviz/tq?tqx=out:csv&sheet=Sheet1

The sheet must include columns like current_time, station_name, and status. The sync command inserts only rows that do not already exist with the same (time, station_id, status). Rows for station IDs not present in the stations table are ignored.

You can override the tab or full CSV URL:

uvx ev-charging-status sync-sheet --sheet-name Sheet1
uvx ev-charging-status sync-sheet --url 'https://docs.google.com/spreadsheets/d/{SHEETID}/gviz/tq?tqx=out:csv&sheet=Sheet1'

Optimize station_status_events storage:

uvx ev-charging-status optimize-db

This rounds existing event timestamps to second precision, drops the redundant (time DESC, station_id) index, and compresses TimescaleDB chunks older than 7 days. Timestamp precision is also second-level for new polls.

You can change the compression cutoff:

uvx ev-charging-status optimize-db --compress-older-than '1 day'

Show total database size:

uvx ev-charging-status db-size
# include table/relation sizes
uvx ev-charging-status db-size --tables

Tables

  • sites: site enable/disable control
  • status_lookup: status IDs; new normalized statuses are inserted automatically
  • stations: station metadata inserted once on first sight
  • station_status_events: Timescale hypertable with exactly (time, station_id, status)
  • site_latest_snapshot: latest raw JSONB API response per site

Metadata

Release files for ev-charging-status 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ev-charging-status 0.1.7
File Size Uploaded Provenance Actions
ev_charging_status-0.1.7.tar.gz 20.1 kB Without provenance Details for ev_charging_status-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ev-charging-status 0.1.7
File Interpreter ABI Platform Actions
ev_charging_status-0.1.7-py3-none-any.whl Python 3 none any Details for ev_charging_status-0.1.7-py3-none-any.whl

Total release size: 43.9 kB

Release files / ev_charging_status-0.1.7.tar.gz

Download URL ev_charging_status-0.1.7.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
52de8db3ec000b9c2b6b036efd0b0a6f7a697a0663a02a40ec16bf783cc21574
BLAKE2b-256 checksum
How to use checksums
ba22f835e804f6c2bf03f9614b5fa3099f841c19c34448ec8e6c1e7f88790b55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / ev_charging_status-0.1.7-py3-none-any.whl

Download URL ev_charging_status-0.1.7-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c7a629bb3865e2297205df7819f15f97d7b84386d6a8725661dc54f3f785c63
BLAKE2b-256 checksum
How to use checksums
5df8bcd302e42b74af34a2bbb8b136bf41823fafc7582b83a99e7c34692ac62c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for ev-charging-status 0.1.7

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.

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