Skip to main content

Python library for interacting with the FogBugz API

Project description

https://img.shields.io/pypi/v/fogbugz_bis.svg https://img.shields.io/pypi/pyversions/fogbugz_bis.svg https://img.shields.io/travis/yougov/FogBugzPy/master.svg

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 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


Download files

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

Source Distribution

fogbugz_bis-1.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

fogbugz_bis-1.1-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file fogbugz_bis-1.1.tar.gz.

File metadata

  • Download URL: fogbugz_bis-1.1.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for fogbugz_bis-1.1.tar.gz
Algorithm Hash digest
SHA256 d753ee4c27b32d1631d9ada6920fdd44515fa17eadc68ae8d14795c1c393d545
MD5 e09cc673949127ea915ed4f37a75468c
BLAKE2b-256 10c685af1b4a5d523e2a9c7bb868599493cd5dfe99eb01a4ffaf7d7217a1a23a

See more details on using hashes here.

Provenance

File details

Details for the file fogbugz_bis-1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: fogbugz_bis-1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for fogbugz_bis-1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0488637e96a1e6231db8913b2265dc5d59a81c5e1e55ff93649d9f12aa78ddba
MD5 21c40c3a6b6b55a4ef673bf3a7dc3d6c
BLAKE2b-256 a6211c8ba747db860933035fa067e7208e42f8026ae2f5fb6d48b49e6112c781

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page