Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Python interface to Buildhub service

Project description

python-buildhub

Build Status Code style

A simple wrapper on the Buildhub service. Basically, a glorified Elasticsearch over HTTP wrapper.

WORD OF WARNING

This is an experimental project, and the API is to be considered a prototype.

It's production-grade in terms of functionality (because it's so simple), but not only might things change but also consider it very minimal in features which means it can get better if you help out.

Install and Usage

Requires Python 3.

pip install python-buildhub
from buildhub import get_distinct_versions, get_distinct_buildids

print(get_distinct_versions(
    # product="Firefox",
    # channel="beta",
    # startswith="64",
))

print(get_distinct_buildids(
    # product="Firefox",
    # channel="beta",
    # startswith="2018",
))

If you want to use a different URL for the backend there are two ways to override it:

$ export BUILDHUB_SEARCH_URL=http://localhost:8888/api/search
$ python -c 'import buildhub; print(buildhub.SEARCH_URL)'
http://localhost:8888/api/search

or

from buildhub import get_distinct_versions

print(get_distinct_versions(
    _search_url='http://localhost:8000/api/v1'
))

Considering that this project is just a wrapper for making a Elasticsearch search query in JSON over HTTP POST, if you want to know what query gets sent you can use:

from buildhub import get_distinct_versions

get_distinct_versions(_verbose=True)

...and it will print the JSON used on stdout.

Contributing

Clone repo, create an environment and run:

pip install -e ".[dev]"

To get automatic flake8 and black checking done in a git pre-commit hook run:

therapist install

License

Delivery Console is licensed under the MPLv2. See the LICENSE file for details.

Project details


Release history Release notifications

Download files

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

Files for python-buildhub, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size python_buildhub-0.0.1-py3-none-any.whl (10.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size python-buildhub-0.0.1.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page