Skip to main content

A simple Python package that provides an easy way to use Dependency Injection in your projects.

Project description

pypotage

img img python-package-yml codecov

A simple Python package that provides an easy way to use Dependency Injection in your projects.

alt text

Key Features

  • Easy to use
  • Supports both function and class-based dependency injection
  • Allows customizing the way dependencies are resolved
  • Allows for the use of custom containers

Installing

To install the latest pypotage version, run the following command:

python -m pip install -U pypotage

Development

To install the development version:

git clone https://github.com/pavalso/potage.git
cd potage
python -m pip install -U .

Quick Examples

Basic usage

import pypotage
import logging

@pypotage.prepare
def logger():
    logging.basicConfig(level=logging.DEBUG)
    return logging.getLogger(__name__)

pypotage.cook(logging.Logger).take_out().info("Hello World!")

Using classes

import pypotage

class A:
    def __init__(self):
        ...

@pypotage.prepare
class B(A):
    def __init__(self):
        ...

pypotage.cook(A).take_out()  # returns an instance of B

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

pypotage-2.0.0a0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

pypotage-2.0.0a0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file pypotage-2.0.0a0.tar.gz.

File metadata

  • Download URL: pypotage-2.0.0a0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypotage-2.0.0a0.tar.gz
Algorithm Hash digest
SHA256 ee09cb4e3180326abaa2b3366b836ea21c36313bcb1e4efc2e98b7016cd79ac1
MD5 70278d537b3d86034087bcaa8d5285f5
BLAKE2b-256 056261c3be1eb57b4f795a33759d956dcbde20f073681012f7db0278c00bb048

See more details on using hashes here.

File details

Details for the file pypotage-2.0.0a0-py3-none-any.whl.

File metadata

  • Download URL: pypotage-2.0.0a0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypotage-2.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 7fd8d708cf17b73956f1f7c36703df052ebfad68616b85b5e70fa414ab400414
MD5 e698e0750e8b895057437e00b49a55ad
BLAKE2b-256 1bed29412008f23f2c47ea70e310a8fbc5fa670b8d3263521b2f969383733d13

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