Skip to main content

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.

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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page