Python CLI for the Polr link shortener
Project description
polr
Python CLI for the Polr link shortener
Free software: MIT license
Documentation: https://polr.readthedocs.io.
Features
TODO
CLI Usage
polr [OPTIONS] COMMAND [ARGS]...
Commands for using the Go link shortening service.
Options:
--help: Show this message and exit.
Commands:
exists: Check to see if a link with the given ending already exists.
shorten: Shorten a link with the option to give it a custom ending.
shorten
Usage:
polr shorten [OPTIONS] URL
Shorten a link with the option to give it a custom ending. Checks to see if a link with the given ending exists. Can be configured to fail if it already exists with [-f|--fail].
polr shorten URL [(-e|--ending=)ending] [(-f|--fail)]`
Examples:
# Use default ending
$ polr shorten https://example.com
http://polr.example.com/ad14gfwe
# Use custom ending, if ending already exists don't return error, return link with that ending.
polr shorten https://example.com -e my-custom-ending
http://polr.example.com/my-custom-ending
# Use custom ending, return error if it already exists.
polr shorten https://example.com -e my-custom-ending -f
ERROR: link with ending my-custom-ending already exists
echo "$?"
1
Options:
-e, --ending TEXT A custom ending for the shortened link.
-f, --fail Return an error if a link with the desired custom ending already exists
--help Show this message and exit.
#### exists
Usage:
polr exists [OPTIONS] ENDING
Check to see if a link with the given ending already exists. Exits with status code 1 if it exists
Examples:
# Doesn't exist
$ polr exists my-new-ending
False
$ echo "$?"
0
# Exists
$ polr exists my-existing-ending
True
$ echo "$?"
1
Options:
--help: Show this message and exit.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2018-12-12)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file polr_py-0.3.3.tar.gz
.
File metadata
- Download URL: polr_py-0.3.3.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
499fa439559df9bb295631373b876e04a9cb4fd8d667feceb96934bb0ec9de49
|
|
MD5 |
12a23c8773229635ada37f0c552c7366
|
|
BLAKE2b-256 |
acd86ee145c2555578bdcd1d99b7e18f35f2208fe9868e7fd8745d4c41f6526a
|