Skip to content

Python Module

You can import the module directly.

import npmstat

r = npmstat.get_package("@cssnr/vitepress-swiper")
print(f"{r.from_cache=}")
print(r.json())

Or import the api directly.

from npmstat import api

r = api.get_downloads("@cssnr/vitepress-swiper", "last-week")
print(f"{r.from_cache=}")
print(r.json())

api.session.cache.clear()
print("cache cleared")

For more details see the api.py source code.

This API is incomplete and may change in the future.

 

Question

If you need help getting started or run into any issues, support is available!