npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mcpyver

v0.0.4-beta.1

Published

Easily detect all of the Python versions on your machine

Downloads

17

Readme

mcpyver

Travis Coverage Status Code Climate]

A node library for detecting all of the Python installations on your machine (and pips, virtual environments, and more!). It will rescue you when your Python is throwing errors and spitting fire.

Note: I didn't call it macpyver because then you'd think it only works on macs. But that isn't true! It totally works on Windows, too!

Installation

npm install mcpyver

Usage

Finding Python versions

Are you super curious about your Python installations? mcpyver can help.

let mcpyver = require('mcpyver')

mcpyver.getPythonList().then((pythons) => {
  console.log(`You have ${pythons.length} Pythons installed`)
  for(let python of pythons) {
    console.log(`${python.version} at ${python.realpath}`)
  }
})
You have 7 Pythons installed
3.6.0 at /Users/jonathansoma/anaconda/bin/python3.6
2.7.13 at /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
2.7.10 at /usr/bin/python
3.5.2 at /usr/local/Cellar/python3/3.5.2_2/Frameworks/Python.framework/Versions/3.5/bin/python3.5
2.6.9 at /System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
2.7.10 at /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7

mcpyver also tries to guess how you installed the Pythons, follows symlinks, and other fun stuff.

Finding pip installations

But what about pip and its delightful packages?

let mcpyver = require('mcpyver')

mcpyver.getPipList().then((pips) => {
  console.log(`You have ${pips.length} pips installed`)
  for(let pip of pips) {
    console.log(`pip ${pip.version} has ${pip.packages.length} packages in ${pip.packageDir}`)
  }
})
You have 3 pips installed
pip 9.0.1 has 145 packages in /Users/username/anaconda/lib/python3.6/site-packages
pip 9.0.1 has 48 packages in /usr/local/lib/python2.7/site-packages
pip 8.1.2 has 76 packages in /usr/local/lib/python3.5/site-packages

You could loop through the packages, too, if you really wanted to.

Finding other things

  • getPythonList()
  • getPipList()
  • getJupyterList()
  • getJupyter()
  • getVirtualEnv()
  • getConda()

Lots of other things in there, maybe one day there will also be appropriate documentation!

Testing

My tests are so bad help

Contributing

Speaking of helping: please read CONTRIBUTING.md, good friends.

License

MIT

Acknowledgements

Everyone who has ever tried to install Python on their machine without a PhD and extensive postdoc work in Python Installation Methodologies. Some of these people were my students.