pythonfinder.models.mixins module

class pythonfinder.models.mixins.BaseFinder[source]

Bases: object

classmethod create(*args, **kwargs)[source]
property expanded_paths
get_versions()[source]

Return the available versions from the finder

property pythons
property version_paths
class pythonfinder.models.mixins.BasePath(path=None, children=NOTHING, only_python=False, name=NOTHING, py_version=None, pythons=NOTHING, is_dir=None, is_executable=None, is_python=None)[source]

Bases: object

property as_python
property children
find_all_python_versions(major=None, minor=None, patch=None, pre=None, dev=None, arch=None, name=None)[source]

Search for a specific python version on the path. Return all copies

Parameters
  • major (int) – Major python version to search for.

  • minor (int) – Minor python version to search for, defaults to None

  • patch (int) – Patch python version to search for, defaults to None

  • pre (bool) – Search for prereleases (default None) - prioritize releases if None

  • dev (bool) – Search for devreleases (default None) - prioritize releases if None

  • arch (str) – Architecture to include, e.g. ‘64bit’, defaults to None

  • name (str) – The name of a python version, e.g. anaconda3-5.3.0

Returns

A list of PathEntry instances matching the version requested.

Return type

List[PathEntry]

find_python_version(major=None, minor=None, patch=None, pre=None, dev=None, arch=None, name=None)[source]

Search or self for the specified Python version and return the first match.

Parameters
  • major (int) – Major version number.

  • minor (int) – Minor python version to search for, defaults to None

  • patch (int) – Patch python version to search for, defaults to None

  • pre (bool) – Search for prereleases (default None) - prioritize releases if None

  • dev (bool) – Search for devreleases (default None) - prioritize releases if None

  • arch (str) – Architecture to include, e.g. ‘64bit’, defaults to None

  • name (str) – The name of a python version, e.g. anaconda3-5.3.0

Returns

A PathEntry instance matching the version requested.

get_name()[source]
get_py_version()[source]
property is_dir
property is_executable
property is_python
name
next()[source]
only_python
path
property py_version
property pythons
which(name)[source]

Search in this path for an executable.

Parameters

executable (str) – The name of an executable to search for.

Returns

PathEntry instance.