Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/veghdev/write-githubstat
write-githubstat makes it easy to collect, filter and save github statistics to csv files.
https://github.com/veghdev/write-githubstat
Last synced: 3 months ago
JSON representation
write-githubstat makes it easy to collect, filter and save github statistics to csv files.
- Host: GitHub
- URL: https://github.com/veghdev/write-githubstat
- Owner: veghdev
- License: apache-2.0
- Created: 2022-05-09T14:13:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-09T17:21:36.000Z (6 months ago)
- Last Synced: 2024-09-13T00:13:47.744Z (4 months ago)
- Language: Python
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# write-githubstat
write-githubstat makes it easy to collect, filter and save github statistics to csv files.[![PyPI version](https://badge.fury.io/py/write-githubstat.svg)](https://badge.fury.io/py/write-githubstat)
# About The Project
write-githubstat makes it easy to collect, filter and save github statistics to csv files.
# Installation
write-githubstat requires `pandas` package.
```sh
pip install write-githubstat
```# Usage
```python
import logging
from pathlib import Pathfrom writegithubstat import WriteGithubStat, GithubAuth, Referrers, Paths, StarsForks, ViewsClones
logging.basicConfig(level=logging.INFO)
owner = "owner"
repo = "repo"
token = "token"auth = GithubAuth(owner, repo, token)
write_githubstat = WriteGithubStat(auth)
for stat_type in (
Referrers(owner, repo),
Paths(owner, repo),
StarsForks(owner, repo),
ViewsClones(owner, repo, write_githubstat.date),
):
year = write_githubstat.date[0:4]
outdir = "stats"
outfile = (
f"{year}_githubstat_{stat_type.__class__.__name__.lower()}.csv"
)
csv = Path(outdir) / outfile
write_githubstat.write_stat(stat_type, csv)
```# License
Copyright © 2023.
Released under the [Apache 2.0 License](https://github.com/veghdev/write-condastat/blob/main/LICENSE).