Pasted paste services for humans

Using the Python Client

Get a URL, go be productive. has a command line interface written in python. This page will cover the installation of and use of the python command line interface.

Typical Client Usage

The pasted-client can be used in several different ways. Here are some of the more typical uses:

  • Using stdin and a pipe into the client
  • Using the path to a given file
  • Using in scripts with an input stream literal
  • Using it directly to create original content
  • Using it as a library within your own python application
Installation of the python command line client

Once the CLI and Library has been installed, the pasted command will be available to you.

$ pip install --user pasted-client
$ which pasted

The command line interface can also be installed from source.

pip install --user git+

Once the client is installed, see pasted --help for all available options.

Using the python command line client

Pipe the file to pasted and get back a URL to a raw paste of that file.

$ cat somefile | pasted

You can also paste multiple using pasted with the file upload method. All pastes will be created in the order in which they're passed into the client.

$ pasted /path/to/file1 /path/to/file2 /path/to/file3

pasted can be used in an input stream literal, "here-document, here-text, heredoc, hereis, here-string, here-script".

$ pasted <<EOF
> This is a heredoc (input stream literal)
> which is very useful in scripting.

If original content needs to be created, the pasted command can be run without any arguments. Once content is created, press ctrl + d to exit the sub-shell and upload the content.

Using the python library.
from pasted_client import pasted
c = pasted.Client()
url = c.create_paste('Lorem ipsum.')

Alternatively, if you’re using your own deployment of Pasted, pass your own API endpoint to the client:

c = pasteraw.Client('http://pasted.example.tld/api/pastes')