Skip to main content

Python 3 package to retrieve public and private EV charger data from Shell Recharge

Project description

GitHub Release GitHub Activity License Project Maintenance

Donate via PayPal Sponsor on GitHub

Python: Shell Recharge

Python 3 package to retrieve public EV charger data from Shell Recharge

About

This package allows you to request data from public EV chargers using Shell Recharge. I build it to create a home-assistant integration, it can be done with rest calls only, but then options are limited.

Installation

pip3 install shellrecharge

Configuration

Find the EV charger(s) you want to monitor here: https://ui-map.shellrecharge.com look for the Serial number under details section. Then use Add device within Home Assistant and enter the Serial number in the form.

Example:

image

Development

To create a development environment to commit code.

python3 -m venv .venv
source .venv/bin/activate
pip3 install pdm ruff mypy

sudo apt install pre-commit
pip3 install pre-commit

Run checks before PR/Commit:

make all

Example

Below provides example on how to use the library.

#!/usr/bin/env python3
"""Example code."""
import asyncio
import logging
import sys
from asyncio import CancelledError

import aiohttp
from aiohttp.client_exceptions import ClientError

import shellrecharge
from shellrecharge import LocationEmptyError, LocationValidationError, RateLimitHitError


async def main():
    """Main module."""

    # Some random stations
    location_ids = ["9b9428ab-1dfd-4230-a024-084eacf776ff", "682154", "9cf6c16b-b043-4ba8-b7ca-872f82a0faf4"]

    async with aiohttp.ClientSession() as session:
        try:
            api = shellrecharge.Api(session)
            for location_id in location_ids:
                location = await api.location_by_id(location_id)
                logging.info(location)
        except LocationEmptyError:
            logging.error("No data returned, check location id")
        except LocationValidationError as err:
            logging.error("Location validation error {}, report locaton id" % err)
        except (ClientError, TimeoutError, CancelledError) as err:
            logging.error(err)
        except RateLimitHitError as err:
            logging.error(err)


if __name__ == "__main__":
    logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())

💖 Support This Project

If you find this library useful for your projects, please consider supporting its continued development and maintenance:

🌟 Ways to Support

  • ⭐ Star this repository - Help others discover the project
  • 💰 Financial Support - Contribute to development and hosting costs
  • 🐛 Report Issues - Help improve stability and compatibility
  • 📖 Spread the Word - Share with other developers

💳 Financial Support Options

Donate via PayPal Sponsor on GitHub

Why Support?

  • Keeps the project actively maintained
  • Enables faster bug fixes and new features
  • Supports infrastructure costs (testing, AI, CI/CD)
  • Shows appreciation for hundreds of hours of development

Every contribution, no matter the size, makes a difference and is greatly appreciated! 🙏

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

shellrecharge-0.1.23.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

shellrecharge-0.1.23-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file shellrecharge-0.1.23.tar.gz.

File metadata

  • Download URL: shellrecharge-0.1.23.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for shellrecharge-0.1.23.tar.gz
Algorithm Hash digest
SHA256 0cfd5e36a23e4e2daddb355905413f0b4e14645b7f343471588a8416f3cdd120
MD5 09ceab83d7e56a2602802be5b9e8b1c9
BLAKE2b-256 9e11ef5b21d15b5be5baa405fda20d46ac86aac67942071e1a7a9a92102e491e

See more details on using hashes here.

File details

Details for the file shellrecharge-0.1.23-py3-none-any.whl.

File metadata

  • Download URL: shellrecharge-0.1.23-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for shellrecharge-0.1.23-py3-none-any.whl
Algorithm Hash digest
SHA256 301e82fa92138bb2acbd932120f96bced86d810ad1af62aa1d2c605bd9197d84
MD5 e50202707cd312956a7730e6e6148f2d
BLAKE2b-256 04a896a3a4ac40bfb980693a39faa9f813a7e4bf3a8d448e2683a940c3df86f2

See more details on using hashes here.

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