Skip to main content

Dependency Injection Library

Project description

Fast Dependency

Installation

pip install fastdependency

Usage

from fastdependency import Depends, inject


def username() -> str:
    return 'mahdi'


def password() -> str:
    return '123***456'


@inject
def my_function(
        param: int,
        username: str = Depends(username),  # Gets it from function.
        password: str = Depends(password),  # Gets it from container.
):
    print(param)
    print(username)
    print(password)


my_function(12)

TODO

  • Full Docs
  • Precommit

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

fastdependency-0.2.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

fastdependency-0.2.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file fastdependency-0.2.0.tar.gz.

File metadata

  • Download URL: fastdependency-0.2.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.1 Linux/6.2.0-36-generic

File hashes

Hashes for fastdependency-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7e9a0840df2535a9737f660ac5ea72e7e17c81a0339b8439a07057fe8553307b
MD5 cde1d324b795d6381e96fe6c3ac12dc9
BLAKE2b-256 3b881b23c78c114c2f0514f93f2561359f999d55e8900106bc39e64e3fd27d95

See more details on using hashes here.

File details

Details for the file fastdependency-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fastdependency-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.1 Linux/6.2.0-36-generic

File hashes

Hashes for fastdependency-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 990aedddbe3efc4645df7900c7d914cee2ce682e67fdf03e08d287d92360a329
MD5 6a99cc9f1a0dfa28c742a95b306c0f66
BLAKE2b-256 6736f2ef30a6038dc718ed7dd32e4f196764963469a923f3067eb02d646d0a39

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page