mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-27 15:55:00 +00:00
feat: add get_badges_md() function to generate badges markdown
This commit is contained in:
parent
e915964d81
commit
d26df6c178
1 changed files with 29 additions and 0 deletions
|
@ -140,6 +140,35 @@ src="https://img.shields.io/badge/🔄%20Singularity-{aider_percent_rounded}%25-
|
|||
return markdown
|
||||
|
||||
|
||||
def get_badges_md():
|
||||
"""
|
||||
Get all statistics and return the generated badges markdown
|
||||
"""
|
||||
# Load environment variables from .env file
|
||||
load_dotenv()
|
||||
|
||||
# Get API key from environment variable
|
||||
api_key = os.environ.get("PEPY_API_KEY")
|
||||
if not api_key:
|
||||
print(
|
||||
"API key not provided. Please set PEPY_API_KEY environment variable",
|
||||
file=sys.stderr,
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
# Get PyPI downloads for the default package
|
||||
total_downloads = get_total_downloads(api_key, "aider-chat")
|
||||
|
||||
# Get GitHub stars for the default repo
|
||||
stars = get_github_stars("paul-gauthier/aider")
|
||||
|
||||
# Get Aider contribution percentage in latest release
|
||||
percentage, _ = get_latest_release_aider_percentage()
|
||||
|
||||
# Generate and return badges markdown
|
||||
return generate_badges_md(total_downloads, stars, percentage)
|
||||
|
||||
|
||||
def main():
|
||||
# Load environment variables from .env file
|
||||
load_dotenv()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue