Probando injection dependency
Librareria para la inyección de dependencias para python
Porqué usarlo ?
Pues esta librerÃa está hecha para proyectos pequeños que no necesiten testear la applicación o que quieran probar la inyección de dependencias
Cómo usarlo ?
Aquà es un ejemplo de inyección de forma global con la librerÃa
from injectdep import global_module
@global_module.register
class MyDB:
def find_all():
return ["Jhon", "Pepe", "Carlos"]
def main(db: MyDB):
results = db.find_all()
print(results) # ["Jhon", "Pepe", "Carlos"]
if __name__ == "__main__":
injected = global_module.inject(main)
injected()
Puede construir su propio módulo
from injectdep import Module
database_module = Module()
@database_module.register
class MyDB:
def find_all():
return ["Jhon", "Pepe", "Carlos"]
def main(db: MyDB):
results = db.find_all()
print(results) # ["Jhon", "Pepe", "Carlos"]
if __name__ == "__main__":
injected = database_module.inject(main)
injected()
Inspirado en AngularModules
Metadata
Release files for injectdep 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| injectdep-0.0.1.tar.gz | 2.4 kB | Without provenance | Details for injectdep-0.0.1.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| injectdep-0.0.1-py3.11.egg | Legacy Egg format | - | - | Details for injectdep-0.0.1-py3.11.egg |
| injectdep-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for injectdep-0.0.1-py3-none-any.whl |
Total release size: 10.1 kB
Release files / injectdep-0.0.1.tar.gz
| Download URL | injectdep-0.0.1.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb9fa7c1b61115d17815d18fcda563204edb1c8d53af4d641c7a6aa64a3c9de9
|
|
BLAKE2b-256 checksum How to use checksums |
9e0fc2a5aedb1c5f31d69d881417027453c20cf1ebcf4610984f3f2c9802add7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Release files / injectdep-0.0.1-py3.11.egg
| Download URL | injectdep-0.0.1-py3.11.egg |
|---|---|
| Size | 4.9 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
a12153ba99f44f00edd3ab2935cd11caa1de9b159472c9ca995c470259d8893c
|
|
BLAKE2b-256 checksum How to use checksums |
167f3a2bd4579a2b301a97da0034050ea3cb9b6de599fb4f4e1253fdf8ce350c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Release files / injectdep-0.0.1-py3-none-any.whl
| Download URL | injectdep-0.0.1-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad86f959e92ad62e36112ab4e6aa062d58e814fb9d06f4d13693d5e877765f5c
|
|
BLAKE2b-256 checksum How to use checksums |
4fffafe7d51739b13680f507678ae538e18b743760bee887a2f6445001019796
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Security for injectdep 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.