Skip to main content

A simple library for the pastebin API

Project description

gluelib

This is a simple library for interacting with the pastebin API. The code is fairly simple and self-documenting, and all other information needed is contained within this file. Install with pip3 install gluelib.

(It's called gluelib because pastelib was taken)

Terminology

Session Keys

When using this library, the first thing to do is generate a session key. This is what you will use instead of a username and password. Call getSessionKey with your pastebin username, password, and developer key, and you will receive a session key. This is used in all future API calls. Keep it in memory, and generate a new one for every session. You do not need to use your username and password again.

Paste Keys

These are the parts of a pastebin URL that identify a specific paste. (e.g. zvwcdXyn in https://pastebin.com/zvwcdXyn)

Functions

getPaste(pasteKey, sessionKey, devKey)

Returns the text of a paste given the above parameters.

makePaste(pasteName, pasteText, sessionKey, devKey, expiryDate = "N", privacy = "0")

Uploads a paste to pastebin with the above parameters. See the pastebin API page for more detail.

deletePaste(pasteKey, sessionKey, devKey)

Deletes a paste given the above parameters.

listUserPastes(sessionKey, devKey, resultsLimit=50)

Returns information about your pastes in XML format. Will only display last resultslimit results.

getUserData(sessionKey, devKey)

Returns information about your user profile in XML format.

getSessionKey(username, password, devKey)

Returns a session key when given a pastebin username, password, and developer key. See the section on session keys for more.

outputBytesToString(outputBytes)

This function formats a response from the pastebin API. It removes the prefix and suffix bytes, converts the response to a string, and returns it. All other functions in this library pass their output through it. You do not need to use this function in your code.

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

gluelib-1.2.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

gluelib-1.2.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file gluelib-1.2.1.tar.gz.

File metadata

  • Download URL: gluelib-1.2.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for gluelib-1.2.1.tar.gz
Algorithm Hash digest
SHA256 3258b6eaafaa096a410bc613c115f633e97c3322e9231a2dddfc0b5f3314537a
MD5 2f2fb124deb349f42bd59b98b8406b77
BLAKE2b-256 0f724c5b8d866d40504eb9c2023bf69f22e4405d56b4cb723f2fb7f66c17873a

See more details on using hashes here.

File details

Details for the file gluelib-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: gluelib-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for gluelib-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a07ddc03cd8a154fbe9ef34c0710bcce54127eba7d055f88ee9e489d204b725f
MD5 0f2fdbe124e8a70dd57aad298666b39b
BLAKE2b-256 0a163c7657caed75f559a830a4f90565dd10ee39604ebabe577e7f87125f4816

See more details on using hashes here.

Supported by

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