Skip to main content

Python Dependency Manager

Project description

pydm 🐍

A Python package designed to streamline dependency injection and parameter management for Python applications.


Features

  • Service Container: Manage services and dependencies with ease.
  • Interface Bindings: Bind interfaces to implementations for seamless dependency management.
  • Parameters Bag: Access application parameters from memory or environment variables.
  • Factory Bindings: Create services dynamically using factory methods.

📦 Installation

Install from source:

pip install git+https://github.com/ariana126/pydm.git

or PyPI

pip install pydmpro

🚀 Quick Start

An example in your project:

from pydm import ServiceContainer, EnvParametersBag
from dotenv import load_dotenv

class DatabaseConnectionInterface:
    pass
class MySQLConnection:
    def __init__(self, base_url: str):
        self.__base_url = base_url
class Repository:
    def __init__(self, conn: DatabaseConnectionInterface):
        self.__conn = conn

def boot() -> None:
    service_container: ServiceContainer = ServiceContainer.get_instance()

    load_dotenv()
    service_container.set_parameters(EnvParametersBag())

    service_container.bind_parameters(MySQLConnection, {'base_url': 'MYSQL_URL'})
    service_container.bind(DatabaseConnectionInterface, MySQLConnection)

boot()
repository = ServiceContainer.get_instance().get_service(Repository) # Repositoy instance

🧪 Running Tests

pytest

📄 License

This project is licensed under the MIT License – see the LICENSE file for details.


🤝 Contributing

Contributions are welcome!
If you have an improvement or find a bug:

  1. Fork the repo
  2. Create your branch
  3. Submit a pull request

💡 About

pydm is a lightweight dependency management package designed to simplify service container management and parameter handling in Python projects. Originally created by Ariana, it provides tools to maintain clean, scalable architecture and streamline the injection of dependencies and configuration parameters.

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

pydmpro-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

pydmpro-0.1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydmpro-0.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for pydmpro-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2c629bde3d0646942c8fc5e91e73588b735388a6dd8c331e356e200c2ecbce3d
MD5 8cd2979050e2a6c922c595b86235918c
BLAKE2b-256 2f313786036ce2c0b5d7b28b577285c989dd01f6140489dac1ccca24d524e9dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydmpro-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for pydmpro-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e38290f9f90035b49215cff1cf28c9089ced2d4c29dc9e72adbf28e452bd7255
MD5 7883eb2aa3341a4525a96d56ec93ab00
BLAKE2b-256 dc85c7c557005591d774644bf13eb6f7cc20870115a1a22f7594623604ff2f68

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