Skip to content

Client library for accessing the Backup-chan server

License

Backupchan/client-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backup-chan client library

PyPI - License PyPI - Python Version PyPI - Version

This is the Python library for interfacing with a Backup-chan server.

Installing

# The easy way
pip install backupchan-client-lib

# Install from source
git clone https://github.com/Backupchan/client-lib.git backupchan-client-lib
cd backupchan-client-lib
pip install .

For instructions on setting up the server, refer to Backup-chan server's README.

Testing

pytest

Example

from backupchan import *

# Connect to a server
api = API("http://192.168.1.43", 5000, "your api key")

# Print every target
targets = api.list_targets()
for target in targets:
    print(target)

# Create a new target
target_id = api.new_target(
    "the waifu collection", # name
    BackupType.MULTI,
    BackupRecycleCriteria.AGE,
    10, # recycle value
    BackupRecycleAction.RECYCLE,
    "/var/backups/waifu", # location
    "wf-$I_$D", # name template
    False, # deduplicate
    None # alias
)
target = api.get_target(target_id)
print(f"Created new target: {target}")

About

Client library for accessing the Backup-chan server

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages