main() — fastapi Function Reference
Architecture documentation for the main() function in people.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 04dd64fd_a157_008a_06a5_7c82002acaed["main()"] 4dbe490d_c30b_6033_480a_ba29c94d075d["people.py"] 04dd64fd_a157_008a_06a5_7c82002acaed -->|defined in| 4dbe490d_c30b_6033_480a_ba29c94d075d 84977da1_57ce_0dc7_e179_a9a9413dc881["get_discussion_nodes()"] 04dd64fd_a157_008a_06a5_7c82002acaed -->|calls| 84977da1_57ce_0dc7_e179_a9a9413dc881 b508f7f4_39cb_5609_1086_8ac1342fe21b["get_discussions_experts()"] 04dd64fd_a157_008a_06a5_7c82002acaed -->|calls| b508f7f4_39cb_5609_1086_8ac1342fe21b 33f800ed_051f_06ef_6305_113f964e430f["get_users_to_write()"] 04dd64fd_a157_008a_06a5_7c82002acaed -->|calls| 33f800ed_051f_06ef_6305_113f964e430f 03193f2b_d187_4dad_deb5_b729737aed7c["update_content()"] 04dd64fd_a157_008a_06a5_7c82002acaed -->|calls| 03193f2b_d187_4dad_deb5_b729737aed7c style 04dd64fd_a157_008a_06a5_7c82002acaed fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
scripts/people.py lines 317–400
def main() -> None:
logging.basicConfig(level=logging.INFO)
settings = Settings()
logging.info(f"Using config: {settings.model_dump_json()}")
g = Github(settings.github_token.get_secret_value())
repo = g.get_repo(settings.github_repository)
discussion_nodes = get_discussion_nodes(settings=settings)
experts_results = get_discussions_experts(discussion_nodes=discussion_nodes)
authors = experts_results.authors
maintainers_logins = {"tiangolo"}
maintainers = []
for login in maintainers_logins:
user = authors[login]
maintainers.append(
{
"login": login,
"answers": experts_results.commenters[login],
"avatarUrl": user.avatarUrl,
"url": user.url,
}
)
experts = get_users_to_write(
counter=experts_results.commenters,
authors=authors,
)
last_month_experts = get_users_to_write(
counter=experts_results.last_month_commenters,
authors=authors,
)
three_months_experts = get_users_to_write(
counter=experts_results.three_months_commenters,
authors=authors,
)
six_months_experts = get_users_to_write(
counter=experts_results.six_months_commenters,
authors=authors,
)
one_year_experts = get_users_to_write(
counter=experts_results.one_year_commenters,
authors=authors,
)
people = {
"maintainers": maintainers,
"experts": experts,
"last_month_experts": last_month_experts,
"three_months_experts": three_months_experts,
"six_months_experts": six_months_experts,
"one_year_experts": one_year_experts,
}
# For local development
# people_path = Path("../docs/en/data/people.yml")
people_path = Path("./docs/en/data/people.yml")
updated = update_content(content_path=people_path, new_content=people)
if not updated:
logging.info("The data hasn't changed, finishing.")
return
logging.info("Setting up GitHub Actions git user")
subprocess.run(["git", "config", "user.name", "github-actions[bot]"], check=True)
subprocess.run(
["git", "config", "user.email", "github-actions[bot]@users.noreply.github.com"],
check=True,
)
branch_name = f"fastapi-people-experts-{secrets.token_hex(4)}"
logging.info(f"Creating a new branch {branch_name}")
subprocess.run(["git", "checkout", "-b", branch_name], check=True)
logging.info("Adding updated file")
subprocess.run(["git", "add", str(people_path)], check=True)
logging.info("Committing updated file")
message = "👥 Update FastAPI People - Experts"
subprocess.run(["git", "commit", "-m", message], check=True)
logging.info("Pushing branch")
subprocess.run(["git", "push", "origin", branch_name], check=True)
logging.info("Creating PR")
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does main() do?
main() is a function in the fastapi codebase, defined in scripts/people.py.
Where is main() defined?
main() is defined in scripts/people.py at line 317.
What does main() call?
main() calls 4 function(s): get_discussion_nodes, get_discussions_experts, get_users_to_write, update_content.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free