Dead simple CLI tool to try Python packages - It's never been easier! :package:

Overview

try - It's never been easier to try Python packages

Latest version released on PyPi Package license Package is available as wheel

try is an easy-to-use cli tool to try out Python packages.

Demo

Features

  • Install specific package version from PyPI
  • Install package from GitHub
  • Install in virtualenv using specific version of python
  • Specify alternative python package import name
  • Keep try environment after interactive session
  • Launch interactive python console with already imported package
  • Launch editor instead of interpreter
  • Launch arbitrary python shell instead of default python shell

Usage

try requests
try requests --ipython
try requests --shell ptipython
try requests -p 3.5
try requests -p /usr/bin/python3.4.1
try requests==2.8.1
try kennethreitz/requests --ipython
try click-didyoumean:click_didyoumean  # if python package name is different then pip package name
try requests --editor

Usage examples

Note: most of the following cli options can also be configured in the configuration file!

Try single python package:

try requests
try flask

Try multiple python packages in one session:

try requests flask

Try specific version of a package:

try requests==2.8.1  # tries version 2.8.1 of requests instead of latest

Try package from GitHub repository:

try <user>/<repo>  # syntax example
try kennethreitz/requests  # installs master branch of Kenneth's requests package from GitHub

Try package but import with different name than package name:

try <package_name>:<import_name>  # syntax example
try click-didyoumean:click_didyoumean  # install click-didyoumean but import click_didyoumean

Try package in already existing virtualenv:

try requests --virtualenv ~/.try/sandbox  # use virtualenv at ~/.try/sandbox

⇢ see virtualenv config value in env section in configuration file.

Try package with specific python version:

try requests --python 3.5  # use python3.5 in virtualenv
try requests -p 2.7  # use python2.7 in virtualenv
try requests -p ~/work/cpython/bin/python  # use python binary from specific location

⇢ see python config value in env section in configuration file.

Try package with specific shell/repl:

try requests --shell python  # use python repl (default value)
try requests --shell ipython  # use ipython
try requests --shell ptpython  # use ptpython
try requests --shell ptipython  # use ptipython
try requests --shell bpython  # use bpython
try requests --ipython  # use ipython - an alias for --shell ipython

⇢ see shell config value in env section in configuration file.

Try package writing a little script instead of opening shell:

try requests --editor  # opens $EDITOR or editor instead of shell

⇢ see always_use_editor config value in env section in configuration file.

Keep virtualenv files after try run:

try requests --keep

⇢ see keep config value in env section in configuration file.

Use a specific location for the virtualenv files:

try requests --tmpdir ~/.try

⇢ see tmpdir config value in env section in configuration file.

Configuration

try can be configured to your preferences - like always use ipython as a shell or always use python3.5. The configuration file is located in your users application configuration directory in a file called config.ini. This location is OS dependent and is specified here: http://click.pocoo.org/5/api/#click.get_app_dir

The following config.ini file shows all available configuration options:

[env]
virtualenv=~/.try/sandbox
python=3.5
shell=ipython
keep=false
always_use_editor=false
tmpdir=~/.try

Installation

Use pip to install try:

pip3 install trypackage

Help

try comes with an awesome CLI interface thanks to click.

Usage: try [OPTIONS] [PACKAGES]...

  Easily try out python packages.

Options:
  --virtualenv TEXT  Use already existing virtualenv.
  -p, --python TEXT  The python version to use.
  --ipython          Use ipython instead of python.
  --shell TEXT       Specify the python shell to use. (This will override
                     --ipython
  -k, --keep         Keep try environment files.
  -e, --editor       Try with editor instead of interpreter.
  --tmpdir TEXT      Specify location for temporary directory.
  --version          Show the version and exit.
  --help             Show this message and exit.

try was inspired by https://github.com/VictorBjelkholm/trymodule.

Owner
Timo Furrer
Enthusiastic Hacker who loves Free Open Source Software, Linux, Python, Machine Learning and :penguin:. Commits are my own.
Timo Furrer
Themes for Windows Terminal

Windows Terminal Themes Preview and copy themes for the new Windows Terminal. Use the project at windowsterminalthemes.dev How to use the themes This

Tom 1.1k Jan 03, 2023
🌈 Lightweight Python package that makes it easy and fast to print terminal messages in colors. 🌈

🌈 Colorist for Python 🌈 Lightweight Python package that makes it easy and fast to print terminal messages in colors. Prerequisites Python 3.9 or hig

Jakob Bagterp 1 Feb 05, 2022
Code for "Salient Deconvolutional Networks, Aravindh Mahendran, Andrea Vedaldi, ECCV 2016"

deconvnet_analysis Code for "Salient Deconvolutional Networks, Aravindh Mahendran, Andrea Vedaldi, ECCV 2016" Parts of this code Generate figures in t

Aravindh Mahendran 12 Jan 25, 2021
Automated CI toolchain to produce precompiled opencv-python, opencv-python-headless, opencv-contrib-python and opencv-contrib-python-headless packages.

OpenCV on Wheels Pre-built CPU-only OpenCV packages for Python. Check the manual build section if you wish to compile the bindings from source to enab

OpenCV 3.2k Jan 04, 2023
A CLI application for storing contacts as a csv file written in Python.

Contacter A CLI application for storing contacts as a csv file written in Python. You can use this to save your contacts with a special relations tag

nostalgicnerdpenguin 1 Oct 23, 2021
A simple python implementation of a reverse shell

llehs A python implementation of a reverse shell. Note for contributors The project is open for contributions and is hacktoberfest registered! llehs u

Archisman Ghosh 2 Jul 05, 2022
Access hacksec.in from your command-line

Access hacksec.in from your command-line

hacksec.in 3 Oct 26, 2022
Pyrdle - Play Wordle in the CLI. Write an algorithm to play Wordle for you. Ruin all of the fun you've been having

Pyrdle - Play Wordle in the CLI. Write an algorithm to play Wordle for you. Ruin all of the fun you've been having

Charles Tapley Hoyt 11 Feb 11, 2022
🕰 The command line tool for scheduling Python scripts

hickory is a simple command line tool for scheduling Python scripts.

Max Humber 146 Dec 07, 2022
🎈 A Mini CLI-based Operating System simulator

Mini OS Simulator Summary 🎈 A Mini CLI-based Operating System simulator, well, not really. It simulates a file system with songs and movies and stuff

Jaiyank S. 3 Feb 14, 2022
A simple command line chat app to communicate via the terminal.

A simple command line chat app to communicate via the terminal. I'm new to networking so sorry if some of my terminology or code is messed up.

PotNoodle 1 Oct 26, 2021
A python CLI app that converts a mp4 file into a gif with ASCII effect added.

Video2ASCIIgif This CLI app takes in a mp4 format video, converts it to a gif with ASCII effect applied. This also includes full control over: backgro

Sriram R 6 Dec 31, 2021
Command-line search tool for GitHub

cligh is a command-line search tool for GitHub.

1 Oct 02, 2022
Unpacks things.

$ unp_ unp is a command line tool that can unpack archives easily. It mainly acts as a wrapper around other shell tools that you can find on v

Armin Ronacher 405 Jan 03, 2023
A python script that enables a raspberry pi sd card through the CLI and automates the process of configuring network details and ssh.

This project is one script (wpa_helper.py) written in python that will allow for the user to automate the proccess of setting up a new boot disk and configuring ssh and network settings for the pi

Theo Kirby 6 Jun 24, 2021
Wordle-textual - Play Wordle from the CLI, using Textual

Wordle, playable from the CLI This project seeks to emulate Wordle in your shell

PhenoM4n4n 3 Mar 29, 2022
PyArmor is a command line tool used to obfuscate python scripts

PyArmor is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.

Dashingsoft 2k Jan 07, 2023
TermPair lets developers securely share and control terminals in real time🔒

View and control terminals from your browser with end-to-end encryption 🔒

Chad Smith 1.5k Jan 05, 2023
Urial (URI Addition tooL) intelligently updates URIs stored in Finder comments of macOS files

Urial Urial (URI addition tool) is a simple but intelligent command-line tool to add or replace URIs found inside macOS Finder comments. Table of cont

Mike Hucka 3 Sep 14, 2022
CLabel is a terminal-based cluster labeling tool that allows you to explore text data interactively and label clusters based on reviewing that data.

CLabel is a terminal-based cluster labeling tool that allows you to explore text data interactively and label clusters based on reviewing that

Peter Baumgartner 29 Aug 09, 2022