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.
Source Distribution
bearer-1.2.0.tar.gz
(4.2 kB
view hashes)
Built Distribution
bearer-1.2.0-py3-none-any.whl
(5.6 kB
view hashes)