Skip to main content

Utility command line tool to manage python versions and virtual environments

Project description

Pynball

Centralized management and utilization of all your Python versions, installations and virtual environments.

PyPI Downloads Status Python Version Format tests Codecov pre-commit.ci CodeFactor Codeclimate CodeQl readthedocs pre-commit Imports: isort Code style: black Checked with mypy security: bandit Commitizen friendly Conventional Commits DeepSource license

You may have a requirement for development on various versions of Python. Or you may have a mixture of installations including pyenv, custom installations, system installations etc. Pynball can make leveraging such environments a lot easier.

Features


  • Consolidates all Python installations including pyenv into one management system
  • Easily create Virtual Environments using any Python version.
  • Track which virtual environments have which Python versions and tox versions.
  • Quickly change the System interpreter

Pre Installation Requirements


Minimum Requirements

  1. Python 3.8+
  2. pipx
  3. Virtualenv (which has benefits over venv)
  4. Virtualenvwrapper

For Maximum Benefits additionally install the following:

  1. pyenv

Installation


OS X & Linux:

Will be supported in version 2

Windows:

pipx install pynball

Usage example


View Available commands

pynball
Usage: pynball [OPTIONS] COMMAND [ARGS]...

  Utility script to help manage development with various versions of Python in
  conjunction with Virtual Environments and optionally the pyenv module

Options:
  --help  Show this message and exit.

Commands:
  add         Adds a name / path of an installation of Python.
  addall      Add all versions to the Pynball configuration.
  delete      Deletes a name / path of an installation of Python.
  exportconf  Creates a configuration file backup.
  importconf  Creates a configuration from a file backup
  lsproject   Displays all Virtual Environment projects (with versions: native, tox and pyenv)
  mkproject   Creates a Virtual Environment from a specific Python version.
  mvproject   Renames a Virtual Environment (optionally updates GitHub and git)
  pyenv       Automatically include the pyenv versions in Pynball
  reset       Deletes all names / paths
  rmproject   Deletes a Virtual Environment.
  system      Changes the system Python Interpreter version.
  version     Display details about the system Python Interpreter.
  versions    Lists the names / paths of the configured Python installations

Add a Python version to the config

pynball versions
D:\PYTHON\3.9.10 : --> System Interpreter
WARNING: Pynball configuration is empty - use 'add' command
pynball add 3.8.10 D:\PYTHON\3.8.10
'3.8.10' Successfully added to configuration
pynball versions
D:\PYTHON\3.9.10 : --> System Interpreter
3.8.10    D:\PYTHON\3.8.10
WARNING: System Interpreter is not in Pynball Configuration

Add all manually installed Python versions to the config

pynball addall
'3.10.4' Successfully added to configuration
'3.5.4' Successfully added to configuration
'3.6.8' Successfully added to configuration
'3.7.9' Successfully added to configuration
WARNING: '3.8.10' already added to configuration as '3.8.10'
'3.9.10' Successfully added to configuration
pynball versions
3.10.4    D:\PYTHON\3.10.4
3.9.10    D:\PYTHON\3.9.10 : --> System Interpreter
3.8.10    D:\PYTHON\3.8.10
3.7.9     D:\PYTHON\3.7.9
3.6.8     D:\PYTHON\3.6.8
3.5.4     D:\PYTHON\3.5.4

Add pyenv Python versions (if any) to the config

pynball pyenv -u
'3.10.2' Successfully added to configuration
'3.5.2' Successfully added to configuration
'3.8.0' Successfully added to configuration
3.10.4    D:\PYTHON\3.10.4
3.10.2    C:\Users\conta\.pyenv\pyenv-win\versions\3.10.2
3.9.10    D:\PYTHON\3.9.10 : --> System Interpreter
3.8.10    D:\PYTHON\3.8.10
3.8.0     C:\Users\conta\.pyenv\pyenv-win\versions\3.8.0
3.7.9     D:\PYTHON\3.7.9
3.6.8     D:\PYTHON\3.6.8
3.5.4     D:\PYTHON\3.5.4
3.5.2     C:\Users\conta\.pyenv\pyenv-win\versions\3.5.2
pynball versions
3.10.4    D:\PYTHON\3.10.4
3.10.2    C:\Users\conta\.pyenv\pyenv-win\versions\3.10.2
3.9.10    D:\PYTHON\3.9.10 : --> System Interpreter
3.8.10    D:\PYTHON\3.8.10
3.8.0     C:\Users\conta\.pyenv\pyenv-win\versions\3.8.0
3.7.9     D:\PYTHON\3.7.9
3.6.8     D:\PYTHON\3.6.8
3.5.4     D:\PYTHON\3.5.4
3.5.2     C:\Users\conta\.pyenv\pyenv-win\versions\3.5.2

Create a virtual environment using a version in the config

pynball mkproject 3.8.10 hobgoblin

List all the virtual environments

pynball lsproject
Project Name             Native Version           Pyenv Versions        Tox Versions
============             ==============           ==============        ============
hobgoblin                3.8.10                   -                     3.8, 3.9, 3.10
organizer                3.9.10                   -                     -
pizazz                   3.9.10                   -                     -
template                 3.9.10                   -                     -

Change system interpreter

pynball system 3.6.8
pynball versions
3.10.4    D:\PYTHON\3.10.2
3.10.2    C:\Users\conta\.pyenv\pyenv-win\versions\3.10.2
3.9.10    D:\PYTHON\3.9.10
3.8.10    D:\PYTHON\3.8.10
3.8.0     C:\Users\conta\.pyenv\pyenv-win\versions\3.8.0
3.7.9     D:\PYTHON\3.7.9
3.6.8     D:\PYTHON\3.6.8 : --> System Interpreter
3.5.4     D:\PYTHON\3.5.4
3.5.2     C:\Users\conta\.pyenv\pyenv-win\versions\3.5.2

For more information, please refer to the wiki

Documentation


Read the Docs

Wiki

Meta


Stephen R A King : sking.github@gmail.com

Distributed under the MIT license. See for more information.

Created with Cookiecutter template: pydough version 1.2.1

DOI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynball-1.5.7.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

pynball-1.5.7-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file pynball-1.5.7.tar.gz.

File metadata

  • Download URL: pynball-1.5.7.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.10

File hashes

Hashes for pynball-1.5.7.tar.gz
Algorithm Hash digest
SHA256 d557b4f24072f4cc07ec1ba1198c15241988a030c86a1fdc5964bd57346ef1d8
MD5 dd2039f6087c6808e36cb8241c2551ed
BLAKE2b-256 0c8ba5b8b58a6e0d9112a2c35a1144ca305a06a87bf5cec4de9bbbfe67425450

See more details on using hashes here.

File details

Details for the file pynball-1.5.7-py3-none-any.whl.

File metadata

  • Download URL: pynball-1.5.7-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.10

File hashes

Hashes for pynball-1.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d95f003891cd75c9ab2f9afa8ba8f85d542175d63c6a984ab3bf6f2bf247dfe0
MD5 08673aeea853ccc63dde66bfcc311001
BLAKE2b-256 7ff07602b367646bd08055c64c13a5673ef4edc9a1de7d4faf976029d9db589c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page