Skip to main content

A command-line interface for Pastery, the best pastebin in the world.

Project description

BakeIt is a command line utility (and Python library) to Pastery, the best pastebin in the world. BakeIt aims to be simple to use and unobtrusive.

Installation

To install, use pip:

pip install bakeit

You are done!

Usage

Using BakeIt is similarly easy. First, create a file with your Pastery API key in ~/.config/bakeit.cfg, like so:

[pastery]
api_key = eisha8ahqui7Aesh0fasyu8HFsdo

Then, just pass the file you want to upload to the bakeit command:

$ bakeit myfile.txt
Paste URL: https://www.pastery.net/oniasd/

You can also pipe stuff to it:

$ cat myfile.txt | grep hello | bakeit
Paste URL: https://www.pastery.net/oxczvs/

The config file

A full config file can look like this:

[pastery]
api_key = eisha8ahqui7Aesh0fasyu8HFsdo
duration = 2880

The api_key parameter, as explained above, is mandatory. You can find it at the bottom of your Pastery account page.

The duration parameter is optional. If set, it will be used as the default duration for every new paste. The command-line argument takes precedence over this parameter, though, so you can change it per-paste when invoking bakeit.

Usage as a Python library

BakeIt provides the PasteryUploader class:

>>> from bakeit import PasteryUploader
>>> pu = PasteryUploader("your API key")
>>> pu.upload("this is the text to upload")
"https://www.pastery.net/pabtus/"

PasteryUploader accepts the following arguments:

  • body - The body of the paste.

  • title (optional) - The title to give the paste.

  • language (optional) - The language the paste is in. Pastery will attempt to autodetect this if omitted.

  • duration (optional) - The number of minutes to keep this paste for.

  • max_views (optional) - The number of views to keep this paste for.

Happy pasting!

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

bakeit-0.2.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distributions

bakeit-0.2.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

bakeit-0.2.2-py2-none-any.whl (7.2 kB view details)

Uploaded Python 2

File details

Details for the file bakeit-0.2.2.tar.gz.

File metadata

  • Download URL: bakeit-0.2.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bakeit-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ad27189ac852eb93d2702c923eb31cbd1c8c691f187c6e6f79af515f682478b9
MD5 a23e7e7326a4a8faed3d15811d3d51cb
BLAKE2b-256 fa86243c68620a9d6235d9b134cac77d59c705d95083d387458cac8b5c4430c6

See more details on using hashes here.

File details

Details for the file bakeit-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: bakeit-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for bakeit-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 484fbd1f7edfa7ca27458301386fc146428eda4ee24f981a5493a5b11abd20f5
MD5 d669a6e1e5f109d2f101d3515ecf4514
BLAKE2b-256 cc80e06be8bcd85a196f669fc8c089be8cf44d845bcf63a94f1ed9ef93e8cb52

See more details on using hashes here.

File details

Details for the file bakeit-0.2.2-py2-none-any.whl.

File metadata

File hashes

Hashes for bakeit-0.2.2-py2-none-any.whl
Algorithm Hash digest
SHA256 e177aad875bfaf60280197a3d3123051331a4696596ae10a1f9c354039576193
MD5 1556cdc1075f9f3e30683e9b54feb0db
BLAKE2b-256 0aab666c0ad391ad85c503f7556ce7f94508eeed7dcdcb05cdeca3aa7bb65bda

See more details on using hashes here.

Supported by

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