bottle_argsmap
Auto inject arguments via a dict like pattern.
Usage
from bottle import Bottle
from bottle_argsmap import ArgsMapPlugin
app = Bottle()
plugin = try_install(app)
# inject via singleton
plugin.set_value('value', '1544')
# or inject via factory, dynamic creation is allowed
# e.g. you can to inject database connection from a database pool
plugin.set_factory('value',
lambda param_name, route: ...,
context_manager=True, # auto call `__exit__` on the value after responsed
)
# finally, inject it
@app.get('/path')
def get_it(value): # value is injected
return dict(value=value)
More
ArgsMapPlugin().ioc is a instance of type anyioc.ServiceProvider, which means you can use all features from anyioc.
Metadata
Release files for bottle-argsmap 0.1.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 | |
|---|---|---|---|---|
| bottle-argsmap-0.1.1.tar.gz | 3.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bottle_argsmap-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 kB
Release files / bottle-argsmap-0.1.1.tar.gz
| Download URL | bottle-argsmap-0.1.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d257f7d250c855b9df75cdd450e4153956c537e697a8846e834dbe5e8363c5a4
|
|
BLAKE2b-256 checksum How to use checksums |
10fdd38a2d78aef064327f0b5f3749118c9ee4752463e02f90ccb9b87fd86d01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.7 CPython/3.9.6 Windows/10
|
Release files / bottle_argsmap-0.1.1-py3-none-any.whl
| Download URL | bottle_argsmap-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
14954e10d8be0a275f3f6ec571fa7421abda796e7151de4adeee44fee832c90c
|
|
BLAKE2b-256 checksum How to use checksums |
67982859e55e680620adb9ae1ccaab7998ad0ccc1e5ec97593f752a6cb059fe1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.7 CPython/3.9.6 Windows/10
|
Security for bottle-argsmap 0.1.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.