Metadata-Version: 2.1
Name: autosave
Version: 1.0.0.post1
Summary: Autosaving dictionary-like file objects
Home-page: https://gitlab.com/deepadmax/autosave
Author: Maximillian Strand
Author-email: maximillian.strand@protonmail.com
Requires-Python: >=3.9,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: appdirs (>=1.4.4,<2.0.0)
Description-Content-Type: text/markdown

# autosave

## Installation

```sh
pip install autosave
```

## Example

```py
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'
```
