Overview of My Submission
This project is a small service whose purpose is to provide stats about GitHub repositories. It pulls info about the commits and draw some conclusions. It's intended to be integrated in a micro-service architecture.
I didn't provide any UI since I knew about this hackaton lately.
Submission Category:
Wacky Wildcards
Language Used
Python
Link to Code
Gitlytics
A service powered by Redis Streams to provide stats about Github repositories.
How it works
How the data is stored:
-
repositories
is a stream where information is added about repositories to analyze. - For each analyzed repository
-
repos:{owner}:{repo}
provides result of analysis
-
How the data is accessed:
- List of Github repositories in process
XRANGE repositories - +
- Result of repository analysis
GET repos:{owner}:{repo}
How to run it locally?
Prerequisites
- Python 3.10
- poetry 1.1.x
- Docker (optional)
Local installation
# use this to start redis or do it manually
export GLC_REDIS_PORT=6379 # modify this to customize your redis port
docker-compose up -d
cd etl
cp etl/.env.example etl/.env # customize to your environment
# install dependencies
poetry install
# activate your virtual environment
poetry shell
python etl/main.py
In another tab:
# In another tab, use a redis client to create new tasks
poetry shell
owner=a_github_username
repo=a_repo_of_owner
XADD repositories * owner "$owner"
…- Check out Redis OM, client libraries for working with Redis as a multi-model database.
- Use RedisInsight to visualize your data in Redis.
- Sign up for a free Redis database.
Top comments (0)