Hastebin API
Version 0.1.3 Patch In this version, the function names were fixed from using "Paste" to "Haste". Along with this, errors were properly added.
This is a simple Hastebin API that allows you to create pastes (or "hastes") and get raw text from a haste through code. It is extremely simple to use and doesn't require much setup, allowing it to be extremely simple to use.
** Instructions/Setup **
- Install the package by running
pip install HastebinAPIin your console. - Once installed, add
from Hastebin import Hastebinto the top of your code. - Once imported, use any of the functions freely throughout your code.
Code Example:
from Hastebin import Hastebin
# your code here
** Functions **
This API has been designed for ease-of-use, allowing for creation and retrieval of hastes through one line of code. Currently, the API has two functions.
** Creating Hastes **
Once imported, you can use the "Hastebin.CreateHaste("text")" function to create a paste with the inputted text. This will create a haste and return the raw URL to that haste (or, the ID of that paste depending on the arguments provided.) The function can be called to return values as well as called raw.Returning Values:
link = Hastebin.CreateHaste("Demo") and print(Hastebin.CreateHaste("Demo"))
Raw:
Hastebin.CreateHaste("Demo")
Arguments
The Hastebin.CreateHaste() function takes three arguments.
Content:
The first argument, known as content, is a string value of which is required. This argument is the only required argument, and its name does not need to be specified in the function. Anything within this argument will be sent as the content of the haste. An example of this argument is as provided below:
link = Hastebin.CreateHaste("This is a test of the Hastebin Python API.")
Print:
The second argument, known as print, is a bool value of which is not required. It specifies if you would like to automatically print the URL (or ID depending on the third argument) of the created haste once it has been created. It can be useful in cases where the function is called raw. This argument is by default set to False, so don't worry about specifying it if you want it to be False. This argument will be ignored if it is set to an invalid value (ex. a string or int). An example of this argument is provided below:
link = Hastebin.CreateHaste("This is a test of the Hastebin Python API", print=True)
FullURL:
The third argument, known as FullURL, is a bool value of which is not required. It specifies if you would like the function to return (or print depending on the second argument) the full URL of the haste or just the ID. This argument is by default set to True, so if you would like to only return the haste ID, you will need to manually specify. This argument will be ignored if it is set to an invalid value (ex. a string or int). An example of this argument is provided below:
link = Hastebin.CreateHaste("This is a test of the Hastebin Python API", fullurl=False)
Or, as used with the print argument:
link = Hastebin.CreateHaste("This is a test of the Hastebin Python API", print=True, fullurl=False)
** Retrieving Hastes **
Once imported, you can use the `Hastebin.GetPaste("id/url")` function to get the raw text from a haste.Returning Values:
link = Hastebin.GetHaste("id/url") and print(Hastebin.GetHaste("id/url"))
Raw:
Hastebin.GetHaste("id/url")
Arguments
The Hastebin.GetHaste("id/url") function takes two arguments.
Paste: The first argument, known as Paste, is a string value of which is required. This argument is the only required argument, and its name does not have to be specified in the function. This argument specifies the haste that content should be retrieved from. The haste can be specified through a hastes ID (ex. suxemamamo) or a hastes URL (ex. https://hastebin.com/suxemamamo.kotlin). The argument can take both regular and raw hastebin links to retrieve content from, and can also take multiple forms of haste URLs/IDs. Examples are shown below:
• URL: https://hastebin.com/suxemamamo.kotlin • URL: https://hastebin.com/suxemamamo • URL: http://hastebin.com/suxemamamo • URL: hastebin.com/suxemamamo • URL: https://hastebin.com/raw/suxemamamo • URL: http://hastebin.com/raw/suxemamamo • URL: hastebin.com/suxemamamo ... and various other URL combinations.
• ID: suxemamamo.kotlin • ID: suxemamamo ... and various other ID combinations.
Print:
The second argument, known as print, is a bool value of which is not required. It specifies if you would like to automatically print the raw text of the retrieved haste once it has been retrieved. It can be useful in cases where the function is called raw. This argument is by default set to False, so don't worry about specifying it if you want it to be False. This argument will be ignored if it is set to an invalid value (ex. a string or int). An example of this argument is provided below:
link = Hastebin.GetHaste("suxemamamo", print=True)
** Hastebin Information **
The following information is as quoted on Hastebin.com: > While the contents of hastebin.com are not directly crawled by any search robot that obeys "robots.txt", there should be no great expectation of privacy. Post things at your own risk. Not responsible for any loss of data or removed pastes. > Pastes will stay for 7 days. They may be removed earlier and without notice.View at https://hastebin.com/about.md.
** Update Information **
Updates to this package may include bug fixes (patches), updates to features, new features, major updates, and redistribution. This package contains no update schedule.** Redistribution Information **
Redistribution of this package should only be done by the official developer, known as and going by Alternate/AlternateD/TCK. If this package should not be updated in long periods of time, it should be noted that the most likely cause is the loss of the hosting account representing this package. In that event, a redistribution will be created on a new account that will be updated. It is up to the user to find this new version.This package provides, reads, and serves content from hastebin.com, and not any other unofficial Hastebin websites.
Metadata
Release files for HastebinAPI 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| HastebinAPI-0.1.3.tar.gz | 4.7 kB | Without provenance | Details for HastebinAPI-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| HastebinAPI-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for HastebinAPI-0.1.3-py3-none-any.whl |
Total release size: 9.6 kB
Release files / HastebinAPI-0.1.3.tar.gz
| Download URL | HastebinAPI-0.1.3.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49bc34796888d2dc0b4d9382a0c5c9af89bf142d540a16da82272a7687478ae2
|
|
BLAKE2b-256 checksum How to use checksums |
73a0f893301d45562841828af5df37e6e206f3cf59da3ef258c78d23fee492c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.6
|
Release files / HastebinAPI-0.1.3-py3-none-any.whl
| Download URL | HastebinAPI-0.1.3-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c05ffb9142d92f22e6f2330c7528e997cf47fb08eb2a48e4808e0353b4d61ee1
|
|
BLAKE2b-256 checksum How to use checksums |
ae48c019aa7eec931e9fa6afbbde9591d5f3c7434fd49e8ae59a10621083873c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.6
|
Security for HastebinAPI 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.