write-githubstat makes it easy to collect, filter and save github statistics to csv files.
Project description
write-githubstat
write-githubstat makes it easy to collect, filter and save github statistics to csv files.
About The Project
write-githubstat makes it easy to collect, filter and save github statistics to csv files.
Installation
write-githubstat requires pandas
package.
pip install write-githubstat
Usage
import logging
from pathlib import Path
from 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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
write_githubstat-0.1.4.tar.gz
(7.1 kB
view hashes)
Built Distribution
Close
Hashes for write_githubstat-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4044b8d333dfeb2bae65674e823d4db59b086659e62a69774afb0f4d0c271177 |
|
MD5 | d7e1ddb17eaa0cc70cb85e1f80c16466 |
|
BLAKE2b-256 | af78018c9b71088877722b910de64df7e60db57386c4779f1eda0b184f4e44ba |