Autosaving dictionary-like file objects
Project description
autosave
Installation
pip install autosave
Example
from autosave import File, AppStorage
# When editing multiple entries,
# use a with statement to only save on exit.
with File('my_file.json') as data:
data['dessert'] = 'pancakes'
data['genre'] = 'jazz'
# By indexing entries on their own, the file is saved on each edit.
# This is adviced against if you're editing multiple entries at a time,
# as it is much less performant.
file = File('my_file.json')
file['garbage'] = 'smooth' + file['genre']
# Get access to the right directories for your app,
# by using this wrapper around `appdirs`
app = AppStorage('MyApp')
app.data / 'plugins/baguette.json'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
autosave-1.0.0.post1.tar.gz
(3.0 kB
view details)
Built Distribution
File details
Details for the file autosave-1.0.0.post1.tar.gz
.
File metadata
- Download URL: autosave-1.0.0.post1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.10 CPython/3.9.7 Linux/5.10.68-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e407b55724a72c86a03cc9ed0e0b9b38bb24d1c3b36f3d89649ba1a187fbd26 |
|
MD5 | 22dd3d1ea3510f48416940591b569f39 |
|
BLAKE2b-256 | 92108fb4a1b3ac47bc5e98fd6454e2a2b37bcfea9751595b8e1dd2370cf7375e |
File details
Details for the file autosave-1.0.0.post1-py3-none-any.whl
.
File metadata
- Download URL: autosave-1.0.0.post1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.10 CPython/3.9.7 Linux/5.10.68-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2692aba7b9f34cb1ddcd4cad8282888975f9fb53143a8c6dc90a8cf07bc500f3 |
|
MD5 | 1afb2c8bb1bbb3cdcc7cc4a32c58fde8 |
|
BLAKE2b-256 | 905dc8eb7609909364730c3f1c58baeeebbd67063df65d32ae5e0e826fbbb4d6 |