bzrlib is the Python library behind bzr.
Automatically generated API documentation is available from:
Examples
Getting a Branch Object
from bzrlib.branch import Branch
my_branch = Branch.open('/path/to/branch')
Get WhoAmI Username
from bzrlib.branch import Branch
my_branch = Branch.open('/path/to/branch')
my_branch_config = my_branch.get_config()
print my_branch_config.username()
Create Local Copy of Branch
from bzrlib.plugin import load_plugins
# Load the bzr plugins - the "launchpad" plugin provides support for the "lp:" shortcut
load_plugins()
from bzrlib.branch import Branch
remote_branch_url = 'lp:launchpad'
remote_branch = Branch.open(remote_branch_url)
local_branch = remote_branch.bzrdir.sprout(
'/home/lp/code/').open_branch()For other documents, see Documentation.
