Sashimono
Tiny, explicit dependency injection for Python.
Sashimono is a minimal DI container with zero dependencies. Use it to wire values, factories, and classes with predictable singleton and transient behavior.
Quick start
from sashimono import container, singleton, transient
class Foo:
def __init__(self, number):
self.number = number
c = container()
c["number"] = singleton(5)
c[Foo] = transient(lambda c: Foo(c["number"]))
print(c[Foo].number)
# 5
Key ideas
container()behaves like a dictionary of providerssingleton(x)caches one instancetransient(x)returns a fresh value each time- raw values are wrapped as singletons automatically
- keys can be strings or types
Scoped wiring
Use scope to isolate temporary bindings:
from sashimono import scope, provide, inject
with scope():
provide("user", "alice")
print(inject("user"))
Why use Sashimono?
- tiny API, easy to understand
- explicit wiring instead of magic
- no external dependencies
- useful for small apps, scripts, and portable libraries
Happy coding! 👋
Metadata
Release files for sashimono 2.0.0
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 |
|---|---|---|---|---|
| sashimono-2.0.0.tar.gz | 4.5 kB | Without provenance | Details for sashimono-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sashimono-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for sashimono-2.0.0-py3-none-any.whl |
Total release size: 9.0 kB
Release files / sashimono-2.0.0.tar.gz
| Download URL | sashimono-2.0.0.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fd4506248cf063acfa0ef5089bc043e2c8525cb1ec12a0f0373f5bef0bdce88
|
|
BLAKE2b-256 checksum How to use checksums |
5bdc358d5330ef600bbacc51992fc20452c5a7deeeeee864f4b083ab554c44fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / sashimono-2.0.0-py3-none-any.whl
| Download URL | sashimono-2.0.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78c96bf3b8166daed9f078da5df0f620d0f7df695c0e682d7cbf563d95e1c6c7
|
|
BLAKE2b-256 checksum How to use checksums |
0d7ad181b3cc9ba53e9c931881d6e863b5f3a00864ad15681585ab83487b1f71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Security for sashimono 2.0.0
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.