microsoft / microsoft/azure-devops-python-api
How to download a file or the whole repository as a .zip file in SDK?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 684
- Forks
- 218
- Avg merge
- 8d 10h
- Merged PRs (30d)
- 1
Description
I can successfully download a file or folder if sending the request through a web browser.
-
Download the repostiroy as a .zip file
https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/items?path=/&$format=zip&download=true -
Download a file
https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/items?path=/folder1/folder2/file3.txt&download=true
But using the SDK, nothing happened though get_item returned the right object.
item = git_client.get_item(repo.id, path="/folder1/folder2/file3.txt", download=True)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Git client get_item call shown in the issue and compare its download behavior with the two Azure DevOps REST URLs. Check how the SDK exposes the returned item or response stream, then verify that file and repository downloads produce usable content rather than only an item object.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100