Source

python-bitbucket / examples / file_object.py

Full commit
from api import API

api = API("kveroneau", "**password**")
change = api.get_changeset("kveroneau", "python-bitbucket", changeset="fa0d7c04593f")

print change.files[0].read()

# You can even do this:
print api.get_file("kveroneau", "python-bitbucket", "examples/new_issue.py").read()

# You are also able to fetch a specific revision/changeset:
print api.get_file("kveroneau", "python-bitbucket", "api.py", revision="298102b6aa12").read()