pythonfinder.pythonfinder module

class pythonfinder.pythonfinder.Finder(**data)[source]

Bases: FinderBaseModel

create_system_path()[source]
Return type

SystemPath

find_all_python_versions(major=None, minor=None, patch=None, pre=None, dev=None, arch=None, name=None)[source]
Return type

list[PathEntry]

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

Find the python version which corresponds most closely to the version requested.

Parameters
  • major (str | int | None) – The major version to look for, or the full version, or the name of the target version.

  • minor (int | None) – The minor version. If provided, disables string-based lookups from the major version field.

  • patch (int | None) – The patch version.

  • pre (bool | None) – If provided, specifies whether to search pre-releases.

  • dev (bool | None) – If provided, whether to search dev-releases.

  • arch (str | None) – If provided, which architecture to search.

  • name (str | None) – Name of the target python, e.g. anaconda3-5.3.0

  • sort_by_path (bool) – Whether to sort by path – default sort is by version(default: False)

Return type

PathEntry | None

Returns

A new PathEntry pointer at a matching python version, if one can be located.

ignore_unsupported: bool
classmethod parse_major(major, minor=None, patch=None, pre=None, dev=None, arch=None)[source]
Return type

dict[str, Any]

path_prepend: Optional[str]
sort_by_path: bool
system: bool
system_path: Optional[SystemPath]
which(exe)[source]
Return type

PathEntry | None