Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I access contents in a file in my repository through a python project file?

Hailey Wallace
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 7, 2024

I'm very new to web development and I was trying to configure access to a file in my repository in a Django project (so just via a python file) using my username, repo name/workspace name/file name and the app password. I found a guide for cloning the repository via python, but nothing to access the specified file and its contents. I also don't know if this is possible since I haven't found anything specifically addressing this issue. I did find something that said to use the py requests module and request it via a url, but this was once again for cloning. Can anybody guide me in the right direction? And if this doesn't work, do you have any other suggestions for how to approach this?

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 10, 2024

Hi Hailey and welcome to the community!

We offer API endpoints for getting a file's content and for uploading a file to create a commit.

If you're looking to get the contents of just one file of a repository, you can use the following API endpoint:

If you make changes to that file locally and want to commit the new version to the Bitbucket Cloud repo, you can use the following API endpoint:

Kind regards,
Theodora

Hailey Wallace
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 11, 2024

Thank you so much!

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 12, 2024

You are very welcome! Please feel free to reach out if you ever need anything else!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events