Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Persisted

Persisted is a two-way code/data persistence framework. It can update a variable when a watched file changes, and also save data back to the file when the variable changes.

>>> import persisted
>>> data = persisted.as_string('README.md', '')
>>> data.get()
"# Persisted\n\nPersisted is a two-way..."
>>> with data:
        data.value = "Change to this"
>>> data.get()
"Change to this"

This is very useful to keep configuration files / application state synchronized within a long-running application, and also hot-reload code / modules.

Installing

$ python -m pip install persisted

Usage

There are several helper functions for you to get started:

  • persisted.as_bytes
  • persisted.as_string
  • persisted.as_pickle
  • persisted.as_module (only reloading)

All of them call persisted.Persisted to create a Persisted object to interact with.

Release files for persisted 1.0.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for persisted 1.0.0b2
File Size Uploaded
persisted-1.0.0b2.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for persisted 1.0.0b2
File Interpreter ABI Platform
persisted-1.0.0b2-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / persisted-1.0.0b2.tar.gz

Download URL persisted-1.0.0b2.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3fff963a6ee368602e46b3bcf00933bddc324878bc64d822be1164356a55317e
BLAKE2b-256 checksum
How to use checksums
4e63d0b55e591d7e0b139dc8103c6f8c50350d7e4aaf82f235d6f29c5d77daee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.3

Release files / persisted-1.0.0b2-py3-none-any.whl

Download URL persisted-1.0.0b2-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
228f43735c4b6f32f16c1a4ebb81e29641588b69963ff880243c291b0f000adb
BLAKE2b-256 checksum
How to use checksums
c9f6768ae6880e2f4ca802dcc7495cc9d07f66e4c62423847165f970771b776b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.3

Release history Release notifications | RSS feed

This release

1.0.0b2 This release

2 release files

1.0.0b1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page