Skip to main content

This is a library for accessing pastebin easly. Also pastelib was token

Project description

Pastebinlib

By TheDiamondOG Source Code: https://github.com/thediamondog/pastebinlib

A small python library made for interacting with Pastebin

Story

This was one of those small projects I would just make while I am in class, normally I would just make a multi tool, but this time I wanted to add in Pastebin support which is why I made Pastebinlib. It was meant to be for that small project on Replit, but I thought this is a pretty useful tool, so I wanted to make it public on GitHub.

This was originally made on November 13, 2023. The thing is that I forgot to upload it for 4 days so the whole thing released on GitHub on November 13, 2023.

8 months later I got bored and wanted to upgrade the project, so after releasing fake terminal I worked on this. So now Pastebinlib is now better, and I actually know how to get something on PyPi.


Install

Source

This is only if you want to run it straight from source

git clone https://github.com/TheDiamondOG/pastebinlib
python setup.py install

PyPi (Not out yet)

This is from PyPi the best way to get it

pip install pastebinlib

Documentation

Normal Pastebin API

Requirements \

Setting up the library to use the API wrapper

import pastebinlib

pastebin = pastebinlib.Pastebinlib(api_key)

This is how you create a paste in Pastebinlib

Requirements

  • Text
  • Paste Name
  • Privacy
  • Paste Format
  • Expiring Time

Privacy Option

  • public
  • unlisted
  • private

Expire options

  • never
  • 10 minutes
  • 1 hour
  • 1 day
  • 1 week
  • 2 weeks
  • 1 month
  • 6 months
  • 1 year
import pastebinlib

pastebin = pastebinlib.Pastebinlib(api_key)

"""
First is the text
Second is the name
Third is the privacy
Fourth is the paste format
Last is the expiring time
"""

pastebin.create_paste("Your Text", "Your Paste Name", "public", "text", "never")

This is how to get the data from a paste

Requirements

  • URL/Paste ID
  • JSON <True/False>
import pastebinlib

pastebin = pastebinlib.Pastebinlib(api_key)

"""
First is the URL/Paste ID
Second is using to say if the paste is in the json format <True/False>
"""

pastebin.get_paste("https://pastebin.com/raw/Fj8dsgCR", False)

This is how to get the id of a paste for some reason

All you need is the URL

import pastebinlib

pastebin = pastebinlib.Pastebinlib(api_key)

"""
Input the url
"""

pastebin.get_paste_id("https://pastebin.com/raw/Fj8dsgCR")

User Pastebin API

Setting up the the class for the User Pastebinlib

Requirements for this one

import pastebinlib

userbin = pastebinlib.User(api_key, user_key, username, password)

This is how to list pastes under the account returns a list Optional

  • Limits (50 is default)
import pastebinlib

userbin = pastebinlib.User(api_key, user_key, username, password)

pastes = userbin.list_pastes(limit=50)

This is how you delete a paste

Requirements

  • URL/Paste
import pastebinlib

userbin = pastebinlib.User(api_key, user_key, username, password)

userbin.delete_paste(url)

Get the user info return your user info in a JSON format

import pastebinlib

userbin = pastebinlib.User(api_key, user_key, username, password)

userbin.get_user_info()

This is how to get the data from a private paste

Requirements

  • URL/Paste ID
  • JSON <True/False>
import pastebinlib

pastebin = pastebinlib.Pastebinlib(api_key)

"""
First is the URL/Paste ID
Second is using to say if the paste is in the json format <True/False>
"""

pastebin.get_paste("https://pastebin.com/raw/Fj8dsgCR", False)

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

pastebinlib-1.1.1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

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

pastebinlib-1.1.1-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file pastebinlib-1.1.1.tar.gz.

File metadata

  • Download URL: pastebinlib-1.1.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pastebinlib-1.1.1.tar.gz
Algorithm Hash digest
SHA256 2fe71992a0e37e34a6dc190c4abffe4bc7db2fa675a94ab93cbffd928345203f
MD5 ff4608da0ccdf1cddac1d6e0a7d34d07
BLAKE2b-256 ea463e53ae32756c950b0dae3520e9f13ecf44e85301dafd7ad2cda39be6d51a

See more details on using hashes here.

File details

Details for the file pastebinlib-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: pastebinlib-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pastebinlib-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c0e76d3428c916876a06287d999d480573e42ee19a3eccfa8e134552a830fe9f
MD5 ca7425098f7af5c60696e984f81cf4fc
BLAKE2b-256 8a09d322c2c12bcd4e0b65aeb3a7c67df8107d8e16ce7acc204d71f74ff3c172

See more details on using hashes here.

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