Skip to main content

Bearer python helper

Project description

Bearer Python

Bearer Python client

Installation

pip install bearer

Usage

Get your Bearer Secret Key and integration id from the Dashboard and use the Bearer client as follows:

Calling any APIs

from bearer import Bearer

bearer = Bearer('BEARER_SECRET_KEY') # find it on https://app.bearer.sh/keys
github = (
    bearer
      .integration('your integration id') # you'll find it on the Bearer dashboard https://app.bearer.sh
      .auth('your auth id') # Create an auth id for your integration via the dashboard
)

print(github.get('/repositories').json())

We use requests internally and we return the response from this library from the request methods (request, get, head, post, put, patch, delete).

More advanced examples:

# With query parameters
print(github.get('/repositories', query={ 'since': 364 }).json())

# With body data
print(github.post('/user/repos', body={ 'name': 'Just setting up my Bearer.sh' }).json())

Calling custom functions

from bearer import Bearer

bearer = Bearer('BEARER_SECRET_KEY')
github = bearer.integration('your integration id')

print(github.invoke('your function name'))

Development

# setup venv
$ python -m venv venv

# install dependencies
$ venv/bin/python setup.py develop

# start the console
$ venv/bin/python

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for bearer, version 1.2.0
Filename, size File type Python version Upload date Hashes
Filename, size bearer-1.2.0.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View
Filename, size bearer-1.2.0-py3-none-any.whl (5.6 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page