Quickly store arbitrary Python objects in unique files.
Project description
quickdump
Quickly store arbitrary Python objects in local files.
Library status - this is an experimental work in progress that hasn't been battle-tested at all. The API will change often between versions, and you may lose all your data due to silly bugs.
Features
- Store arbitrary objects locally
- No config or boilerplate required
- Dump to TCP server
- Dump to HTTP server
Notes
(todo - rewrite this in a coherent manner)
- Currently, compression is applied per call to
dump
. This isn't very efficient (probably?) - Labels are slugified to prevent errors from invalid characters in the filename
Quickly dump (almost) any object you like:
from quickdump import qd, QuickDumper
from decimal import Decimal
for i in range(10):
result = Decimal(i) ** Decimal("0.5")
qd(result)
And use them whenever it's convenient later:
for obj in qd.iter_dumps():
print(obj) # 0
# 1.000000000000000000000000000
# 1.414213562373095048801688724
# ...
Dump objects assigning a label, or create a dumper with a pre-configured label:
qd("Armação", "Campeche", "Solidão", label="beaches")
beach_dumper = QuickDumper("beaches")
beach_dumper("Morro das Pedras", "Açores", "Gravatá")
Iterate over multiple labels (including the default):
for obj in qd.iter_dumps("beaches", "default_dump"):
print(obj)
Iterate only over objects that match some filter:
def filter_initial_a(obj):
return not obj.startswith("A")
for obj in qd.iter_dumps("beaches", filter_fun=filter_initial_a):
print(obj) # Campeche
# ...
Someday™
- Enable simple serialization of unpicklable types (e.g. save a
socket
type property of some object assocket
's string representation instead of just ignoring the object) - Quickdump by piping from shell
- Function decorator able to log function inputs and/or outputs
- Real time visualization of dumped data and metadata
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
Built Distribution
File details
Details for the file quickdump-0.5.0.tar.gz
.
File metadata
- Download URL: quickdump-0.5.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.0 Linux/5.13.0-7614-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f41faa182f189c749b14eb95d4bd6bff41aca5ae850b9394b373943e1d82088c |
|
MD5 | 22d8ed7606d3e5ee209831d0fc2bc0dc |
|
BLAKE2b-256 | 9844195c47abbba26eb1575519a0409b3a49522bcce9a1d08f22503d77660649 |
File details
Details for the file quickdump-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: quickdump-0.5.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.0 Linux/5.13.0-7614-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39f742fe4d6f0559be2c1ee1bf08371b2d591878b210423093393957e6436ab9 |
|
MD5 | 1263a84624c3759b614123d2e7ee6651 |
|
BLAKE2b-256 | e05f1973f9691bc43bacf3a5dc70ce638aed8e4673caaca6d4387724020a15ff |