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

Uploaded Source

Built Distribution

write_githubstat-0.1.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: write_githubstat-0.1.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1040-azure

File hashes

Hashes for write_githubstat-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d514137bcd6c3e6137dab19d5a1499451ffbbc82295c890fa0c49c9f746b8bde
MD5 3877969a220d4a79d73defaf5286f53f
BLAKE2b-256 821ef7904a4e264462e1956a34d9cd64e3f483ec760a580770c432926a585a89

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: write_githubstat-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1040-azure

File hashes

Hashes for write_githubstat-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bf703bbce578315682360bc93f6442d1f6e90ff1848bb92c88a234f4441b3577
MD5 bc0931bc91d55fcf5b29b61f2d065410
BLAKE2b-256 401471578f15be65c90a2f29fe90f33ee0807f3093bc08396cffb0a9fa1b0a09

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