Giter Site home page Giter Site logo

allenai / beaker-py Goto Github PK

View Code? Open in Web Editor NEW
8.0 7.0 2.0 878 KB

A pure-Python Beaker client

Home Page: https://beaker-py.readthedocs.io/

License: Apache License 2.0

Makefile 0.05% Python 99.63% Shell 0.14% Dockerfile 0.18%
python beaker api-client

beaker-py's Introduction




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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.