Metadata-Version: 2.1
Name: write-githubstat
Version: 0.1.5
Summary: write-githubstat makes it easy to collect, filter and save github statistics to csv files.
License: Apache 2.0
Author: David Vegh
Author-email: david.andras.vegh+github@gmail.com
Requires-Python: >=3.8
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: pandas (>=1.5.0,<2.0.0)
Requires-Dist: requests (>=2.0.0,<3.0.0)
Project-URL: documentation, https://github.com/veghdev/write-githubstat
Project-URL: homepage, https://github.com/veghdev/write-githubstat
Project-URL: repository, https://github.com/veghdev/write-githubstat
Description-Content-Type: text/markdown

# 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 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](https://github.com/veghdev/write-condastat/blob/main/LICENSE).

