Skip to main content

Simple Bugzilla interface

Why?

Because other libraries I found had limited API support (like no attachment support), complex implementation, and don’t seem very supported/taking PRs :)

For example most of what can be done with a 1000SLOC lib is done in this one with 100SLOC.

Usage

You can and should get an API KEY from Bugzilla with a Bugzilla account to your instance, in the user preferences. Everything is basically a DocDict (a dict() you can address like an object i.e. dict[‘x’] is also dict.x). The contents of the DotDict reflects the exact output of the API, i.e. any JSON the API sends is what you’ll find in the DotDict. Any data you need to send to the API uses the same names as well. See full doc at http://bugzilla.readthedocs.org/en/latest/api/core/v1/ or/and just look at the output of the examples.

Examples

import bugzilla

b = bugzilla.Bugzilla(url="https://bugzilla-dev.allizom.org/rest/", api_key="your api key")
#Just getting a bug
bug = b.get_bug(1001)
print(bug.id, bug.status)
#All attributes - it's just a dot dict.
print(bug)

#Making a bug
bug = bugzilla.DotDict()
bug.product = 'My product'
bug.component = 'My component'
bug.summary = 'A test bug'
bug.whiteboard 'my_flag'
print(b.post_bug(bug))

#Adding an attachment
attachment = bugzilla.DotDict()
attachment.file_name = 'clowns.txt'
attachment.summary = 'Test attachement'
attachment.data = 'some ASCII content'
print(b.post_attachment(1001, attachment))

#Search for stuff
terms = [{'product': 'MyProduct'}, {'product': 'MyOtherProduct'}, {'status': 'NEW'}]
print(b.search_bugs(terms))
#Or more easily
print(b.quick_search('test bug'))

TODO

  • Currently it does not work without an API key.

  • Currently only support ASCII attachments as string.

  • Some more obscure API methods are not implemented, like classifieds.

Metadata

Release files for bugzilla 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bugzilla 1.0.0
File Size Uploaded
bugzilla-1.0.0.tar.gz 8.6 kB Details

Release files / bugzilla-1.0.0.tar.gz

Download URL bugzilla-1.0.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6e864ddafc4e46c821c1f3735d7c9686522a4eece056be0cadf51221e22dfa11
BLAKE2b-256 checksum
How to use checksums
946ae5d97bef32ccb695d158fb3f726e32f509bbd803257d7c0becfeae60d723
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

1.0.0

1.0

1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page