Metadata-Version: 2.4
Name: backupchan-presets
Version: 0.2.0
Summary: Presets library for Backup-chan.
Author-email: Moltony <koronavirusnyj@gmail.com>
License: BSD-3-Clause
Project-URL: Homepage, https://github.com/Backupchan/presets
Project-URL: Repository, https://github.com/Backupchan/presets.git
Project-URL: Issues, https://github.com/Backupchan/presets/issues
Project-URL: Changelog, https://github.com/Backupchan/presets/blob/main/CHANGELOG.md
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: System :: Archiving :: Backup
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: backupchan-client-lib>=1.1.0
Dynamic: license-file

# Backup-chan presets

This is a library for creating presets for backups. A preset allows to define the destination target and what file on the system to upload, under a unique name.

## Installing

```bash
# The easy way
pip install backupchan-presets

# Installing from source
git clone https://github.com/Backupchan/presets.git backupchan-presets
cd backupchan-presets
pip install .
```

## Testing

```
pytest
```

## Example usage

```python
from backupchan_presets import Presets
from backupchan import API

api = API("host", 8000, "api-key")

# Create a new preset.
presets = Presets()
presets.add("myPreset", "00000000-0000-0000-0000-000000", "/home/me/Documents/stuff")
presets.save() # Save it into the configuration file.
presets["myPreset"].upload(api, False)

# Or load existing presets from a file.
presets.load()
presets["anotherPreset"].upload(api, False)
```
