* Split wheel and tarball dist into separate make cmds * Add build for amd64 & arm64 arch + start of publish steps * test step indentation fking with lint * add missing pipenv command * test explicitly defining wheel version * try install requirements first * sync pipenv after install * fixed typo in pacakge name * Publish depends on build * Install python dependencies before publish * Twince check command before upload * If source is newer than pypi, exit 0 and continue pipeline * If source is newer than pypi, exit 0 and continue pipeline * Clearer output text for publish version * Clearer output text for publish version * Only run public package when interacting with master * Updated readme and license in setup.py * Remove test pypi publish ci step * Exclude publish step when PR towards master * Bumped package version to 0.3.2 * Try install built wheel with wildcard * Sign drone config file View docs for more info on signing: https://docs.drone.io/signature/
7.1 KiB
🐍 Python Deluge CLI
A easy to use Deluge CLI that can connect to Deluge RPC (even over ssh) written entirely in python.
| Tested version | PyPi package | License |
|---|---|---|
| Drone CI | Known vulnerabilities |
|---|---|
Abstract • Install • Usage • Setup Virtual Environment • Configure • Contributing
Abstract
Create a deluge python client for interfacing with deluge for common tasks like listing, adding, removing and setting download directory for torrents.
Install
Install from source:
python3 setup.py install
Install from pip:
pip3 install delugeClient-kevin
Usage
View delugeClient cli options with delugeClient --help:
Usage: python -m delugeclient [OPTIONS] COMMAND [ARGS]...
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --debug Set log level to debug │
│ --info Set log level to info │
│ --warning Set log level to warning │
│ --error Set log level to error │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or customize the installation. │
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ add Add magnet torrent │
│ disk Get free disk space │
│ get Get torrent by id or hash │
│ ls List all torrents │
│ remove Remove torrent by id or hash │
│ rm Remove torrent by name │
│ search Search for string segment in torrent name │
│ toggle Toggle torrent download state │
│ version Print package version │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Setup Virtual Environment
Virtual environment allows us to create a local environment for the requirements needed. Because pip does not download packages already downloaded to your system, we can use virtualenv to save our packages in the project folder.
Installation
To install virtualenv, simply run:
$ pip install virutalenv
Virtualenv setup
After you have downloaded this project go to it in your terminal by going to the folder you downloaded and typing the following:
$ cd delugeClient/
The to setup a virtual environment enter this:
$ virtualenv -p python3.10 env
If you get an error now it might be because you don't have python3.10, please make sure you have python version 3.10 if else you can download it from here
Then we use the virtualenv command to create a env subdirectory in our project. This is where pip will download everything to and where we can add other specific python versions. Then we need to activate our virtual environment by doing:
$ source env/bin/activate
You should now see a (env) appear at the beginning of your terminal prompt indicating that you are working from within the virtual environment. Now when you install something:
$ pip install <package>
It will get installed in the env folder, and not globaly on our machine.
The leave our virtual environment run:
$ deactivate
Configure the Config File
The following is where we need to do some manual editing of our config file. Open to config.ini in your favorite text editor.
$ (vi) config.ini
Then you need to change the HOST and PORT to reflect the address for your deluged client. The username and password needed to connect can be found under:
(Only tested on ubuntu)
$ cat /home/USER/.config/deluge/auth
Contributing
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request