Skip to main content

Python CLI for the Polr link shortener

Project description

polr

https://img.shields.io/pypi/v/polr.svg https://img.shields.io/travis/kylie-a/polr.svg Documentation Status Updates

Python CLI for the Polr link shortener

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polr_py-0.3.3.tar.gz (12.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page