API wrapper for the SnipLink API provided by SnipLink.
Project description
SnipLink Py
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
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
sniplink-1.0.0.tar.gz
(4.3 kB
view details)
Built Distribution
File details
Details for the file sniplink-1.0.0.tar.gz
.
File metadata
- Download URL: sniplink-1.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb13dc7fa6d506a9e662b242cee77085caf42efef53f404b2288bbbf00f1e663 |
|
MD5 | 6583c2437c8e1d77200bb4a36e758d9e |
|
BLAKE2b-256 | cf67bf32e06bf4142e0a1b223087dd870fd4fc360100dc4a476b6043720db1fb |
File details
Details for the file sniplink-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: sniplink-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7798c844ab93bcda6b3210ecda3399bcfa28f39a7e66f42c2eff89de96cbd472 |
|
MD5 | d547778c7cb3b2546d0e2a305b4575c6 |
|
BLAKE2b-256 | 6ca5b5c2358a8d655a048840eb8284c42f9e8ff49f849f98bf55015546729e70 |