Skip to main content

No project description provided

Project description

aresource

pypi python Tests

A Python project for resource management.

Project Structure

src/
  aresource/
tests/

Installation

Use pip to install released version:

pip install aresource

Use Poetry to install local version:

poetry install

Usage

Example of usage. Load config and use it to initialize new session

import asyncio
from collections.abc import AsyncIterator
from contextlib import asynccontextmanager
from io import TextIOBase

from aresource import callback_context_resource, ResourceManager


class Manager(ResourceManager):
    @callback_context_resource
    async def file(self) -> AsyncIterator[TextIOBase]:
        with open("config.txt", "w") as f:
            yield f


async def main() -> None:
    async with Manager() as mng:
        mng.file.write("Hello, World!")


if __name__ == "__main__":
    asyncio.run(main())

Testing

Run tests with:

poetry run pytest

Code Quality

Command to format and lint code:

poetry run ruff format .
poetry run ruff check --fix
poetry run mypy .

License

MIT License

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

aresource-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

aresource-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file aresource-0.1.1.tar.gz.

File metadata

  • Download URL: aresource-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aresource-0.1.1.tar.gz
Algorithm Hash digest
SHA256 913bd9a0e336fcb92030440014bc54bd4434b6aa4eebf259e2a186d8be1f972c
MD5 8b4915577e8679e18231de5430a669c8
BLAKE2b-256 c3b043db470c53c92cee889aa68f70ac24f40ee06654bd52a895e775bc15a1d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresource-0.1.1.tar.gz:

Publisher: release.yml on xbabka01/aresource

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresource-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: aresource-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aresource-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23f5e229a54a52f107dc1af12465db1cb47f7d32aebd6bd10af36bde49f6d3d1
MD5 e450f6d4cfedc195f376837dd54ba31a
BLAKE2b-256 29cbd1c5d9a4db48fbd7a74112ced92c44adb9ce9ffbb1d8441eb58d2764c638

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresource-0.1.1-py3-none-any.whl:

Publisher: release.yml on xbabka01/aresource

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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