Skip to main content

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.

PyPI version

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.2.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

write_githubstat-0.2.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file write_githubstat-0.2.0.tar.gz.

File metadata

  • Download URL: write_githubstat-0.2.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for write_githubstat-0.2.0.tar.gz
Algorithm Hash digest
SHA256 44ab6d58cb8a01eeb8ad9a68177ba98fff1a814a35b7057c00c8ea48de71be19
MD5 58bd8459c1a2687fbdda1a4aeda3c0aa
BLAKE2b-256 a2b194855972ada51cd2cbb8e37567b906a649760369559433ae188d85921f22

See more details on using hashes here.

Provenance

File details

Details for the file write_githubstat-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: write_githubstat-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for write_githubstat-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6b8aa991c572f3d44bd28550ce1788d43589d4f84e26694daeecabf89d155b7
MD5 9f49132be1f22c197cb25f9c6347c9ce
BLAKE2b-256 ea3e17a5e68cc6804034dbe7738c6e825ddf5f9d9d62ea1f51fc0089ee24ac44

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page