Skip to content

Commit

Permalink
🚀first successful data collection and dump
Browse files Browse the repository at this point in the history
  • Loading branch information
SkalskiP committed Jan 3, 2024
1 parent 6a56842 commit 636a744
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
venv/
idea/
.idea/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ Star-Track is a user-friendly utility for tracking GitHub repository statistics.
```bash
pip install -r requirements.txt
```

## ⚙️ execute

```bash
python -m startrack.app
```
2 changes: 2 additions & 0 deletions data/data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
,roboflow/TFRecords,roboflow/voc2coco,roboflow/heatmap.node,roboflow/BCCD_Dataset,roboflow/tensorflow-object-detection-faster-rcnn,roboflow/yolov3,roboflow/cornelius,roboflow/EfficientDet,roboflow/Monk_Object_Detection,roboflow/synthetic-fruit-dataset,roboflow/floodfill.js,roboflow/keras-yolo3,roboflow/fast-ai-resnet32,roboflow/roboflow-node,roboflow/darknet,roboflow/roboflow-python,roboflow/pytorch-YOLOv4,roboflow/tfjs-models,roboflow/ScaledYOLOv4,roboflow/roboflow-nest,roboflow/supabase-js,roboflow/streamlit-bccd,roboflow/tfjs,roboflow/inference-server-old,roboflow/jetson,roboflow/firebaseui-web,roboflow/video-inference,roboflow/roboflow-api-snippets,roboflow/roboflow-jetson-license-plate,roboflow/blobconverter,roboflow/rabbit-deterrence,roboflow/yolor,roboflow/YOLOX,roboflow/roboflow-object-tracking,roboflow/neuralhash-collisions,roboflow/zero-shot-object-tracking,roboflow/tensorrtx,roboflow/blackjack-basic-strategy,roboflow/yolov5-custom-training-tutorial,roboflow/server-benchmark,roboflow/ghost-detector,roboflow/neuralhash_prefix_caption,roboflow/yolov5,roboflow/markdown-it-imsize,roboflow/smooth-frame,roboflow/rickblocker,roboflow/RoboflowExpoExample,roboflow/roboflow-100-benchmark,roboflow/expo-image-picker-multiple,roboflow/YOLOv6,roboflow/FastMOT,roboflow/.github,roboflow/stacked-boxes-email-notification,roboflow/template-python,roboflow/tao-toolkit-with-roboflow,roboflow/external-bugtracker,roboflow/dji-aerial-georeferencing,roboflow/roboflow-ios-starter,roboflow/clip-benchmark,roboflow/roboflow-computer-vision-utilities,roboflow/roboflow-react-app,roboflow/cra-template-roboflow-react-app,roboflow/OBS-Controller,roboflow/yolov7,roboflow/roboflow-100-3d-website,roboflow/stable-diffusion-demo,roboflow/roboflow-cli,roboflow/deploy-models-with-grpc-pytorch-asyncio,roboflow/notebooks,roboflow/supervision,roboflow/ppe-detection,roboflow/auto-annotate,roboflow/streamlit-web-app,roboflow/rtsp-server,roboflow/trt-demos,roboflow/cookbooks,roboflow/ultralytics-roboflow,roboflow/supashim,roboflow/quickstart-python,roboflow/homepage-demo,roboflow/polygonzone,roboflow/magic-scissors,roboflow/ODinW-RF100-challenge-issues,roboflow/scavenger-hunt,roboflow/roboflow-collect,roboflow/celebrity-doppelganger,roboflow/cvevals,roboflow/GroundingDINO_old,roboflow/segment-anything,roboflow/yolov8-OpenVINO,roboflow/roboflow-swift,roboflow/GroundingDINO,roboflow/roboflow-swift-examples,roboflow/Grounded-Segment-Anything,roboflow/ultralytics-yolov8-seg-coreml-nms,roboflow/inference,roboflow/roboflow-swift-macos,roboflow/inference-client,roboflow/inference-dashboard-example,roboflow/lenny,roboflow/roboflow-red,roboflow/CLIP,roboflow/universe-widget,roboflow/supervision-annotators-hf-space,roboflow/clip_video_app,roboflow/roboflow_cloud_upload,roboflow/webcamGPT,roboflow/awesome-openai-vision-api-experiments,roboflow/ezautodistill,roboflow/foundation-vision-benchmark,roboflow/gpt-checkup,roboflow/SoM,roboflow/multimodal-maestro,roboflow/cog-vlm-client,autodistill/autodistill-clip,autodistill/autodistill-owl-vit,autodistill/autodistill-detic,autodistill/autodistill-yolov5,autodistill/autodistill-detr,autodistill/autodistill-yolonas,autodistill/autodistill,autodistill/autodistill-grounded-sam,autodistill/autodistill-yolov8,autodistill/.github,autodistill/autodistill-grounding-dino,autodistill/autodistill-vit,autodistill/autodistill-dinov2,autodistill/autodistill-sam-clip,autodistill/autodistill-base-model-template,autodistill/autodistill-target-model-template,autodistill/autodistill-blip,autodistill/autodistill-albef,autodistill/autodistill-open-flamingo,autodistill/autodistill-fastsam,autodistill/autodistill-blipv2,autodistill/autodistill-seggpt,autodistill/autodistill-llava,autodistill/autodistill-fastvit,autodistill/autodistill-kosmos-2,autodistill/autodistill-fuyu,autodistill/autodistill-metaclip,autodistill/autodistill-owlv2,autodistill/autodistill-rekognition,autodistill/autodistill-azure-vision,autodistill/autodistill-gcp-vision,autodistill/autodistill-gpt-4v,autodistill/autodistill-roboflow-universe,autodistill/autodistill-altclip,autodistill/autodistill-codet,autodistill/autodistill-vlpart,autodistill/autodistill-transformers,autodistill/autodistill-hls-geospatial,autodistill/autodistill-segment-anything,autodistill/autodistill-sam-hq,autodistill/sam-hq,autodistill/SLiMe,autodistill/autodistill-remote-clip,autodistill/autodistill-grounded-edgesam,autodistill/EdgeSAM,autodistill/autodistill-gemini
2024-01-03,2,99,1,1,78,11,0,2,19,3,1,18,2,3,57,163,34,1,2,7,0,3,0,13,0,0,39,17,3,0,14,5,14,1,147,343,0,24,8,0,0,1,4,0,1,11,12,206,0,0,0,0,1,38,1,1,138,12,1,27,6,0,5,0,4,3,5,22,3559,8357,0,34,6,3,3,6,0,15,21,20,12,9,1,4,17,0,28,0,0,5,2,3,2,1,0,690,0,11,4,1,2,0,0,4,13,0,216,1522,0,3,7,2,841,10,5,3,10,1,1,4,1194,28,34,0,8,2,7,8,3,0,4,1,0,4,1,2,3,0,3,2,16,1,0,0,0,24,1,0,0,5,1,0,1,3,0,0,2,22,2,1
52 changes: 43 additions & 9 deletions startrack/app.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
import os
from datetime import datetime
from typing import List
import pandas as pd

from startrack.config import GITHUB_TOKEN_ENV
from startrack.core import list_organization_repositories, RepositoryType, \
RepositoryData
from startrack.core import (
list_organization_repositories,
RepositoryType,
RepositoryData,
to_dataframe
)

GITHUB_TOKEN = os.environ.get(GITHUB_TOKEN_ENV, None)
ORGANIZATION_NAME = "roboflow"
ORGANIZATION_NAMES = ["roboflow", "autodistill"]


def save_to_csv(df: pd.DataFrame, directory: str, filename: str) -> None:
"""
Save a DataFrame to a CSV file in the specified directory.
Args:
df (pd.DataFrame): The DataFrame to save.
directory (str): The directory where the CSV file will be saved.
filename (str): The name of the CSV file.
"""
if not os.path.exists(directory):
os.makedirs(directory)

file_path = os.path.join(directory, filename)
df.to_csv(file_path)


def get_all_organization_repositories(
Expand All @@ -30,13 +52,25 @@ def get_all_organization_repositories(
return all_repositories


repositories_json = get_all_organization_repositories(
github_token=GITHUB_TOKEN,
organization_name=ORGANIZATION_NAME,
repository_type=RepositoryType.PUBLIC)
all_repositories_json = []
for organization_name in ORGANIZATION_NAMES:
repositories_json = get_all_organization_repositories(
github_token=GITHUB_TOKEN,
organization_name=organization_name,
repository_type=RepositoryType.PUBLIC)
all_repositories_json.extend(repositories_json)

repositories = [
RepositoryData.from_json(repository_json)
for repository_json
in repositories_json]
in all_repositories_json]
df = to_dataframe(repositories)
df = df.set_index('full_name').T

current_date = datetime.now().strftime("%Y-%m-%d")
df.index = [current_date]

print(repositories)
save_to_csv(
df=df,
directory='data',
filename='data.csv')
20 changes: 20 additions & 0 deletions startrack/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from enum import Enum
from typing import List, Dict, Any

import pandas as pd
import requests


Expand Down Expand Up @@ -85,3 +86,22 @@ def list_organization_repositories(

response = requests.get(url, headers=headers, params=params)
return response.json()


def to_dataframe(repositories: List[RepositoryData]) -> pd.DataFrame:
"""
Convert a list of RepositoryData objects into a pandas DataFrame.
Args:
repositories (List[RepositoryData]): A list of RepositoryData objects.
Returns:
pd.DataFrame: A DataFrame where each row represents a repository, with columns
for the repository's name and star count.
"""
data = [
{'full_name': repository.full_name, 'star_count': repository.star_count}
for repository
in repositories
]
return pd.DataFrame(data)

0 comments on commit 636a744

Please sign in to comment.