Skip to main content

A lightweight library to fetch and summarize GitHub user data

Project description

🧑‍💻 ghprofile

License

A lightweight Python library to fetch and summarize a GitHub user's public profile and repository stats, including followers, bio, starred repos, and pinned repositories.

🚀 Features

  • ✅ Get user bio, followers, and following count
  • ✅ List all public repositories
  • ✅ Count total stars across repositories
  • ✅ Fetch pinned repositories (via scraping)
  • ✅ Custom error handling for failed API calls
  • ✅ Simple to use and extend

📦 Installation

pip install ghprofile

🔑 Authentication

You need a GitHub personal access token to use the GitHub API

🧑‍💻 Usage

from ghprofile.core import Ghprofile

gh = Ghprofile("octocat", "your_github_token")

print(gh.get_bio())         # → "A mysterious octocat."
print(gh.get_followers())   # → 5400
print(gh.get_repo())        # → ['hello-world', 'test-repo']
print(gh.get_stars())       # → 42
print(gh.get_pinned_repos())# → ['hello-world', 'octo-repo']

📁 Project Structure

ghprofile/
├── core.py          # Main class Ghprofile
├── __init__.py
tests/
├── test_core.py     # Unit tests using pytest
pyproject.toml       # Build and tool config
README.md

📋 Error Handling

All exceptions are wrapped under a custom exception class:

from ghprofile.core import GhprofileError

try:
    gh = Ghprofile("unknownuser", "badtoken")
except GhprofileError as e:
    print("Something went wrong:", e)

🤝 Contributing

Contributions are welcome! If you’d like to:

Add new features (e.g. commit history, language breakdown) Improve error handling or test coverage Refactor or optimize the code Just fork the repo, create a new branch, and open a pull request. Don't forget to write or update tests for your changes.

License

This project is licensed under the MIT License.
You are free to use, modify, and distribute this software with proper attribution.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghprofile-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ghprofile-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file ghprofile-0.1.0.tar.gz.

File metadata

  • Download URL: ghprofile-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.6

File hashes

Hashes for ghprofile-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5209727a7e10b3bbe2381f279acf027daf2a03bc87385fb79f657a9c7d786a1d
MD5 51f5f4dbfbf056b4b41cb47731725480
BLAKE2b-256 f079059dff6be46b8a53aa35127ac32f0471db10d39eb972684d99b5ef2aeffe

See more details on using hashes here.

File details

Details for the file ghprofile-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ghprofile-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.6

File hashes

Hashes for ghprofile-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb9218c8eb72916e8ab516b66024533e08791aeacd21e5cd14b9bc4a41f3d883
MD5 ea5f5978410fa1b7e76ec0c0ef521d50
BLAKE2b-256 2e411c7868f79df6c97fac4b89fa4bb7c2f20a08af946f95da6d59983637a451

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page