pits – Point-In-Time Storage
pits provides Pythonic context-managed file object abstraction for point-in-time file storage. pits supports plain or gzipped files.
pits is listed on PyPI.
Writing
my_data = grab_my_data(...)
# write to plain file
with open('my-data.txt', 'w+') as f:
f.write(my_data)
# write to gzip file
import gzip
with gzip.open('my-data.gz', 'wb') as f:
f.write(my_data)
# write to point-in-time file
import pits
with pits.open('my-data', 'wb', gzip=True) as f:
f.write(my_data)
# write as if we're at another point in time
with pits.goto('20220101-1200').open('my-data', 'wb', gzip=True) as f:
f.write(my_data)
Reading
import pits
# read latest file
with pits.open('my-data') as f:
f.write(my_data)
# read latest file as if we're at another point in time
with pits.goto('2022-12-18 15:00').open('my-data') as f:
f.write(my_data)
Datetime format
- Timestamp format for file name is
%Y.%m.%d-%H:%M:%S. - All non-numeric characters are omitted in timestamp parsing, e.g.,
2022-12-18 15:00is transformed to202212181500before parsing. - All timestamps are local.
20221218is recognized as2022-12-18 23:59:59, but20221218-1500is recognized as2022-12-18 15:00:00.
Metadata
Release files for pits 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pits-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Release files / pits-0.1.2-py3-none-any.whl
| Download URL | pits-0.1.2-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba7e7cc9b758e5e89ffe79a047a111896e9ea9283d917d02ae997b15429f21ec
|
|
BLAKE2b-256 checksum How to use checksums |
17f439aedecc2a056548858349436bcdfd12c3f8cbae68e7042079068d643925
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Security for pits 0.1.2
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.