Skip to main content

API wrapper for the SnipLink API provided by SnipLink.

Project description

SnipLink Py

Build status GitHub issues

An API wrapper for SnipLink written in Python.
Official SnipLink API docs found here.

All aspects of the v1 endpoint are currently implemented.


Installation

Install the package using pip as follows

pip install sniplink

and now you are ready to go!


Usage

For example,

  • Information on a shortlink can be retrieved as such:
# first of all, importing the library, in order to
# access functions provided by the library
import sniplink

# sniplink-py is powered by a backend client
# here we creates a new instance of client
client = sniplink.Client()

# get_link takes one parameter,
# public_id, that is the id of shortened link you want to fetch
client.get_link("123")
  • creation of a shortlink can be done as follows:
# first of all, importing the library, in order to
# access functions provided by the library
import sniplink

# sniplink-py is powered by a backend client
# here we creates a new instance of client
client = sniplink.Client

# create_link takes two parameters, 
# expires_in value, that is a unix timestamp
# url value, that is the url you want to shorten
client.create_link(1627168204, "https://example.com")

Have a look at the samples provided for further usage instructions.

You can find a list of endpoints over on SnipLink's API docs. Each of these endpoints has an equivalent wrapper method in the library.

Requirements

> pip install requests

License

This project is available under a MIT license.

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

sniplink-1.0.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sniplink-1.0.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

Supported by

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