{"id":13419656,"url":"https://github.com/timofurrer/try","last_synced_at":"2025-05-16T12:03:16.174Z","repository":{"id":5968189,"uuid":"54238923","full_name":"timofurrer/try","owner":"timofurrer","description":"Dead simple CLI tool to try Python packages - It's never been easier! :package: ","archived":false,"fork":false,"pushed_at":"2022-05-23T13:26:34.000Z","size":1395,"stargazers_count":731,"open_issues_count":4,"forks_count":32,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-15T08:45:28.590Z","etag":null,"topics":["fast","install","module","package","pip","pypi","python","simple","try","virtualenv"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timofurrer.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-19T00:17:31.000Z","updated_at":"2025-05-12T01:51:11.000Z","dependencies_parsed_at":"2022-07-06T00:00:25.167Z","dependency_job_id":null,"html_url":"https://github.com/timofurrer/try","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timofurrer%2Ftry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timofurrer%2Ftry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timofurrer%2Ftry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timofurrer%2Ftry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timofurrer","download_url":"https://codeload.github.com/timofurrer/try/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254527084,"owners_count":22085918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fast","install","module","package","pip","pypi","python","simple","try","virtualenv"],"created_at":"2024-07-30T22:01:19.021Z","updated_at":"2025-05-16T12:03:16.017Z","avatar_url":"https://github.com/timofurrer.png","language":"Python","readme":"try - It's never been easier to try Python packages\n===================================================\n|pypi| |license| |wheel|\n\n**try** is an easy-to-use cli tool to try out Python packages.\n\n|demo|\n\nFeatures\n--------\n\n- Install specific package version from PyPI\n- Install package from GitHub\n- Install in virtualenv using specific version of python\n- Specify alternative python package import name\n- Keep try environment after interactive session\n- Launch interactive python console with already imported package\n- Launch editor instead of interpreter\n- Launch arbitrary python shell instead of default python shell\n\nUsage\n-----\n\n.. code:: bash\n\n    try requests\n    try requests --ipython\n    try requests --shell ptipython\n    try requests -p 3.5\n    try requests -p /usr/bin/python3.4.1\n    try requests==2.8.1\n    try kennethreitz/requests --ipython\n    try click-didyoumean:click_didyoumean  # if python package name is different then pip package name\n    try requests --editor\n\nUsage examples\n--------------\n\n*Note: most of the following cli options can also be configured in the* `configuration`_ *file!*\n\n**Try single python package:**\n\n.. code:: bash\n\n    try requests\n    try flask\n\n**Try multiple python packages in one session:**\n\n.. code:: bash\n\n    try requests flask\n\n**Try specific version of a package:**\n\n.. code:: bash\n\n    try requests==2.8.1  # tries version 2.8.1 of requests instead of latest\n\n**Try package from GitHub repository:**\n\n.. code:: bash\n\n    try \u003cuser\u003e/\u003crepo\u003e  # syntax example\n    try kennethreitz/requests  # installs master branch of Kenneth's requests package from GitHub\n\n**Try package but import with different name than package name:**\n\n.. code:: bash\n\n    try \u003cpackage_name\u003e:\u003cimport_name\u003e  # syntax example\n    try click-didyoumean:click_didyoumean  # install click-didyoumean but import click_didyoumean\n\n**Try package in already existing virtualenv:**\n\n.. code:: bash\n\n    try requests --virtualenv ~/.try/sandbox  # use virtualenv at ~/.try/sandbox\n\n*⇢ see virtualenv config value in env section in* `configuration`_ *file.*\n\n**Try package with specific python version:**\n\n.. code:: bash\n\n    try requests --python 3.5  # use python3.5 in virtualenv\n    try requests -p 2.7  # use python2.7 in virtualenv\n    try requests -p ~/work/cpython/bin/python  # use python binary from specific location\n\n*⇢ see python config value in env section in* `configuration`_ *file.*\n\n**Try package with specific shell/repl:**\n\n.. code:: bash\n\n    try requests --shell python  # use python repl (default value)\n    try requests --shell ipython  # use ipython\n    try requests --shell ptpython  # use ptpython\n    try requests --shell ptipython  # use ptipython\n    try requests --shell bpython  # use bpython\n    try requests --ipython  # use ipython - an alias for --shell ipython\n\n*⇢ see shell config value in env section in* `configuration`_ *file.*\n\n**Try package writing a little script instead of opening shell:**\n\n.. code:: bash\n\n    try requests --editor  # opens $EDITOR or editor instead of shell\n\n*⇢ see always_use_editor config value in env section in* `configuration`_ *file.*\n\n**Keep virtualenv files after try run:**\n\n.. code:: bash\n\n    try requests --keep\n\n*⇢ see keep config value in env section in* `configuration`_ *file.*\n\n**Use a specific location for the virtualenv files:**\n\n.. code:: bash\n\n    try requests --tmpdir ~/.try\n\n*⇢ see tmpdir config value in env section in* `configuration`_ *file.*\n\n\n.. _configuration:\n\nConfiguration\n-------------\n\n``try`` can be configured to your preferences - like always use ``ipython`` as a shell or always use ``python3.5``.\nThe configuration file is located in your users application configuration directory in a file called ``config.ini``.\nThis location is OS dependent and is specified here: http://click.pocoo.org/5/api/#click.get_app_dir\n\nThe following ``config.ini`` file shows all available configuration options:\n\n\n.. code:: ini\n\n    [env]\n    virtualenv=~/.try/sandbox\n    python=3.5\n    shell=ipython\n    keep=false\n    always_use_editor=false\n    tmpdir=~/.try\n\n\nInstallation\n------------\n\nUse **pip** to install **try**:\n\n.. code::\n\n    pip3 install trypackage\n\n\nHelp\n~~~~\n\n**try** comes with an awesome CLI interface thanks to *click*.\n\n.. code::\n\n    Usage: try [OPTIONS] [PACKAGES]...\n\n      Easily try out python packages.\n\n    Options:\n      --virtualenv TEXT  Use already existing virtualenv.\n      -p, --python TEXT  The python version to use.\n      --ipython          Use ipython instead of python.\n      --shell TEXT       Specify the python shell to use. (This will override\n                         --ipython\n      -k, --keep         Keep try environment files.\n      -e, --editor       Try with editor instead of interpreter.\n      --tmpdir TEXT      Specify location for temporary directory.\n      --version          Show the version and exit.\n      --help             Show this message and exit.\n\n**try** was inspired by https://github.com/VictorBjelkholm/trymodule.\n\n.. |pypi| image:: https://img.shields.io/pypi/v/trypackage.svg?style=flat\u0026label=version\n    :target: https://pypi.python.org/pypi/trypackage\n    :alt: Latest version released on PyPi\n\n.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat\n    :target: https://raw.githubusercontent.com/timofurrer/try/master/LICENSE\n    :alt: Package license\n\n.. |wheel| image:: https://img.shields.io/pypi/wheel/radish-bdd.svg\n    :target: https://pypi.python.org/pypi/trypackage\n    :alt: Package is available as wheel\n\n.. |demo| image:: https://raw.githubusercontent.com/timofurrer/try/master/docs/asciicast.gif\n    :target: https://asciinema.org/a/bd60nu08dbklh5d16lyd69fvx\n    :alt: Demo\n","funding_links":[],"categories":["Python","Command-line Tools","资源列表","命令行工具","Command-line Tools [🔝](#readme)","Awesome Python"],"sub_categories":["命令行工具","Command-line Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimofurrer%2Ftry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimofurrer%2Ftry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimofurrer%2Ftry/lists"}