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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Bitbucket Python API?

I need a way to get a list of all repositories, via Python, that my account can access. Is there a way to do something like this?

2 answers

1 accepted

2 votes
Answer accepted
edwin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 29, 2019

Hi @lpetrinsak ,

You can use stashy

bitbucket = stashy.connect(host, user, password)

projects = bitbucket.projects.list()

for project in projects:
for repo in bitbucket.projects["%s" %(project["key"])].repos.list():
print(repo)

Ah great! Thank you very much! Is it possible to acquire a list of "items" that are located in a particular repository?

Nvm, found a way, thank you!

Like edwin likes this

Do we have Pull request with stashy  @edwin  @lpetrinsak 

edwin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 26, 2019

Hi @Amman MS ,

Yes. You can see a full of whats implemented here: stashy 

Hi there @edwin @lpetrinsak  ! 

I wanted to ask, is this stashy solution only for Bitbucket Server? Because i need to use same thing in Bitbucket Cloud

I can only guess that same applies for Cloud...you can try it and see if it works though...

@lpetrinsak thanks for fast reply! 

I already tried. And first problem, that stuck with is what URL(host in example above) should be for connection to API?  

edwin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Dec 13, 2019

Hi @Valeriy Yakovenko  ,

Stashy is a client for Bitbucket Server.

The host above represents the Bitbucket base URL

bitbucket = stashy.connect("http://localhost:7990", "admin", "admin")

or

bitbucket = stashy.connect("http://localhost:7990/stash", "admin", "admin")
 

Hi @edwin ! 

Thank you for your fast reply, and sorry for my late reply. 

I will be really happy if you can give some advise about what to use for BitBucket Cloud API in python?

Like # people like this
0 votes
Mark Arce
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 25, 2022 • edited

Open source and actively maintained as of Dec 2022: https://pypi.org/project/atlassian-python-api/ (note that this project is not maintained by Atlassian)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events