Skip to main content

Add your description here

Project description

io-adapters

API Reference

io-adapters API docs

Testing use cases that involve I/O is inherently difficult because they depend on external state and side effects. However, combining Dependency Injection (DI) with the Repository pattern significantly reduces this complexity.

By substituting real I/O implementations with fakes that simulate their behaviour, stateful interactions can be captured entirely in memory. This allows changes to the external world to be accumulated deterministically and the final state to be asserted directly, without relying on real filesystems, networks, or services.

The result is faster, more reliable tests that focus on behaviour rather than infrastructure.

However, creating these fakes can be time consuming and result in a maintenance burden that may not outweigh the benefit.

This is where io-adapters can help. Simply register each I/O function with one of the register decorators and the functionality will be added to the RealAdapter object, on top of that a stub will be added to the FakeAdapter object too so you can pass in either to your usecase and the functionality will work.

Repo map

├── .github
│   └── workflows
│       ├── ci_tests.yaml
│       └── publish.yaml
├── .pytest_cache
│   └── README.md
├── docs
│   └── source
│       └── conf.py
├── src
│   └── io_adapters
│       ├── __init__.py
│       ├── _adapters.py
│       ├── _container.py
│       ├── _io_funcs.py
│       └── _registries.py
├── tests
│   ├── __init__.py
│   ├── test_adapters.py
│   ├── test_adapters_apis.py
│   └── test_container.py
├── .pre-commit-config.yaml
├── README.md
├── pyproject.toml
├── ruff.toml
└── uv.lock
::

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

io_adapters-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

io_adapters-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for io_adapters-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fbda6bcc7711817321d524e74f91068d70daa8f109bd42442351754c5b0a92dc
MD5 5f4db8492023d242d4b97cd268d060b1
BLAKE2b-256 67a860111b4fdb9b465d76182dea2e220d3109655ceadd0c8d10fbaf00661ce9

See more details on using hashes here.

Provenance

The following attestation bundles were made for io_adapters-0.1.0.tar.gz:

Publisher: publish.yaml on second-ed/io-adapters

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

File details

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

File metadata

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

File hashes

Hashes for io_adapters-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcce6c3532dc6d225715a7e8b4f041d51448e349faedb1182f01a55af803683f
MD5 b36d3961a81a8d6f07b80587d847a45b
BLAKE2b-256 310210f2774010514801f773f9ea5c6111a3721dbfded25f60f592b100207cb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for io_adapters-0.1.0-py3-none-any.whl:

Publisher: publish.yaml on second-ed/io-adapters

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