evnex-0.3.3
توضیحات
A Python wrapper for the EVNEX Cloud API
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | evnex-0.3.3 |
| نام | evnex |
| نسخه کتابخانه | 0.3.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Brian Thorne |
| ایمیل نویسنده | brian@hardbyte.nz |
| آدرس صفحه اصلی | https://github.com/hardbyte/python-evnex |
| آدرس اینترنتی | https://pypi.org/project/evnex/ |
| مجوز | Apache-2.0 |
# python-evnex
Python client for the Evnex API.
Author not affiliated with Evnex.
## Features
- Talks to your Evnex charger via Cloud API
- Automatic retries with exponential backoff
- Automatic re-authentication
- Optionally pass in a `httpx` client
- Optionally pass in tokens to resume existing session
## Installation
```
pip install evnex
```
## Usage
```python
import asyncio
from pydantic import BaseSettings, SecretStr
from evnex.api import Evnex
class EvnexAuthDetails(BaseSettings):
EVNEX_CLIENT_USERNAME: str
EVNEX_CLIENT_PASSWORD: SecretStr
async def main():
creds = EvnexAuthDetails()
evnex = Evnex(username=creds.EVNEX_CLIENT_USERNAME,
password=creds.EVNEX_CLIENT_PASSWORD.get_secret_value())
user_data = await evnex.get_user_detail()
for org in user_data.organisations:
print("Getting 7 day insight for", org.name, "User:", user_data.name)
insights = await evnex.get_org_insight(days=7, org_id=org.id)
for segment in insights:
print(segment)
if __name__ == '__main__':
asyncio.run(main())
```
## Examples
`python-evnex` is intended as a library, but a few example scripts are provided in the `examples` folder.
Providing authentication for the examples is via environment variables, e.g. on nix systems:
```
export EVNEX_CLIENT_USERNAME=you@example.com
export EVNEX_CLIENT_PASSWORD=<your password>
python -m examples.get_charge_point_detail
```
## Developer Notes
### Making a new release
What ends up on PyPi is what really matters.
Update the version in `pyproject.toml`, build and publish with poetry:
```shell
poetry build
poetry publish
```
نیازمندی
| مقدار | نام |
|---|---|
| >=0.23,<0.24 | httpx |
| >=2022.11,<2023.0 | pycognito |
| >=1.10,<2.0 | pydantic |
| >=8.1,<9.0 | tenacity |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10,<4.0 | Python |
نحوه نصب
نصب پکیج whl evnex-0.3.3:
pip install evnex-0.3.3.whl
نصب پکیج tar.gz evnex-0.3.3:
pip install evnex-0.3.3.tar.gz