An ultra-lighweight document oriented database
Piuma is a lightweight Python library that provides a simple document-oriented interface layer with pluggable storage backends. Piuma is designed around a minimal and flexible core that makes it easy to:
- work with structured and document-like data
- swap or extend storage implementations
- build custom database behaviors
Out of the box, Piuma can be used as a small memory or file backed document store. However, its primary design goal is to serve as a foundation for building more complex or specialized database systems. Piuma has three core structural principles: minimal design, extensibility, compositional architecture.
- Github: https://github.com/emit07/piuma
- Documentation: https://piuma.readthedocs.io/
- PyPi: https://pypi.org/project/piuma
Piuma works well in situations where you want a lightweight and embeddable data layer.
- Building prototypes or experimental data systems
- Adding simple document storage to Python applications
- Creating a custom persistence layer without adopting a full database
- Flexibility in rapid development
- Testing environments
Piuma is on PyPi and can be installed with PyPi:
$ pip install piuma
Piuma can also be installed by cloning the Github repository and using:
$ pip install .
Once installed, you can setup Piuma and insert your first Document.
from piuma import Piuma
piuma = Piuma()
piuma.insert({"name": "Che Guevara", "age": 39})Piuma is designed so storage can be swapped or extended.
from piuma.storage import JSONStorage
from piuma import Piuma
storage = JSONStorage("data/db.json")
db = Piuma(storage=storage)Custom storage backends can be implemented by extending Storage.
Piuma (‹più·ma›) is the Italian word for feather, which reflects the design goals.
