Python library for interacting with the FogBugz API
Project description
Python FogBugz API Wrapper
This Python API is simply a wrapper around the FogBugz API, with some help from Leonard Richardson’s BeautifulSoup (http://www.crummy.com/software/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 setup.py install
or by using pip
$ pip install fogbugz
A Quick Example:
>>> from fogbugz import FogBugz >>> fb = FogBugz("http://example.fogbugz.com/") # URL is to your FogBugz install >>> fb.logon("logon@example.com", "password") >>> resp = fb.search(q="assignedto:tyler") # All calls take named parameters, per the API >>> resp # Responses are BeautifulSoup objects of the response XML. <response><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></cases></response> >>> # You shouldn't need to know too much about BeautifulSoup, but the documentation can be found here: >>> # http://www.crummy.com/software/BeautifulSoup/documentation.html >>> for case in resp.cases.childGenerator(): # One way to access the cases ... print case['ixbug'] ... 1 2 >>> for case in resp.findAll('case'): # Another way to access the cases ... print case['operations'] ... edit,assign,resolve,email,remind edit,spam,assign,resolve,reply,forward,remind >>> 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>
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’)
Additional Details:
If your script requires a certain version of the FogBugz API, make sure to pass it as an argument to the constructor. This will protect you from unexpected differences should we make backwards-incompatible changes.
>>> from fogbugz import FogBugz >>> fb = FogBugz("http://example.fogbugz.com", api_version=5)
For more info on the API: http://help.fogcreek.com/the-fogbugz-api
Much of the API has not been thoroughly tested. Please report bugs to customer-service@fogcreek.com
fogbugz_bis is a fork of the FogCreek codebase to support Python 3 and BeautifulSoup 4. You should install/require only one of fogbugz or fogbugz_bis as they both implement the same module.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fogbugz-1.0.6.tar.gz
.
File metadata
- Download URL: fogbugz-1.0.6.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e25413ebc15a29b9f56c67e53340c1e93e56f4b5779557c855d497e3cbc15fdc |
|
MD5 | 6f3c0c5f99ea502973ec834eb86a6bde |
|
BLAKE2b-256 | 9cb912fa0b0708c9b52a1a3ac0416c76e3d466d01a7e65305a5d4a714bb1e873 |
File details
Details for the file fogbugz-1.0.6-py2-none-any.whl
.
File metadata
- Download URL: fogbugz-1.0.6-py2-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b0d3058b01599d009c5b9d0b8e81ccb73b9dfe28f4583740232a07f0517f479 |
|
MD5 | de173fa5ee00f5675264db432ca645b4 |
|
BLAKE2b-256 | dd1f13e24f3e5f434b2dd28c7652192609f4c56cd2c980228d4312e6e344294b |