skip to navigation
skip to content

fogbugz 0.9.6

Python library for interacting with the FogBugz API

Latest Version: 1.0.6

Python FogBugz API Wrapper

This Python API is simply a wrapper around the FogBugz API, with some help from Leonard Richardson’s BeautifulSoup ( and the magic of Python’s __getattr__().

Getting Started:

To use the FogBugz API, install the package either by downloading the source and running

$ python install

or by using pip

$ pip install fogbugz

A Quick Example:

>>> from fogbugz import FogBugz
>>> fb = FogBugz("") # URL is to your FogBugz install
>>> fb.logon("", "password")
>>> resp ="assignedto:tyler") # All calls take named parameters, per the API
>>> resp # Responses are BeautifulSoup objects of the response XML.
  <cases count="2">
    <case ixbug="1" operations="edit,assign,resolve,email,remind"></case>
    <case ixbug="2" operations="edit,spam,assign,resolve,reply,forward,remind"></case>
>>> # You shouldn't need to know too much about BeautifulSoup, but the documentation can be found here:
>>> #
>>> for case in resp.cases.childGenerator(): # One way to access the cases
...     print case['ixbug']
>>> for case in resp.findAll('case'): # Another way to access the cases
...     print case['operations']
>>> resp = fb.edit(ixbug=1, sEvent="Edit from the API") # Note the named parameters
>>> resp
<response><case ixbug="1" operations="edit,assign,resolve,email,remind"></case></response>
>>> # To upload files, just pass a `Files` parameter that is a dictionary of filename and file handle. New in 0.9.2.
>>> resp = fb.edit(ixbug=2, sEvent="Add a file from the API", Files={'filename': open('filename', 'r')}) # Note the named parameters
>>> resp
<response><case ixbug="2" operations="edit,assign,resolve,email,remind"></case></response>

Note that, per API v5.0, all data between tags, such as the token, is now wrapped in CDATA. BeautifulSoup’s implementation of CData generally allows for it to be treated as a string, except for one important case: CData.__str__() (a.k.a. str(CData)) returns the full text, including the CDATA wrapper (e.g. “<![CDATA[foo]]>”). To avoid accidentally including the CDATA tage, use CData.encode(‘utf-8’)

For more info on the API:

File Type Py Version Uploaded on Size
fogbugz-0.9.6.tar.gz (md5) Source 2014-09-05 5KB