Chart a Repo's Star History

Use GitHub's API to chart and compare repository star growth over time.

Introduction

30 Second Summary

A repository's star count tells you where it is today. The shape of its growth reveals when people started paying attention.

In this project, you will pull privacy-safe star history from the GitHub REST API into saved JSON files. You will turn that data into a chart that compares two repositories around a known launch date.

What You'll Build

You will open a finished chart showing two star-growth curves on one timeline beside a launch marker.

By the end of this project, you'll have:

  • A star history chart that turns aggregated GitHub data into a growth curve you can inspect.
  • Saved raw JSON responses that let you recreate the same chart without calling the API again.
  • A two-repository comparison with a launch marker that helps you spot changes in star growth.
  • An optional Secret Mission to push your skills further.

What do I need before starting?

You will need a GitHub account, curl, and a charting library you already know. The GitHub REST API is free for authenticated personal use.

Before We Start

A useful star-history chart starts with clear comparison targets. Your local tools also need to be ready before you contact the GitHub API.

Python 3 runs the charting script. pip installs its libraries. curl sends the first request.

In this step, get ready to:
  • Choose two public repositories plus a known launch date.
  • Confirm your command-line tools are available.
  • Prepare a local workspace with the required Python packages.
Choose your repositories

Each repository is identified by an owner name plus a repository name. A known launch date gives your final chart a moment to compare against the star curve.

Your password stays on GitHub's website. This step does not create a personal access token.

Your account state determines the shortest path:

✔️ I have a GitHub account

  • Visit GitHub in your browser.
  • Sign in to your account.

You should see your signed-in GitHub home page.

ⓧ I need a GitHub account

  • Visit GitHub in your browser.
  • Create an account using the sign-up option on the page.
  • Complete GitHub's account verification process.
  • Sign in to your new account.

You should see your signed-in GitHub home page.

  • Choose a public repository with a launch date you can verify.
  • Record its owner name as OWNER_ONE: first repository owner.
  • Record its repository name as REPO_ONE: first repository name.
  • Choose a known launch date for the first repository.
  • Record the date in YYYY-MM-DD format: yyyy-mm-dd launch date.

What makes a useful launch date?

Choose a date tied to a public event such as a first release or product launch. You will place this date on the chart to compare the event with the repository's growth.

  • Choose a second public repository for comparison.
  • Record its owner name as OWNER_TWO: second repository owner.
  • Record its repository name as REPO_TWO: second repository name.

Good choice. Your two repository pairs now give the final chart a real comparison to show.

Check your command-line tools

The terminal gives you one place to check every local tool. Version output confirms that each command is available from your system path.

  • Press Cmd+Space on macOS or the Windows key on Windows to open system search.
  • Type terminal into the search field.
  • Select the terminal app shown in the results.
  • Check Python 3 plus pip by running the commands for your computer:

macOS

python3 --version
python3 -m pip --version

What do these checks prove?

  • The first command confirms that the Python 3 interpreter is available.
  • The second command confirms that pip belongs to the same Python installation.

Windows

py -3 --version
py -3 -m pip --version

What do these checks prove?

  • The first command asks the Windows Python launcher for Python 3.
  • The second command confirms that pip belongs to that Python installation.

Choose the result that matches your terminal:

✔️ I see Python and pip versions

Your Python toolchain is ready. You can install the charting libraries into this Python environment.

ⓧ Python is not found

Python needs to be installed before the project can continue. The standard Python installation includes pip.

  • Visit the official Python downloads page.
  • Download the installer recommended for your computer.
  • Run the downloaded installer.
  • Approve an operating-system permission prompt only if the download came from the official Python website.
  • Complete the standard installation.
  • Return to the terminal from earlier.
  • Repeat the platform check above.

Python still not found?

Close your terminal after the installation. Open it again so the new command path is loaded.

If the command remains unavailable, help me troubleshoot my Python installation.

ⓧ pip is not found

Python includes the ensurepip module for restoring its bundled package installer. Run the command for your computer.

macOS

  • Bootstrap pip for Python 3 by running:
python3 -m ensurepip
What does this command do?

Python runs its bundled ensurepip module. The module installs pip when it is missing.

Windows

  • Bootstrap pip for Python 3 by running:
py -3 -m ensurepip
What does this command do?

The Windows Python launcher runs the bundled ensurepip module for Python 3. The module installs pip when it is missing.

pip still unavailable?

Return to the official Python installer if the bootstrap command fails. Complete a standard installation so Python can add its bundled package tools.

If pip remains unavailable, help me restore pip for my Python installation.

  • Check curl by running this command:
curl --version

What does this check prove?

curl prints its version plus supported features when the command is available. This confirms that your terminal can use it for the authenticated API request later.

✔️ I see curl version details

Your request tool is ready. The first line of output identifies the installed curl version.

ⓧ curl is not found

  • Visit the official curl downloads page.
  • Choose a curl tool package that matches your operating system.
  • Follow the package provider's installation instructions.
  • Return to the terminal from earlier.
  • Repeat the curl version check above.

curl still not found?

Close your terminal after the installation. Open it again so the updated command path is loaded.

If curl remains unavailable, help me troubleshoot my curl installation.

Create your workspace and install packages

Requests handles API calls from Python. Matplotlib turns the saved star-history data into chart images.

  • Switch back to the terminal from earlier.
  • Move to your Desktop by running this command:
cd ~/Desktop

What does this command do?

The command moves your terminal to the Desktop. Your project folder will be easy to find there.

  • Create the star-history folder by running these commands:
mkdir star-history
cd star-history

What do these commands do?

  • The first command creates the local project directory.
  • The second command moves your terminal into that directory.
  • Confirm the workspace location by running:
pwd
ls

What should I see?

The first command prints your current location. The path should end with star-history.

The second command lists the folder contents. Empty output confirms that the new workspace is ready for the script plus its saved responses.

  • Install Requests plus Matplotlib by running the command for your computer:

macOS

python3 -m pip install requests matplotlib

What does this command do?

Python runs pip to download Requests plus Matplotlib. pip also installs the supporting packages they need.

Windows

py -3 -m pip install requests matplotlib

What does this command do?

The Windows Python launcher runs pip for Python 3. pip downloads Requests plus Matplotlib with their supporting packages.

That is the local setup complete. Your Python environment now has the tools for downloading star history and drawing its chart.

Package installation failed?

Confirm that your terminal is still inside the star-history folder. Check that the Python command from the successful platform tab still prints a version.

If pip reports a permissions or dependency problem, help me debug the package installation.

Before you check, do you expect both package names to appear in the terminal?

  • Verify the installed packages by running the command for your computer:

macOS

python3 -m pip list

What does this check prove?

pip lists the packages available to Python 3. Seeing both project libraries confirms that the installation succeeded.

Windows

py -3 -m pip list

What does this check prove?

The Windows Python launcher asks pip to list packages for Python 3. Seeing both project libraries confirms that the installation succeeded.

You should see rows for requests plus matplotlib in the package list. Your star-history workspace is ready for the project files.

Your workspace is ready. Your chart inputs are chosen. Next, you'll prepare GitHub access for your first API call.

Create and Verify Your Token

Your chart depends on repeated requests to the GitHub REST API. Authenticated requests give GitHub a clear identity to evaluate.

A fine-grained personal access token limits the credential to read-only access. This step proves that the token works before you collect star history.

In this step, get ready to:
  • Choose two public repositories for your comparison.
  • Create a fine-grained token with read-only metadata access.
  • Store the token in a shell environment variable and verify it with an authenticated request.
Choose your repositories and launch date

A useful comparison starts with two public repositories whose growth you want to understand. A known launch date gives the first repository's curve a moment you can investigate later.

  • Choose the first public repository for your chart.
  • Record the first repository's owner as: first repository owner.
  • Record the first repository's name as: first repository name.
  • Choose the second public repository for your comparison.
  • Record the second repository's owner as: second repository owner.
  • Record the second repository's name as: second repository name.
  • Choose a known launch date for the first repository from a source you trust.
  • Record the date as: YYYY-MM-DD launch date.

Choose a Useful Comparison

Pick projects whose star growth helps answer a question you care about. You could compare projects in the same category or projects launched at different times.

  • In your browser, open the GitHub page for first repository owner/first repository name to confirm it is public.
  • In your browser, open the GitHub page for second repository owner/second repository name to confirm it is public.

You should see the first repository page without a permission prompt. The second page should behave the same way.

Create a read-only token

A personal access token acts as your identity when a command calls GitHub. You will grant only the read access needed for public repository metadata.

Creating a credential can feel sensitive. The token stays out of your project files throughout this workflow.

  • Sign in to GitHub in your browser.
  • Click your profile picture in the upper-right corner.
  • Select Settings.
  • Select Developer settings in the left sidebar.
  • Select Fine-grained tokens under Personal access tokens.
  • Click Generate new token.
  • Enter star-history-chart in the Token name field.
  • Choose the shortest available Expiration period that gives you enough time to finish the project.

Why Read-Only Access?

The chart only reads repository metadata. A token without write permissions reduces the impact if someone gains access to it.

  • Select your personal account under Resource owner.
  • Keep Repository access limited to public repositories.
  • Expand Repository permissions under Permissions.
  • Confirm Metadata displays Read-only.
  • Leave every other optional permission unselected.

GitHub may ask you to confirm your identity when you submit the form.

  • Click Generate token.
  • Complete GitHub's identity check if it appears.
  • Copy the generated token.

That careful permission setup is complete. Your token can authenticate the charting workflow without write access.

Cannot Create the Token?

  • Confirm your GitHub email address if token creation is unavailable.
  • Select your personal account as the resource owner if an organization blocks fine-grained tokens.
  • Use Help me create a fine-grained GitHub token with read-only metadata access. for guidance without sharing the credential.
Store the token and verify access

A shell environment variable makes the token available to commands in your current terminal session. A silent prompt keeps the literal token out of your command history.

  • Switch back to your terminal.
  • Start a silent prompt by running the command below:
  • Paste your token when the terminal waits for input.
  • Press Enter to store it in GITHUB_TOKEN.
read -s GITHUB_TOKEN && export GITHUB_TOKEN

What Does This Command Do?

  • The read -s command receives the token without displaying its characters.
  • The export command makes GITHUB_TOKEN available to commands launched from this shell.
  • The value stays in the current terminal session. It never enters your project files.

Silent Prompt Not Working?

  • Cancel the prompt if your token appears visibly in the terminal.
  • Switch to a Bash-compatible shell before repeating the command.
  • Use Help me store my GitHub token in GITHUB_TOKEN without exposing it. for terminal-specific guidance.
  • Keep this terminal session open for the next steps.

Before you send the request, do you expect GitHub to return repository details or reject the credential?

  • Verify the token against your first repository by running:
curl --request GET \
  --url "https://api.github.com/repos/[[OWNER_ONE="first repository owner"]]/[[REPO_ONE="first repository name"]]" \
  --header "Accept: application/vnd.github+json" \
  --header "X-GitHub-Api-Version: 2026-03-10" \
  --header "Authorization: Bearer $GITHUB_TOKEN"

What Does This Request Do?

  • The --url value targets the metadata endpoint for your first repository.
  • The Accept: application/vnd.github+json header asks GitHub for a JSON response.
  • The X-GitHub-Api-Version: 2026-03-10 header pins the request to a documented API version.
  • The Authorization: Bearer $GITHUB_TOKEN header sends the environment variable without placing the literal token in the command.

You should see a JSON object describing your first repository. The response confirms that GitHub accepted the authenticated request.

That is the critical access check complete. Your terminal can now call GitHub without storing the credential in the project.

Request Rejected?

  • Repeat the silent prompt if the token was pasted incorrectly.
  • Confirm the first repository owner matches first repository owner.
  • Confirm the first repository name matches first repository name.
  • Use Help me debug my authenticated GitHub REST API request. for help without revealing the token.

Your API access is working with a read-only token. Next, you will request the first repository's star history and save the response for plotting.

Save Star History Data

Your authenticated GitHub request worked in the previous step. That proves your read-only token can reach the repository data you selected.

A response shown only in the terminal is temporary. Saving the raw JSON creates a reusable snapshot for the charting work ahead.

In this step, get ready to:
  • Request the first repository's privacy-safe star history.
  • Save the complete response inside the data/ folder.
  • Open the saved JSON for inspection.
Fetch and save the response

The star history endpoint returns historical star totals with timestamps. It leaves out individual stargazer identities.

The first repository owner you chose earlier is first repository owner. The matching repository name is first repository name.

  • Switch back to the terminal in your local star-history project workspace.
  • Fetch the complete star history into its local JSON file by running this command:
curl --request GET \
  --url "https://api.github.com/repos/[[OWNER_ONE="first repository owner"]]/[[REPO_ONE="first repository name"]]/star-history" \
  --header "Accept: application/vnd.github+json" \
  --header "Authorization: Bearer $GITHUB_TOKEN" \
  --header "X-GitHub-Api-Version: 2026-03-10" \
  --fail-with-body \
  --create-dirs \
  --output "data/[[OWNER_ONE="first repository owner"]]_[[REPO_ONE="first repository name"]]_star_history.json"

What does this command do?

  • The --url option targets the star history endpoint for your first repository.
  • The Authorization: Bearer $GITHUB_TOKEN header reads your token from the existing shell environment variable. The secret stays out of the saved file.
  • The --fail-with-body option turns an HTTP error into a failed command. It preserves the response body for troubleshooting.
  • The --create-dirs option creates the local data/ folder when needed.
  • The --output option writes the complete response to the repository-specific JSON file.
  • Confirm the curl transfer reaches completion in your terminal.

The response is now stored in a file inside data/. Your token value remains only in the shell environment.

Request did not complete?

  • Confirm that GITHUB_TOKEN is still available in the same terminal session.
  • Check that the fine-grained token can read the first repository.
  • Compare the owner value with the repository page.
  • Compare the repository name with the repository page.

Ask for help with the request without sharing your token: Help me troubleshoot my authenticated GitHub star history request.

Inspect the saved JSON

Python's json.tool module validates JSON syntax. It also formats the response so its structure is easier to inspect.

Before you inspect the file, what shape do you expect privacy-safe star history data to have?

  • Validate the saved response by running this command:
python3 -m json.tool "data/[[OWNER_ONE="first repository owner"]]_[[REPO_ONE="first repository name"]]_star_history.json"

What does this command do?

  • The python3 -m json.tool command parses the saved file as JSON.
  • A successful parse prints an indented version of the complete response.
  • A parsing failure points to a response that is incomplete or is not valid JSON.

You'll see readable JSON containing historical star totals with timestamps. You will not see individual stargazer identities.

  • Scan the formatted output for historical timestamps.
  • Confirm the formatted output includes star totals.

Saved file does not show star history?

  • Check the formatted response for an API error object.
  • Rerun the curl request after correcting the repository owner or name.
  • Confirm that the filename in the inspection command matches the filename created by curl.

Ask for help without pasting your token: Help me inspect my saved star history JSON.

Good work. You now have a valid local snapshot of your first repository's star history for offline plotting.

Your first repository's star history is safely stored. Next, you'll turn those timestamps and totals into a line chart you can open and inspect.

Chart One Repository

Your first repository's GitHub star history is now saved as JSON. That snapshot lets you build the chart without making another API request.

Python can turn the weekly records into chronological dates. Matplotlib can turn those dates into a cumulative growth line.

In this step, get ready to:
  • Convert weekly star buckets into chronological daily records.
  • Calculate a running total of the repository's stars.
  • Save the line chart as a PNG image.
Convert weekly buckets into dates

The saved response contains weekly buckets ordered from newest to oldest. A chart needs those buckets arranged in chronological order.

  • Create chart_star_history.py inside the existing star-history project directory in your code editor.
  • Paste this first section into chart_star_history.py:
import json
from datetime import datetime, timedelta
from pathlib import Path

import matplotlib.pyplot as plt

DATA_PATH = Path("data/OWNER_ONE_REPO_ONE_star_history.json")
CHART_PATH = Path("charts/OWNER_ONE_REPO_ONE_star_history.png")
REPOSITORY = "OWNER_ONE/REPO_ONE"

# Load the saved weekly history for offline plotting
with DATA_PATH.open(encoding="utf-8") as file:
    history = json.load(file)

# Turn newest-first weekly buckets into chronological daily records
dates = []
daily_stars = []
for bucket in reversed(history):
    week_start = datetime.fromtimestamp(bucket["week"])
    for day_offset, star_count in enumerate(bucket["days"]):
        dates.append(week_start + timedelta(days=day_offset))
        daily_stars.append(star_count)

# Report the parsed record count before drawing the chart
print(f"Loaded {len(dates)} daily records for {REPOSITORY}.")

What does this code do?

  • The path constants keep the input file name separate from the output chart name.
  • The json.load() call reads the saved response into a Python list.
  • The reversed(history) loop processes the oldest weekly bucket first.
  • Each week timestamp becomes a starting date. Each value in days becomes the number of stars added on that day.
  • The final print() call confirms how many daily records were parsed.
  • Save chart_star_history.py.
  • Switch back to the terminal from earlier.
  • Verify that the saved data parses by running:
python3 chart_star_history.py

You'll see a line beginning with Loaded. It includes the number of daily records followed by your first repository name.

History file not loading?

  • Confirm that chart_star_history.py sits beside the data directory.
  • Confirm that the saved response is named OWNER_ONE_REPO_ONE_star_history.json.
  • Run the command from inside the existing star-history project directory.

Help me debug why my saved star-history JSON is not loading.

Build and open the cumulative chart

Each daily value records new stars added during that day. A cumulative line keeps a running total so the repository's growth remains visible across the whole timeline.

  • Add this section below the existing print() line in chart_star_history.py:
# Build a running total from each day's new stars
cumulative_stars = []
running_total = 0
for star_count in daily_stars:
    running_total += star_count
    cumulative_stars.append(running_total)

# Create the chart directory and draw the repository's growth
CHART_PATH.parent.mkdir(parents=True, exist_ok=True)
plt.figure(figsize=(10, 6))
plt.plot(dates, cumulative_stars, label=REPOSITORY, linewidth=2)
plt.title(f"GitHub Star History: {REPOSITORY}")
plt.xlabel("Date")
plt.ylabel("Cumulative Stars")
plt.grid(alpha=0.3)
plt.legend()
plt.tight_layout()
plt.savefig(CHART_PATH, dpi=150)
print(f"Saved chart to {CHART_PATH}.")
plt.show()

What does this code do?

  • The running_total variable adds each day's new stars to the count from the previous day.
  • The cumulative_stars list stores one running total for every date.
  • The mkdir() call creates the charts directory when it does not already exist.
  • The plot() call places dates on the horizontal axis. It places cumulative stars on the vertical axis.
  • The savefig() call writes the PNG image before show() opens the chart window.
  • Save chart_star_history.py.

✔️ Awesome, I've got everything!

Your parser and chart logic are ready. Double check that chart_star_history.py is saved before you run it.

ⓧ I'd like to double check the full code

Compare your complete chart_star_history.py file with this version:

import json
from datetime import datetime, timedelta
from pathlib import Path

import matplotlib.pyplot as plt

DATA_PATH = Path("data/OWNER_ONE_REPO_ONE_star_history.json")
CHART_PATH = Path("charts/OWNER_ONE_REPO_ONE_star_history.png")
REPOSITORY = "OWNER_ONE/REPO_ONE"

# Load the saved weekly history for offline plotting
with DATA_PATH.open(encoding="utf-8") as file:
    history = json.load(file)

# Turn newest-first weekly buckets into chronological daily records
dates = []
daily_stars = []
for bucket in reversed(history):
    week_start = datetime.fromtimestamp(bucket["week"])
    for day_offset, star_count in enumerate(bucket["days"]):
        dates.append(week_start + timedelta(days=day_offset))
        daily_stars.append(star_count)

# Report the parsed record count before drawing the chart
print(f"Loaded {len(dates)} daily records for {REPOSITORY}.")

# Build a running total from each day's new stars
cumulative_stars = []
running_total = 0
for star_count in daily_stars:
    running_total += star_count
    cumulative_stars.append(running_total)

# Create the chart directory and draw the repository's growth
CHART_PATH.parent.mkdir(parents=True, exist_ok=True)
plt.figure(figsize=(10, 6))
plt.plot(dates, cumulative_stars, label=REPOSITORY, linewidth=2)
plt.title(f"GitHub Star History: {REPOSITORY}")
plt.xlabel("Date")
plt.ylabel("Cumulative Stars")
plt.grid(alpha=0.3)
plt.legend()
plt.tight_layout()
plt.savefig(CHART_PATH, dpi=150)
print(f"Saved chart to {CHART_PATH}.")
plt.show()

Before you run the finished script, what shape do you expect the repository's growth line to have?

  • Generate and open the chart by running:
python3 chart_star_history.py

You'll see messages beginning with Loaded and Saved chart to in the terminal. A chart window opens with dates along the bottom and cumulative stars up the side.

The line rises whenever the repository gains stars. Flat sections show periods with no new stars.

  • Close the chart window after you inspect the growth line.
  • Find charts/OWNER_ONE_REPO_ONE_star_history.png in your project workspace.

Chart window not appearing?

  • Confirm that charts/OWNER_ONE_REPO_ONE_star_history.png exists in your project workspace.
  • Open the saved PNG from your file browser if the chart window does not appear.
  • Compare the path constants in your file with the full-code tab if no PNG was created.

Help me debug why my Matplotlib chart is not opening or saving.

That's your first growth story plotted from saved API data. Next, you'll place a second repository on the same axes for a direct comparison.

Compare Two Repositories

You saved your first repository's star history as JSON. Your Matplotlib script turns that data into a line chart.

One GitHub repository's curve shows its growth over time. Shared axes let you compare that growth against another project.

In this step, get ready to:
  • Save the second repository's star history as JSON.
  • Extend the charting script with a second cumulative-star series.
  • Verify both repositories appear on one chart with a legend.
Save the second repository's history

The REST API returns each repository's star history independently. A second saved response gives your script another data source without replacing the first one.

  • Switch back to the terminal from the previous step.
  • Press the Up Arrow key until your authenticated curl request for the first repository appears.
  • Replace the repository path in the request with OWNER_TWO/REPO_TWO.
  • Change the output file to data/OWNER_TWO_REPO_TWO_star_history.json.
  • Press Enter to run the edited request.
  • Open data/OWNER_TWO_REPO_TWO_star_history.json in your file editor.
  • Confirm the file contains the second repository's star-history records.

That's the second data source secured. Your comparison can now run entirely from the two saved responses.

Second response not saved?

Confirm the request still includes Authorization: Bearer $GITHUB_TOKEN. Check that the request URL uses your second repository.

Make sure the output path ends with data/OWNER_TWO_REPO_TWO_star_history.json so the first response stays untouched.

Help me check why my second star-history response was not saved correctly.

Build and verify the comparison chart

Each repository needs its own date sequence. Each repository also needs its own cumulative-star sequence. Both lines use the same axes so their shapes remain directly comparable.

What should the comparison script do?

  • The script loads data/OWNER_ONE_REPO_ONE_star_history.json.
  • The script also loads data/OWNER_TWO_REPO_TWO_star_history.json.
  • Each response becomes a separate date series with cumulative star counts.
  • Both lines use one set of date axes with cumulative-star axes.
  • Each line has a repository label.
  • A legend connects each label to its line.
  • The comparison is saved as charts/star_history_comparison.png.
  • The existing charts/OWNER_ONE_REPO_ONE_star_history.png remains untouched.
  • Open chart_star_history.py in the same file editor.
  • Refactor chart_star_history.py to match the comparison design above.
  • Save chart_star_history.py.

✔️ My script matches the design

Your script is ready to test against both saved responses.

ⓧ I'd like a comparison checklist

Check each requirement before you run the script.

  • Load both saved JSON files.
  • Parse a separate date series for each repository.
  • Parse a separate cumulative-star series for each repository.
  • Plot both labeled lines on shared axes.
  • Add a legend to the chart.
  • Save the chart to charts/star_history_comparison.png.

Before you run the script, do you expect the two growth curves to have the same shape?

  • Switch back to your terminal.
  • Press the Up Arrow key until the earlier Python command for chart_star_history.py appears.
  • Press Enter to rerun the script.
  • Open charts/star_history_comparison.png in your image viewer.

You'll see two cumulative-star lines on the same date axes with cumulative-star axes. The legend identifies which curve belongs to each repository.

Comparison chart look incomplete?

If only one line is visible, confirm the second plotting operation uses the second repository's parsed values. Two identical series can also overlap completely.

If the legend is missing, confirm both lines have labels. Make sure the legend is added before the image is saved.

If the comparison image is missing, confirm the output path is charts/star_history_comparison.png.

Help me debug my repository comparison chart.

Your two repositories now share one comparison chart. Next, you'll add a known launch date to see whether the first repository's growth curve reacts.

Mark the Launch Date

Your comparison chart now places both GitHub repositories on one timeline. The curves show when stars accumulated.

The launch date still has no visual anchor. In this step you will use Matplotlib to add one. You can then check whether the curve changes around that moment.

In this step, get ready to:
  • Add your chosen launch date to the chart script.
  • Draw a labeled vertical marker on the shared timeline.
  • Verify the final comparison chart.
Place the launch in context

A launch marker turns one date into a visual reference. Positioning it on the chart timeline keeps it aligned with the star-history records.

  • Return to chart_star_history.py in the editor you used earlier.
  • Find the plotting section immediately above the existing chart-saving code.
  • Update that plotting section with a vertical marker positioned at your chosen LAUNCH_DATE and labeled as the first repository's launch.
  • Save chart_star_history.py.

What does the marker add?

The vertical marker aligns a known event with the same time scale as both star curves. Its label keeps the event readable when you reopen the saved chart.

A nearby change in slope shows a timing relationship. The chart alone cannot establish cause.

Check the marked timeline

The script already reads the two saved JSON files. A fresh run rebuilds the comparison image with the launch marker.

Pause before the next run. Consider whether the launch marker will land before the steepest part of the first curve.

  • Return to the terminal from earlier.
  • Re-run chart_star_history.py with the same Python command from earlier.

You will see both repository curves on shared axes. A labeled vertical marker sits at your chosen launch date.

Your updated comparison chart is saved at charts/star_history_comparison.png.

  • Trace the first repository's curve immediately before the launch marker.
  • Trace the same curve immediately after the launch marker.

Marker missing or misplaced?

  • Confirm that the marker code appears before the code that saves the chart.
  • Check that LAUNCH_DATE uses the same date representation as the plotted x-axis values.
  • Save chart_star_history.py before running it again.

Help me debug the launch marker in my comparison chart.

That is the comparison finished. Your chart now connects star growth with a real launch date.

Secret mission

Write a Launch Impact Brief

The comparison chart marks a known launch date against both star-growth curves. Decide whether the first curve changes around the marker. Use the second repository as context to state what the chart can support.

Clean Up Your Resources

Clean Up Your Resources

Your comparison chart is finished, so now you can choose how much of the project to keep. The workspace is local and authenticated personal use of the GitHub REST API is free, so there are no ongoing costs.

Resources you used:

  • A read-only fine-grained personal access token for OWNER_ONE/REPO_ONE and OWNER_TWO/REPO_TWO.
  • The current shell session containing GITHUB_TOKEN.
  • The local charting script chart_star_history.py.
  • Saved responses in data/OWNER_ONE_REPO_ONE_star_history.json and data/OWNER_TWO_REPO_TWO_star_history.json.
  • Generated images in charts/OWNER_ONE_REPO_ONE_star_history.png and charts/star_history_comparison.png.

Keep everything running

No action needed. Choose this if you want to refresh the API data or compare more repositories later.

  • Keep the fine-grained token limited to its existing read-only access.
  • Leave the local project workspace intact for future chart updates.
  • Use the saved JSON responses to re-plot both repositories without making another API request.
  • Keep charts/star_history_comparison.png as the finished comparison chart.

Pause - I'll come back to this later

End the current session while keeping your project files ready for later. Your read-only token remains active in your GitHub account.

  • Close any open chart image windows.
  • Close the current terminal session to clear GITHUB_TOKEN from that session.
  • Leave the local project workspace in place.

Delete - I don't want to use this again

Remove all project resources and start fresh. This cleanup revokes the project token while leaving your public repositories untouched.

  • Return to the fine-grained personal access token settings page you used earlier.
  • Select the read-only token you created for OWNER_ONE/REPO_ONE and OWNER_TWO/REPO_TWO.
  • Use the token page's deletion control to revoke that token.
  • Confirm the token no longer appears in your fine-grained token list.
  • Close the current terminal session to clear GITHUB_TOKEN from that session.
  • Remove the local project workspace using the instructions for your operating system.

macOS

  • In Finder, return to the location containing the local project workspace from earlier.
  • Select the folder containing chart_star_history.py.
  • Move the selected project folder to Trash.
  • Open Trash.
  • Permanently delete only the selected project folder.
  • Confirm the folder containing chart_star_history.py is no longer present.

Windows

  • In File Explorer, return to the location containing the local project workspace from earlier.
  • Select the folder containing chart_star_history.py.
  • Move the selected project folder to the Recycle Bin.
  • Open the Recycle Bin.
  • Permanently delete only the selected project folder.
  • Confirm the folder containing chart_star_history.py is no longer present.

Nice Work!

Nice Work!

You did it! You built a Python workflow that turns privacy-safe GitHub star history into a visual growth story.

What you learned:

  • Made an authenticated REST API request using a read-only fine-grained token. You kept the credential out of your project files by loading it through a shell environment variable.
  • Saved both repositories' complete star histories as raw JSON files. You can re-plot them offline without making another API request.
  • Built a Python charting script that plots cumulative-star series for two repositories. You placed both curves on shared axes with a legend. You added a labeled launch-date marker to connect a known event with the shape of the growth curve.
  • Secret Mission: Completed an optional Secret Mission to push your star-history analysis skills further.

Ready to quiz yourself?