Skip to content

Latest commit

 

History

139 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

privatebin

PyPI - Version PyPI - Python Version License PyPI - Types

GitHub Build Workflow Status GitHub Tests Workflow Status codecov

Python library for interacting with PrivateBin's v2 API (PrivateBin >= 1.3) to create, retrieve, and delete encrypted pastes.

Installation

privatebin is available on PyPI, so you can simply use pip to install it.

pip install privatebin

Docs

Checkout the quick start page and the API reference.

Development

This is a pure-Python project, so development is pretty straightforward. I use uv to manage the project.

Linting, formatting, and type checking are handled by Ruff and Pyrefly:

uv run ruff check
uv run ruff format
uv run pyrefly check

The testing story is a bit more interesting because the test suite runs entirely offline.

Simply invoking pytest will run all the unit tests:

uv run pytest

Tacking on --integration to that will run the integration tests, which reside in tests\integration, against a real instance of PrivateBin. This instance will be created automatically as long as you have Docker or Podman available (it will fail otherwise) via ./docker/compose.yaml, and is cleaned up afterwards. By default, it uses port 59483, but you can pass a different one:

uv run pytest --integration --port 54748

I also support passing any HTTP client that satisfies the HttpClientProtocol, but the integration tests only run against the default HTTP client by default.

You'll have to pass --all-http-clients to run the integration tests against several other HTTP clients that I test for protocol compatibility with:

uv run pytest --integration --all-http-clients

Note that the specific HTTP clients are not documented because the goal is to support the interface rather than any particular implementation.

License

Distributed under the MIT License. See LICENSE for more information.

About

Python library for interacting with PrivateBin's v2 API (PrivateBin >= 1.3) to create, retrieve, and delete encrypted pastes.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages