https://github.com/grachale/track_github
This Flask application collects and displays statistics on GitHub events for specified repositories. It includes functionalities to load configuration from a JSON file, establish a connection to a PostgreSQL database, retrieve GitHub events, and calculate statistics on the average time between events for every type of event.
https://github.com/grachale/track_github
fastapi flask github json postgresql python
Last synced: 3 months ago
JSON representation
This Flask application collects and displays statistics on GitHub events for specified repositories. It includes functionalities to load configuration from a JSON file, establish a connection to a PostgreSQL database, retrieve GitHub events, and calculate statistics on the average time between events for every type of event.
- Host: GitHub
- URL: https://github.com/grachale/track_github
- Owner: grachale
- Created: 2024-02-17T09:31:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-17T09:33:51.000Z (over 1 year ago)
- Last Synced: 2025-01-13T01:20:37.926Z (9 months ago)
- Topics: fastapi, flask, github, json, postgresql, python
- Language: Python
- Homepage:
- Size: 167 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Event Statistics Flask App
This Flask application collects and displays statistics on GitHub events for specified repositories. It includes functionalities to load configuration from a JSON file, establish a connection to a PostgreSQL database, retrieve GitHub events, and calculate statistics on the average time between events for every type of event.
## How to Run
To run the script go to the `app/src` directory, provide it with a configuration file path as a command-line argument:```bash
python main.py
```The configuration file should be in JSON format. It contains the necessary settings and information required for the app to run, such as PostgreSQL database information like host, user and name of database. (check an example - `app/configs/config.json`) Before starting the app, make sure that you have started provided database.
Example of usage (must be executed in the `app/src` directory):
```bash
python main.py ../configs/config.json
```## Access the API Endpoints
- Once the application is running, you can access the following endpoints:- **Statistics API Endpoint:**
- Endpoint: `http://localhost:5000/statistics`
- Method: GET- **Updating Data:**
- Endpoint: `http://localhost:5000/update`
- Method: GET## Example of Usage
- Starting the app

- Simulating of accessing the API Endpoints with scripts from `app/helpers`
