Skip to content

Backupchan/client-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backup-chan client configuration

This is the module responsible for the client-side connection configuration.

Installing

# The easy way
pip install backupchan-client-config

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

Usage

from backupchan_config import *

# Uses the default config path if no argument is passed.
# Use Config("/path/to/config.json") to use a custom config path.
config = Config()

try:
    config.read_config()
except ConfigException:
    config.reset()

# Write a new config.
config.host = "http://127.0.0.1"
config.port = 5000
config.api_key = "bakch-123456etc"
config.save_config()

# Use it to connect to the API.
form backupchan import API
api = API(config.host, config.port, config.api_key)
print(api.list_targets())

About

Client-side connection configuration module.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages