Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions .github/workflows/update-download-badges.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
name: Update total downloads badge
name: Update profile totals

# Tallies PyPI + jsDelivr downloads and rewrites the TOTAL-DOWNLOADS badge
# block in profile/README.md.
# Tallies downloads, stars and forks across the public repos of johanbeytell1
# and Infinitode, and rewrites the TOTAL-DOWNLOADS badge block in
# profile/README.md. Repos are discovered automatically; nothing is listed by hand.
# No personal access tokens are needed.
#
# Data sources (see scripts/update-download-badges.py for details):
# PyPI - pepy v2 API when PEPY_API_KEY is set (exact counts), otherwise
# the shields.io /pepy/dt badge (no key, rounded figures).
# jsDelivr - shields.io /jsdelivr/gh/hy badge = hits over the last 12 months.
# jsDelivr publishes period stats only; there is no all-time figure.
# Stars, forks - GitHub repo listing (exact, all-time).
# PyPI - packages that belong to a repo (verified by a link back to
# the repo or by the repo's packaging file). Rounded shields.io
# figures by default; set PEPY_API_KEY for exact counts.
# jsDelivr - shields.io /jsdelivr/gh/hy badge for every repo; hits over
# the last 12 months (there is no all-time jsDelivr figure).
#
# Optional but recommended: add a repository secret named PEPY_API_KEY
# (free key: pepy.tech -> sign in -> API key). Without it the job still runs,
# using the rounded shields.io figures instead.
#
# Safety: a failed fetch never overwrites the badge. The job only writes when
# at least one source returned a number, and never publishes a total more than
# 5% below the figure already shown.
# Safety: a failed fetch never overwrites the published numbers. The job only
# writes when the repo listing succeeded and at least one download source
# returned a number. Download totals are never published more than 5% below the
# figure already shown.

on:
schedule:
Expand Down Expand Up @@ -53,26 +54,29 @@ jobs:
- name: Run the badge tests
run: python3 -m unittest discover -s scripts -p 'test_*.py' -v

# Pull requests only run the tests above; the badge is rewritten on main.
- name: Tally downloads and rewrite the badge
# Pull requests only run the tests above; the badges are rewritten on main.
- name: Tally totals and rewrite the badges
if: github.event_name != 'pull_request'
env:
# Built into every workflow run; only used to raise the GitHub rate limit.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Optional. Without it PyPI counts are rounded shields.io figures.
PEPY_API_KEY: ${{ secrets.PEPY_API_KEY }}
run: |
if [ -z "$PEPY_API_KEY" ]; then
echo "::warning::PEPY_API_KEY is not set; PyPI counts will be rounded shields.io figures."
echo "::notice::PEPY_API_KEY is not set; PyPI counts will be rounded shields.io figures."
fi
python3 scripts/update-download-badges.py --readme profile/README.md

- name: Commit the updated badge
- name: Commit the updated badges
if: github.event_name != 'pull_request'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add profile/README.md
if git diff --cached --quiet; then
echo "Total downloads unchanged; nothing to commit."
echo "Totals unchanged; nothing to commit."
else
git commit -m "chore: update total downloads badge [skip ci]"
git commit -m "chore: update profile totals [skip ci]"
git push
fi
9 changes: 8 additions & 1 deletion profile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
![](https://komarev.com/ghpvc/?username=infinitode&color=5d17eb)
<!-- TOTAL-DOWNLOADS:START (generated by scripts/update-download-badges.py) -->
![Total Downloads](https://img.shields.io/badge/Total%20Downloads-120.9k-5d17eb)
![Total Stars](https://img.shields.io/badge/Total%20Stars-50-5d17eb)
![Total Forks](https://img.shields.io/badge/Total%20Forks-10-5d17eb)
<!-- TOTAL-DOWNLOADS:END -->

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/M4J423SRBM)
Expand All @@ -30,7 +32,7 @@ Welcome to Infinitode, a cutting-edge small technology company dedicated to deve
> Upcoming changes are planned changes. We can remove, cancel, or stage these changes for a later date.

### Latest changes
- Released `CloakJS`, a small JavaScript code obfuscator.
- Released [`CloakJS`](https://github.com/Infinitode/CloakJS), a small JavaScript code obfuscator.
- Updated website with new pricing and MFA authentication available for verified emails and Google sign-ins.
- Updated general website security and user account security.
- Updated `Python Projects` with new projects.
Expand Down Expand Up @@ -421,6 +423,10 @@ Welcome to Infinitode, a cutting-edge small technology company dedicated to deve

![jsDelivr hits (GitHub)](https://img.shields.io/jsdelivr/gh/hy/infinitode/blurjs) ![jsDelivr hits (GitHub)](https://img.shields.io/jsdelivr/gh/hm/infinitode/blurjs) ![GitHub Repo stars](https://img.shields.io/github/stars/infinitode/blurjs) ![GitHub last commit](https://img.shields.io/github/last-commit/infinitode/blurjs)

[**CloakJS**](https://github.com/Infinitode/CloakJS)

![jsDelivr hits (GitHub)](https://img.shields.io/jsdelivr/gh/hy/infinitode/cloakjs) ![GitHub stars](https://img.shields.io/github/stars/infinitode/cloakjs) ![GitHub last commit](https://img.shields.io/github/last-commit/infinitode/cloakjs)


## Our mission

Expand All @@ -438,6 +444,7 @@ We're proud to showcase some of our current projects:
* **CodeSafe**: An open-source Python library for code encryption, decryption, and safe evaluation using Python's built-in AST module, with allowed functions, variables, built-in imports, timeouts, and more.
* **PyWebScrapr**: An open-source Python web scraping tool supporting image and text scraping for effortless data collection.
* **FuncProfiler**: An open-source Python library for identifying bottlenecks in code, featuring function profiling, data exports, logging, and line-by-line profiling for more granular control.
* **CloakJS**: A single-file, dependency-free JavaScript obfuscator for the browser and Node.js, with identifier renaming, string encryption, and control-flow options. [View on GitHub](https://github.com/Infinitode/CloakJS).

> [!TIP]
> For more projects, see: https://github.com/Infinitode?tab=repositories
Expand Down
Loading
Loading