Skip to content
David Vegh edited this page Apr 18, 2022 · 23 revisions

Tutorial

write-pypistat makes it easy to collect, filter and save pypi statistics to csv files.

Initilaize a new WritePypiStat class

WritePypiStat's constructor has two parameter:

  • package : str
    name of the target pypi package
  • outdir : str, optional
    path of the directory where the gathered data will be saved into csv files (default None)

Example - Initilaize a WritePypiStat class

In these examples we initilaize a WritePypiStat class in order to collect statistics about write-pypistat pypi package.

Example - Initilaize without outdir

Because outdir is None the gathered statistics will be only printed to the console.

from writepypistat import WritePypiStat

write_pypistat = WritePypiStat("write-pypistat")

Example - Initilaize with outdir

Because outdir is not None the gathered statistics will be saved into csv files too.

from writepypistat import WritePypiStat

write_pypistat = WritePypiStat("write-pypistat", "stats/write-pypistat")

Example - Change outdir

outdir can be changed at anytime.

from writepypistat import WritePypiStat

write_pypistat = WritePypiStat("write-pypistat", "stats")

write_pypistat.outdir = "stats/write-pypistat"
Clone this wiki locally