New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

persisted

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

persisted

A two-way data persistence framework for watching file changes / updating files based on changes

  • 1.0.0b2
  • PyPI
  • Socket score

Maintainers
1

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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc