Skip to main content

A Python Beaker client

Project description




beaker-py

A lightweight, standalone, pure Python client for Beaker


CI PyPI Documentation Status License

Features

🪶 Lightweight

  • Minimal dependencies.
  • Only pure-Python dependencies.
  • Communicates directly with the Beaker server via HTTP requests (Beaker CLI not required).

💪 Robust

  • Automatically retries failed HTTP requests with exponential backoff.
  • Runtime data validation.
  • High test coverage.

📓 Exhaustively-typed and documented

  • Thorough data model for all input / output types.
  • Every expected HTTP error from the Beaker server is translated into a specific exception type.

Quick links

See also 👇

Installing

Installing with pip

beaker-py is available on PyPI. Just run

pip install beaker-py

Installing from source

To install beaker-py from source, first clone the repository:

git clone https://github.com/allenai/beaker-py.git
cd beaker-py

Then run

pip install -e .

Quick start

If you've already configured the Beaker command-line client, beaker-py will find and use the existing configuration file (usually located at $HOME/.beaker/config.yml). Otherwise just set the environment variable BEAKER_TOKEN to your Beaker user token.

Either way, you should then instantiate the Beaker client with .from_env():

from beaker import Beaker

beaker = Beaker.from_env(default_workspace="my_org/my_workspace")

The API of beaker-py is meant to mirror - as closely as possible - the API of the Beaker CLI. For example, when you do this with the CLI:

beaker dataset create --name foo .

The beaker-py equivalent would be:

beaker.dataset.create("foo", ".")

See the API Docs to learn about the Beaker client's methods.

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

beaker_py-1.32.0.tar.gz (74.5 kB view details)

Uploaded Source

Built Distribution

beaker_py-1.32.0-py3-none-any.whl (87.9 kB view details)

Uploaded Python 3

File details

Details for the file beaker_py-1.32.0.tar.gz.

File metadata

  • Download URL: beaker_py-1.32.0.tar.gz
  • Upload date:
  • Size: 74.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.18

File hashes

Hashes for beaker_py-1.32.0.tar.gz
Algorithm Hash digest
SHA256 32192eacfb02bcd52107f1b685c54cac19af062044d6a3a460f0014c733d4cbf
MD5 f5c3cd4d2b0c154134c604c71f101439
BLAKE2b-256 52e023bd343fccf2c8f9d4c77d06562826a964778e0bcc057ae26dd79c351f70

See more details on using hashes here.

File details

Details for the file beaker_py-1.32.0-py3-none-any.whl.

File metadata

  • Download URL: beaker_py-1.32.0-py3-none-any.whl
  • Upload date:
  • Size: 87.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.18

File hashes

Hashes for beaker_py-1.32.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dbc604d1b6d969d0869c6d8376a6a14945d0ebd9d2669fec9ed77fc5ccd7ad9e
MD5 f8b6db9e5e55f51ab53647503de7dd90
BLAKE2b-256 958af9ee02c80b26b5590e8c6971b6d01bfdb2d078851d62f11cada73f60f152

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