A Pastebin API Wrapper for Python
Project description
# Pastebin API wrapper for Python (pbwrap)
>**Python API wrapper for the Pastebin Public API.
Lifetime pro endpoints are not yet supported!**
**Only _Python 3_ supported!**
## Documentation
This wrapper is based on **Pastebin** API read their Documentation [**here.**](https://pastebin.com/api)
for extra information and usage guide.
### Usage
Import and instantiate a Pastebin Object.
```Python
from pbwrap import Pastebin
pastebin = Pastebin(api_dev_key)
```
### Examples
##### Get User Id
Returns a string with the user_id created after authentication.
```Python
user_id = pastebin.get_user_id(username, password)
```
##### Get Trending Pastes details
Returns a list containing Paste objects of the top 18 trending Pastes.
```Python
trending_pastes = pastebin.get_trending()
```
### Type models
#### Paste
Some API endpoints return paste data in xml format the wrapper either converts them in a python dictionary format
or returns them as Paste objects which contain the following fields:
* **key**
* **date** in **_UNIX_**
* **title**
* **size**
* **expire_date**
* **private**
* **format_short**
* **format_long**
* **url**
* **hits**
## License
pbwrap is released under [**MIT License**](../LICENSE)
>**Python API wrapper for the Pastebin Public API.
Lifetime pro endpoints are not yet supported!**
**Only _Python 3_ supported!**
## Documentation
This wrapper is based on **Pastebin** API read their Documentation [**here.**](https://pastebin.com/api)
for extra information and usage guide.
### Usage
Import and instantiate a Pastebin Object.
```Python
from pbwrap import Pastebin
pastebin = Pastebin(api_dev_key)
```
### Examples
##### Get User Id
Returns a string with the user_id created after authentication.
```Python
user_id = pastebin.get_user_id(username, password)
```
##### Get Trending Pastes details
Returns a list containing Paste objects of the top 18 trending Pastes.
```Python
trending_pastes = pastebin.get_trending()
```
### Type models
#### Paste
Some API endpoints return paste data in xml format the wrapper either converts them in a python dictionary format
or returns them as Paste objects which contain the following fields:
* **key**
* **date** in **_UNIX_**
* **title**
* **size**
* **expire_date**
* **private**
* **format_short**
* **format_long**
* **url**
* **hits**
## License
pbwrap is released under [**MIT License**](../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
Built Distribution
pbwrap-1.0.2-py3-none-any.whl
(6.6 kB
view hashes)
Close
Hashes for pbwrap-1.0.2.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1c6af830bc1f1eb2b703a90aea9efaf2d7f1db13f9a7b32a4ff56d24b7b3c55 |
|
MD5 | 4d0467a01532cb483127dcb3bb785b69 |
|
BLAKE2b-256 | 0206e3a397fc0064ff2c642e8f43e2e45bad0f0e7fa2f1cd26caf1ad0e73e912 |