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 — the server rejected the credentials; ask the user for a new password
  • MyGasConnectionError — network, DNS, timeout or HTTP status errors; transient, retry later

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

Metadata

Release files for aiomygas 2.5.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.5.0
File Size Uploaded Provenance Actions
aiomygas-2.5.0.tar.gz 22.4 kB With provenance Details for aiomygas-2.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 43.8 kB

Release files / aiomygas-2.5.0.tar.gz

Download URL aiomygas-2.5.0.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
486aa1a0f1670e7d167868faee9ed25e1ca63c8b95f47fc3b24939e9b1b00fe7
BLAKE2b-256 checksum
How to use checksums
00c28555365fbbd99e759ea52c35921e8fc64acd0d3eea0125be0f9fe6b7f980
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

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

Download URL aiomygas-2.5.0-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c9735044336be1e3a3e43abd9295d413281819ed17fae9a5f8a9f276a9b4009
BLAKE2b-256 checksum
How to use checksums
904b5a202cde494a40bf53a00bb80ffa8312561f9b449551f5ba18d177c3276e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for aiomygas 2.5.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aiomygas-2.5.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 Nov 17, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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