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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for write_githubstat-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0891424b8a1ebb16f28360b62fa2efcc15b1c98ed4fa3e9e7d980b24e5b73b5a
MD5 cd265a96524133621cd0c024015792dd
BLAKE2b-256 325fe36c1acc00a3977cc343564fc91aa43627cdff2b5b09d773d625453ceb57

See more details on using hashes here.

File details

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

File metadata

  • Download URL: write_githubstat-0.2.1-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.4 Linux/6.5.0-1022-azure

File hashes

Hashes for write_githubstat-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4bbe40b756da512dd830f32e43c8f1af9cad16c2f1c2d578d9e0d3ed57c9f225
MD5 648f530c1d1a4dad90113cb42fc3e843
BLAKE2b-256 e3bdb6ee738ee2213cad11845fecf1231e68d639eb2b3203f4442b4d824dbf0f

See more details on using hashes here.

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