Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pypotage

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pypotage

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

  • 1.0.0a0
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc