Skip to main content

Can I charge?

It's a question you might have asked yourself before if you have a BEV/PHEV. This utility allows you to check if your favorite charging stations are available for your car to charge, right from the warmth of your terminal! No need to go outside and physically check if the charging station is available, and possibly return disappointed because it was occupied.

How to install

Using pip

$ pip install can-i-charge

AUR

A PKGBUILD has been created for this package, available on the AUR.

paru -S python-can-i-charge

How to use

An API key for the EnBW eMobility public API is required. Set it via the --api-key flag or the API_KEY environment variable.

CLI

The CLI can be used in the following ways:

# Using arguments
$ can-i-charge --api-key <API_KEY> --station <ID1> --station <ID2>
# Using env variables
$ export API_KEY="<API_KEY>"
$ export STATIONS="<ID1> <ID2>"
$ can-i-charge
# The script can also be called using its abbreviation
$ cic

You can pass as many stations as you want. At least one valid station is needed to return data. Station IDs are numeric and can be found via the EnBW eMobility map. You can use the developer tools to find the ID and APIKEY, which is also needed.

Prometheus Exporter

This utility can also be used as a Prometheus exporter:

# Using arguments
$ can-i-charge --api-key <API_KEY> --station <ID1> --station <ID2> --exporter --port <default is 9041> --interval <default is 60 seconds>
# Using env variables
$ export API_KEY="<API_KEY>"
$ export STATIONS="<ID1> <ID2>"
$ export EXPORTER=1
# Optionally also overwrite default interval and port
$ export EXPORTER_PORT=9000
$ export EXPORTER_INTERVAL=120
$ can-i-charge

See it in action

GIF of an example session interacting with the cli

Container

Build

$ docker build -t boosterl/can-i-charge:dev .

Run

# Default
$ docker run --rm -e API_KEY='<API_KEY>' -e STATIONS='471003' boosterl/can-i-charge:dev

# Using exporter
$ docker run --rm -e API_KEY='<API_KEY>' -e STATIONS='471003' -e EXPORTER='1' -p 9041:9041 boosterl/can-i-charge:dev

# Using docker-compose
$ docker-compose up -d

dgoss

$ dgoss run boosterl/can-i-charge:dev
 INFO: Starting docker container
 INFO: Container ID: 97851a83
 INFO: Sleeping for 0.2
 INFO: Container health
 INFO: Running Tests
 User: can-i-charge: exists: matches expectation: true
 INFO: Deleting container

Acknowledgments

This application uses the EnBW eMobility public API, and got inspired by the excellent work of the EnBW Home Assistant integration.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

can_i_charge-0.8.4.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

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

can_i_charge-0.8.4-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

Details for the file can_i_charge-0.8.4.tar.gz.

File metadata

  • Download URL: can_i_charge-0.8.4.tar.gz
  • Upload date:
  • Size: 43.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for can_i_charge-0.8.4.tar.gz
Algorithm Hash digest
SHA256 76d161795477ccb3a2725f35269b1d841479daccd896f6997c8ef38c6994483c
MD5 85a925c45da1dae3831e671c681c2470
BLAKE2b-256 3c69c9600d515ef699bcd7e7aa197d0a2948817b328cf7fbc56c7c093e6c1223

See more details on using hashes here.

Provenance

The following attestation bundles were made for can_i_charge-0.8.4.tar.gz:

Publisher: python-publish.yml on boosterl/can-i-charge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file can_i_charge-0.8.4-py3-none-any.whl.

File metadata

  • Download URL: can_i_charge-0.8.4-py3-none-any.whl
  • Upload date:
  • Size: 31.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for can_i_charge-0.8.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7661f346b8ad038a319af7debff45db26fff12a82573086c250f4efaef1a1154
MD5 59b1c31a1063e3c1c482a56149feb0cc
BLAKE2b-256 4518c662e6b8439aa68e472beb8a8e6f98a36d1e9c8a39b431ccd4614d76cd99

See more details on using hashes here.

Provenance

The following attestation bundles were made for can_i_charge-0.8.4-py3-none-any.whl:

Publisher: python-publish.yml on boosterl/can-i-charge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.8.5

2 files

This release

0.8.4 This release

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.7.5

2 files

0.7.4

2 files

0.7.0

2 files

0.6.13

2 files

0.6.12

2 files

0.6.11

2 files

0.6.10

2 files

0.6.9

2 files

0.6.8

2 files

0.6.7

2 files

0.6.6

2 files

0.6.5

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

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