Skip to content

abingham/python-version-probe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travis CI Build Status

Landscape.io Code health

python version probe

A tool for detecting the Python major version for a body of source code.

Installation

Install with pip:

pip install python_version_probe

easy_install:

easy_install python_version_probe

or manually:

python setup.py install

Quickstart

You can use the API:

from version_probe import detect_version

# Find the version used in sources files under ~/projects/ipv7
v = detect_version("~/projects/ipv7")

# something so advanced is, of course, written in Python 3
assert v == 3

v = detect_version("/opt/old_project")
assert v == 2

try:
    detect_version("~/projects/experimental")
except ValueError as e:
    print("Syntax error detected in the experimental project: {}".format(e))

or the python_version_probe command-line tool:

% python_version_probe /projects/nuclear_launch_control
3

About

A tool to probe python source code for its major language version.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors