1. pypiview module

Utilities to lookup into pypi stats.

Warning

requires pandas and vanity packages

class PYPIView(packages, verbose=True)[source]

Plot number of downloads versus time of a PYPI package.

from pypiview import PYPIView
p = PYPIView(["requests"], verbose=False)
p.plot(logy=True)

(Source code, png, hires.png, pdf)

_images/references-1.png

The attribute df contains the dataframe with all results. The attribute tss contains the individual TimeSeries for each package as returned by get_data_one_package().

Constructor

Parameters:
  • packages – list of packages or single package
  • verbose (bool) – print some information.
get_data_one_package(package)[source]

Return the data for one package

Parameters:pacakge (str) – a single package name
Returns:a Pandas time series.
plot(lw=2, fontsize=16, marker='o', logy=False)[source]

plot the number of downloads

The data used is the data stored in the df attribute.

Parameters:
  • lw (int) – width of the curves
  • fontsize (int) – fontsize used in titles
  • marker
  • logy (bool) – set y-axis to logarithmic scale
  1. first plot shows the cumulative downloads
  2. second plot shows the individual downloads

(Source code, png, hires.png, pdf)

_images/references-2.png