Skip to main content

A CLI to fetch the status of charging stations

Project description

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

CLI

The CLI can be used in the following ways:

# Using arguments
$ can-i-charge --station <SERIAL1> --station <SERIAL2> --station <SERIAL3>
# Using env variables
$ export STATIONS="<SERIAL1> <SERIAL2>"
$ can-i-charge
# The script can also be called using it's abbreviation
$ cic

You can pass as many stations as you want. At least one valid is needed however to actually return some data. The serials for the charging stations can be found on the charging station or on websites like shellrecharge.

Prometheus Exporter

This utility can also be used as a Prometheus exporter:

# Using arguments
$ can-i-charge --station <SERIAL1> --station <SERIAL2> --station <SERIAL3> --exporter --port <default is 9041> --interval <default is 60 seconds>
# Using env variables
$ export STATIONS="<SERIAL1> <SERIAL2>"
$ 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 STATIONS='BE-TCB-P104146' boosterl/can-i-charge:dev

# Using exporter
$ docker run --rm -e STATIONS='BE-TCB-P104146' -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 library uses the excellent python-shellrecharge package.

Project details


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.6.6.tar.gz (43.1 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.6.6-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: can_i_charge-0.6.6.tar.gz
  • Upload date:
  • Size: 43.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for can_i_charge-0.6.6.tar.gz
Algorithm Hash digest
SHA256 fea8d98a7dbbc247abe3d855a4e2ed4adb2ea18c97be04957159b198e6482c9b
MD5 74227076927da8076e0c4e97412e2b92
BLAKE2b-256 d9230d722e6c3a36862867ed05337417f3b377b005801bff96a50856bb1760e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for can_i_charge-0.6.6.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.6.6-py3-none-any.whl.

File metadata

  • Download URL: can_i_charge-0.6.6-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for can_i_charge-0.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9b81a67290be37b1c38a43baa60bc81b6b12b51b20c4c1173892b182d99e06ab
MD5 7f75c888ac3f33189fd76c259c8dd8e5
BLAKE2b-256 632f9c54bbb07480e70ff7625a5b9cbd296dcbe882c7a0b745e153790cc9d6ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for can_i_charge-0.6.6-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page