Asynchronous Python API For My Gas
Project description
aiomygas
Asynchronous Python API for Мой Газ.
Installation
Use pip to install the library:
pip install aiomygas
Usage
import asyncio
from pprint import pprint
import aiohttp
from aiomygas import SimpleMyGasAuth, MyGasApi
async def main(email: str, password: str) -> None:
"""Create the aiohttp session and run the example."""
async with aiohttp.ClientSession() as session:
auth = SimpleMyGasAuth(email, password, session)
api = MyGasApi(auth)
data = await api.async_get_accounts()
pprint(data)
if __name__ == "__main__":
_email = str(input("Email: "))
_password = str(input("Password: "))
asyncio.run(main(_email, _password))
Exceptions
All exceptions inherit from MyGasApiError:
MyGasApiError— base class for all API errorsMyGasApiParseError— response parsing errorsMyGasAuthError— authentication errors
Timeouts
aiomygas does not specify any timeouts for any requests. You will need to specify them in your own code. We recommend asyncio.timeout:
import asyncio
async with asyncio.timeout(10):
data = await api.async_get_accounts()
CLI
aiomygas-cli user@example.com password --accounts
aiomygas-cli user@example.com password --client
aiomygas-cli user@example.com password --charges
aiomygas-cli user@example.com password --payments
aiomygas-cli user@example.com password --info
Development
python -m venv .venv
.venv/bin/pip install -r requirements_test.txt -e .
pytest tests/ -v
Links
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 aiomygas-2.4.0.tar.gz.
File metadata
- Download URL: aiomygas-2.4.0.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
357969575a67576855506b2dcd3fce70c870d9b4f71ede23e03e0a75dd1e2cb3
|
|
| MD5 |
1e106e34bd521f1052bfba59d72d78cf
|
|
| BLAKE2b-256 |
6ac9aa88dd4c9211b8df7a814b5fcf48ff205f06411d1f57323068931d5aff44
|
Provenance
The following attestation bundles were made for aiomygas-2.4.0.tar.gz:
Publisher:
publish.yml on lizardsystems/aiomygas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiomygas-2.4.0.tar.gz -
Subject digest:
357969575a67576855506b2dcd3fce70c870d9b4f71ede23e03e0a75dd1e2cb3 - Sigstore transparency entry: 962439639
- Sigstore integration time:
-
Permalink:
lizardsystems/aiomygas@377a1f27715b8a270bdddf661a2aca928d5555c1 -
Branch / Tag:
refs/tags/v2.4.0 - Owner: https://github.com/lizardsystems
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@377a1f27715b8a270bdddf661a2aca928d5555c1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aiomygas-2.4.0-py3-none-any.whl.
File metadata
- Download URL: aiomygas-2.4.0-py3-none-any.whl
- Upload date:
- Size: 21.0 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 |
928708ef995b1f018680439fcd85713776a14f4f27cfcf650121997e769d3e35
|
|
| MD5 |
c5284d9d019292f57a21e578777a7c6a
|
|
| BLAKE2b-256 |
75e93cd88da1ee1d47166330ecfd9adcecc15208add26812f8dd7bcc877563f0
|
Provenance
The following attestation bundles were made for aiomygas-2.4.0-py3-none-any.whl:
Publisher:
publish.yml on lizardsystems/aiomygas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiomygas-2.4.0-py3-none-any.whl -
Subject digest:
928708ef995b1f018680439fcd85713776a14f4f27cfcf650121997e769d3e35 - Sigstore transparency entry: 962439645
- Sigstore integration time:
-
Permalink:
lizardsystems/aiomygas@377a1f27715b8a270bdddf661a2aca928d5555c1 -
Branch / Tag:
refs/tags/v2.4.0 - Owner: https://github.com/lizardsystems
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@377a1f27715b8a270bdddf661a2aca928d5555c1 -
Trigger Event:
release
-
Statement type: