Skip to main content

aiomygas

PyPI Python License CI

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 errors
  • MyGasApiParseError — response parsing errors
  • MyGasAuthError — 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

Metadata

Release files for aiomygas 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiomygas 2.4.0
File Size Uploaded Provenance
aiomygas-2.4.0.tar.gz 21.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aiomygas 2.4.0
File Interpreter ABI Platform
aiomygas-2.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.4 kB

Release files / aiomygas-2.4.0.tar.gz

Download URL aiomygas-2.4.0.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
357969575a67576855506b2dcd3fce70c870d9b4f71ede23e03e0a75dd1e2cb3
BLAKE2b-256 checksum
How to use checksums
6ac9aa88dd4c9211b8df7a814b5fcf48ff205f06411d1f57323068931d5aff44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 18, 2026.

Transparency log

Release files / aiomygas-2.4.0-py3-none-any.whl

Download URL aiomygas-2.4.0-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
928708ef995b1f018680439fcd85713776a14f4f27cfcf650121997e769d3e35
BLAKE2b-256 checksum
How to use checksums
75e93cd88da1ee1d47166330ecfd9adcecc15208add26812f8dd7bcc877563f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 18, 2026.

Transparency log

Security for aiomygas 2.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aiomygas-2.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page