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.0.tar.gz (3.5 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.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aresource-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.1 Windows/11

File hashes

Hashes for aresource-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4e70bcc46a5adde956444a98cd0e94ffa6631135b19f40cfcb8072b4278c2905
MD5 6cf9834d9d81d03c30b01ba579f29f34
BLAKE2b-256 9ffc95cdb8b49e2db02bc8409b0863c082915f30f417947111624f891dd21213

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aresource-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.1 Windows/11

File hashes

Hashes for aresource-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de570ab0a8aab8c91197eb991e6562b6535abd0d8454b4732833a10e08fc2a6e
MD5 4885b767569550d0265bcc0812d6a413
BLAKE2b-256 7a9e4e45fe9d5396af28fc2c6e30e2676e88993a83ac6f948e63f237e0e4dc4f

See more details on using hashes here.

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