I would like to access a bazaar repository and pull code from it with either a Python or PHP script.
How is this done? Is there a Python module / PEAR library that makes this easy?
If it helps, the repository is on Launchpad.
Edit: As mentioned below, running the bazaar commands directly is not an option. Also, an example would be much appreciated.
There is bzrlib. Depending on your circumstance you could also just execute the command lines to do this.
Based on the Integrating with BZR page you might do something like the following to checkout code. You can also Export code which might be more appropriate:
from bzrlib.bzrdir BzrDir
accelerator_tree, source = BzrDir.open_tree_or_branch('http:URL')
source.create_checkout('/tmp/newBzrCheckout', None, True, accelerator_tree)