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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file can_i_charge-0.7.5.tar.gz.
File metadata
- Download URL: can_i_charge-0.7.5.tar.gz
- Upload date:
- Size: 43.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34f19492771a2ef76900979eccfcf4fe0287140663deeff319916ed668fb6ea7
|
|
| MD5 |
24eea737e2452330e3700f4a6691f2a5
|
|
| BLAKE2b-256 |
5fdfd2f12ea7c2ed3798f6c974c95b1a99d6d680588c9f8b9f40015e43410449
|
Provenance
The following attestation bundles were made for can_i_charge-0.7.5.tar.gz:
Publisher:
python-publish.yml on boosterl/can-i-charge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
can_i_charge-0.7.5.tar.gz -
Subject digest:
34f19492771a2ef76900979eccfcf4fe0287140663deeff319916ed668fb6ea7 - Sigstore transparency entry: 986148197
- Sigstore integration time:
-
Permalink:
boosterl/can-i-charge@3cd3b6bf8ab6e5bc75d704ba7d446ba8c490036d -
Branch / Tag:
refs/tags/0.7.5 - Owner: https://github.com/boosterl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3cd3b6bf8ab6e5bc75d704ba7d446ba8c490036d -
Trigger Event:
push
-
Statement type:
File details
Details for the file can_i_charge-0.7.5-py3-none-any.whl.
File metadata
- Download URL: can_i_charge-0.7.5-py3-none-any.whl
- Upload date:
- Size: 30.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6713c28e484ac97ddb665a8df567ff10f45de14c8fae9eb98c175169e86a88e
|
|
| MD5 |
b8ea140656bbd0693050859ccef55b65
|
|
| BLAKE2b-256 |
60dda688cd275fb3c0d84d838dbda25e353d7e3325de8b62506b11f3435b8ada
|
Provenance
The following attestation bundles were made for can_i_charge-0.7.5-py3-none-any.whl:
Publisher:
python-publish.yml on boosterl/can-i-charge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
can_i_charge-0.7.5-py3-none-any.whl -
Subject digest:
d6713c28e484ac97ddb665a8df567ff10f45de14c8fae9eb98c175169e86a88e - Sigstore transparency entry: 986148200
- Sigstore integration time:
-
Permalink:
boosterl/can-i-charge@3cd3b6bf8ab6e5bc75d704ba7d446ba8c490036d -
Branch / Tag:
refs/tags/0.7.5 - Owner: https://github.com/boosterl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3cd3b6bf8ab6e5bc75d704ba7d446ba8c490036d -
Trigger Event:
push
-
Statement type: