Added harvester package with harvester module and harvest_readmes() function prototype.
All checks were successful
/ unit-tests (push) Successful in 10s

This commit is contained in:
2025-11-09 20:55:05 +01:00
parent c3c5f9935c
commit 565464e266
4 changed files with 81 additions and 15 deletions

View File

@@ -1,18 +1,8 @@
#!/usr/bin/env python3
import requests
from devops.devops import Organization, Project, Repository, Item
from devops.azure import get_token
from harvester.harvester import harvest_readmes
org = Organization("https://dev.azure.com/mcovsandbox", token=get_token())
# Find all Markdown files in all projects and repositories
for project in org.projects:
for repo in project.repositories:
try:
root_item = Item(repository=repo, path="/")
md_files = root_item.get_child_items(pattern="*.md", recurse=True)
for md_file in md_files:
print(f"Project: {project.name}, Repo: {repo.name}, File: {md_file.path}")
except requests.exceptions.HTTPError as e:
print(f"Repository {repo.name} is empty.")
if __name__ == "__main__":
harvest_readmes(
organization="mcovsandbox"
)