{"id":21189144,"url":"https://github.com/developersindia/metrics","last_synced_at":"2025-07-10T02:31:33.502Z","repository":{"id":62999670,"uuid":"533008952","full_name":"developersIndia/metrics","owner":"developersIndia","description":"📈 developersIndia community metrics/stats API","archived":false,"fork":false,"pushed_at":"2024-11-17T15:39:52.000Z","size":263,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-17T16:37:37.306Z","etag":null,"topics":["api","developersindia","praw-reddit","python3","static-api","subreddit-analytics","subreddit-metrics","subreddit-stats"],"latest_commit_sha":null,"homepage":"https://developersindia.github.io/metrics/data/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developersIndia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-09-05T18:05:39.000Z","updated_at":"2024-11-17T15:39:55.000Z","dependencies_parsed_at":"2024-01-15T17:16:40.992Z","dependency_job_id":"fd883347-c560-4617-b179-da07b81b1924","html_url":"https://github.com/developersIndia/metrics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developersIndia%2Fmetrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developersIndia%2Fmetrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developersIndia%2Fmetrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developersIndia%2Fmetrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developersIndia","download_url":"https://codeload.github.com/developersIndia/metrics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225614722,"owners_count":17496938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","developersindia","praw-reddit","python3","static-api","subreddit-analytics","subreddit-metrics","subreddit-stats"],"created_at":"2024-11-20T18:50:18.866Z","updated_at":"2024-11-20T18:50:19.592Z","avatar_url":"https://github.com/developersIndia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# metrics 📈\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg)](#contributors-)\n[![Discord](https://img.shields.io/discord/669880381649977354?color=%237289da\u0026label=Discord\u0026logo=Discord)](https://discordapp.com/invite/MKXMSNC)\n[![Subreddit subscribers](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fdevelopersindia.github.io%2Fmetrics%2Fdata%2F\u0026query=%24.totalMembers\u0026suffix=%20members\u0026style=flat\u0026logo=reddit\u0026label=r%2FdevelopersIndia\u0026color=orange\u0026link=https%3A%2F%2Fwww.reddit.com%2Fr%2FdevelopersIndia\n)](https://www.reddit.com/r/developersIndia/)\n\n\u003e Generate developersIndia Community Stats from Subreddit\n\nCurrently the stats are generated in following JSON format:\n\n```json\n{\n    \"totalMembers\": 66600,\n    \"lastMonthUniquePageViews\": 79519,\n    \"lastMonthTotalPageViews\": 1286500,\n    \"yesterdayUniquePageViews\": 18929,\n    \"yesterdayTotalPageViews\": 71916,\n    \"discordTotalMembers\": 7269,\n    \"discordTotalActiveMembers\": 633\n}\n```\n\n## Setup 👷\n\n1. Clone the repo\n\n   ```bash\n   git clone https://github.com/developersIndia/metrics.git\n   ```\n2. Initialise a virtual environment.\n\n   ```bash\n   cd metrics\n   python3 -m venv venv\n   source venv/bin/activate\n   ```\n3. Install dependencies\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n4. Export environment variables.\n   * Reddit(Make sure you are have moderator privileges for the subreddit you want stats for).\n      ```\n      export REDDIT_CLIENT_ID=\u003cYOU_REDDIT_APP_CLIENT_ID\u003e\n      export REDDIT_CLIENT_SECRET=\u003cYOU_REDDIT_APP_CLIENT_SECRET\u003e\n      export REDDIT_PASSWORD=\u003cREDDIT_PASSWORD\u003e\n      export REDDIT_USER=\u003cREDDIT_USERNAME\u003e\n      ```\n   * Discord(If possible set expiry to never)\n      ```\n      export DISCORD_INVITE_CODE=\u003cYOUR_DISCORD_INVITE_CODE\u003e\n      ```\n## Testing\n\nRun the following command to run the test suite:\n```bash\npython -m unittest\n```\n\n## Resources \u0026 Learning Material 📚\n\n- [PRAW Docs](https://praw.readthedocs.io/en/latest/code_overview/models/subreddit.html#praw.models.Subreddit.traffic)\n\n# 📜 License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://animesh-ghosh.github.io/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/34956994?v=4?s=100\" width=\"100px;\" alt=\"MaDDogx\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMaDDogx\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/developersIndia/metrics/commits?author=Animesh-Ghosh\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/developersIndia/metrics/commits?author=Animesh-Ghosh\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://imkaka.github.io/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/27620628?v=4?s=100\" width=\"100px;\" alt=\"Anil Khatri\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAnil Khatri\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/developersIndia/metrics/commits?author=imkaka\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopersindia%2Fmetrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopersindia%2Fmetrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopersindia%2Fmetrics/lists"}