telepythy


Nametelepythy JSON
Version 0.5.3 PyPI version JSON
download
home_pagehttps://github.com/dhagrow/telepythy
SummaryAn embeddable, remote-capable Python shell
upload_time2023-08-12 23:14:29
maintainer
docs_urlNone
authorMiguel Turner
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements colorama colorlog darkdetect mistune packaging platformdirs Pygments pyparsing pyqtdarktheme PySide6-Essentials QtPy shiboken6 snekcfg
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Telepythy

Telepythy is a desktop Python shell inspired by [DreamPie][1] with some notable additional features, such as remote interpreters. It is designed to streamline a prototyping workflow.

## Features

* Combines the flow of a REPL with the expressiveness of an editor
* UI based on [Qt 6][8]
* Syntax highlighting based on [Pygments][7]
* Embeddable service with no third-party dependencies
* Remote connections (as client or server via TCP)
* Seamless swapping between multiple interpreter profiles

## Requirements

* UI requires Python 3 on Linux/Windows/OSX (tested: 3.6/3.7/3.9 on Linux/Windows)
* Embeddable service supports Python 2 and 3 on all platforms (tested: 2.7/3.6/3.7/3.9 on Linux/Windows)

## Screenshots

**Windows**

![](https://github.com/dhagrow/telepythy/raw/master/res/screenshot_3.png)
<!-- ![](res/screenshot_3.png) -->

**Windows**
(*You can make it look like default IDLE if you want*)

![](https://github.com/dhagrow/telepythy/raw/master/res/screenshot_4.png)
<!-- ![](res/screenshot_4.png) -->

**Linux/i3**

![](https://github.com/dhagrow/telepythy/raw/master/res/screenshot_6.png)
<!-- ![](res/screenshot_6.png) -->

## Motivation

There are many Python shells:

* The standard Python shell
* [IDLE][12]
* [IPython/Jupyter][3]
* [ptpython][11]
* [bpython][10]
* [DreamPie][1]

They are all good in their own ways. I frequently use the standard Python shell, because it is always there. But when I have been able to install my preference for my most common use cases (prototyping and debugging), my choice was always DreamPie.

Unfortunately, it looks as if all development [stopped][2] sometime before 2016, and the last official release was in 2012. I looked into creating a fork to add the features I was interested in, but the effort to modernize (i.e. Python 3) and refactor an unfamiliar and complex code-base was more than I cared to invest in. Starting a new project seemed much more fun.

So, I decided to start from scratch, and **Telepythy** is the result.

## Installation

The most reliable way to install `telepythy` across platforms is with [pipx][9]:

```shell
$ pipx install telepythy
```

This will install **Telepythy** in an isolated environment for the current user, and should work on Windows, Linux, and OSX (untested).

For Windows users, you can download an installer [here][13].

## Usage

Once **Telepythy** and its dependencies have been installed, you can start the UI with:

```shell
$ telepythy-gui
# or
$ python -m telepythy.gui
```

**NOTE**: At this early state, it may be helpful to use the `--verbose` (`-v` or `-vv`) flag to track what **Telepythy** is doing (especially if reporting a bug).

### Configuration

Style and font options can be configured with the UI. Manually editing the config file is currently the only way to persist any other options.

The config file is located according to the results of `platformdirs.user_config_dir()` (e.g. `~/.config/telepythy/telepythy.cfg` on Linux, `C:\Users\<username>\AppData\Local\telepythy\telepythy.cfg` on Windows).

### Virtual Environments

Any virtual environments discovered in `~/.virtualenvs` will be accessible automatically in the *Profiles* menu.

### Embedding

To embed a **Telepythy** service in your code, you can use any of the following functions:

```python
import telepythy

# start a server thread
telepythy.start_server()

# or start a client thread (with optional arguments)
telepythy.start_client(locals={'bar': False}, address='localhost:1337')

# or start a client/server directly (blocking)
telepythy.client()
telepythy.server()
```

See the `<telepythy>/examples` directory from the repository for examples on how to embed the service into existing code.

### Local Interpreters

To add a custom local interpreter, you must create a profile referencing the path for the interpreter in the config file:

```ini
[profiles]
<profile-name>.command = "<command-for-interpreter>"
```

### Remote Interpreters

The remote service needs to be accessible by whichever interpreter you intend to use. A minimal, service-only package can be installed from PyPI:

```shell
$ pip install telepythy-service
```

It can then be started using one of the following commands:

```shell
$ telepythy-svc [-c,--connect] '<host>:<port>'
$ telepythy-svc [-s,--serve] '<interface>:<port>'
# or
$ python -m telepythy ...
```

With no options, a server will start listening on the default interface and port: `localhost:7373`.

To use **Telepythy** with a remote service, you must create a profile to either connect to a remote port, or serve on a port, in the config file.

To add a connect profile:

```ini
[profiles]
<profile-name>.connect = "<host>:<port>"
```

To add a serve profile:

```ini
[profiles]
<profile-name>.serve = "<interface>:<port>"
```

You can then use the profile by selecting it in the UI, or with the `--profile` command-line option:

```shell
$ telepythy-gui [-p,--profile] <profile-name>
```

## API

*work in progress*

## Security

There are no security measures in place within **Telepythy** to secure your source code in transit. The UI controller connects to the embedded service using a regular TCP connection. By default, the UI starts a server listening on *localhost* and executes a Python process that connects to it. In the future, the default may change to use UNIX domain sockets on Linux, and named pipes on Windows. An option for SSL is possible for those willing to manage certificates. However, securing communications in transit will always remain a responsibility of the user.

For connections across machines, I recommend using [SSH port forwarding][6]. <- (If you're still reading, this is something you should know about.)

## Roadmap

**Telepythy** is very much a work in progress. Here are some features that might be queued up for future releases (in no particular order):

* Better completion (next on the docket)
* Embedded documentation (i.e. docstring popups)
* Smart copy/paste
* Profile configuration UI
* UNIX domain sockets
* SSL sockets
* Session autosave/import/export
* Localization (at least Spanish)

If you experience bugs or have additional feature suggestions, please don't hesistate to create an [issue][5]. Note that I work on this project in my free time and I don't expect to work on features that I don't personally find useful. I do prioritize bugs, and welcome pull requests.

[1]: http://www.dreampie.org/
[2]: https://github.com/noamraph/dreampie/issues/65
[3]: https://jupyter.org/
[4]: https://wiki.qt.io/Qt_for_Python
[5]: https://github.com/dhagrow/telepythy/issues/new
[6]: https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding
[7]: https://pygments.org
[8]: https://www.qt.io
[9]: https://pypa.github.io/pipx/
[10]: https://bpython-interpreter.org
[11]: https://github.com/prompt-toolkit/ptpython
[12]: https://docs.python.org/3/library/idle.html
[13]: https://github.com/dhagrow/telepythy/releases/download/0.5.1/telepythy-0.5.1-setup-x64.exe

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dhagrow/telepythy",
    "name": "telepythy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Miguel Turner",
    "author_email": "cymrow@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "# Telepythy\n\nTelepythy is a desktop Python shell inspired by [DreamPie][1] with some notable additional features, such as remote interpreters. It is designed to streamline a prototyping workflow.\n\n## Features\n\n* Combines the flow of a REPL with the expressiveness of an editor\n* UI based on [Qt 6][8]\n* Syntax highlighting based on [Pygments][7]\n* Embeddable service with no third-party dependencies\n* Remote connections (as client or server via TCP)\n* Seamless swapping between multiple interpreter profiles\n\n## Requirements\n\n* UI requires Python 3 on Linux/Windows/OSX (tested: 3.6/3.7/3.9 on Linux/Windows)\n* Embeddable service supports Python 2 and 3 on all platforms (tested: 2.7/3.6/3.7/3.9 on Linux/Windows)\n\n## Screenshots\n\n**Windows**\n\n![](https://github.com/dhagrow/telepythy/raw/master/res/screenshot_3.png)\n<!-- ![](res/screenshot_3.png) -->\n\n**Windows**\n(*You can make it look like default IDLE if you want*)\n\n![](https://github.com/dhagrow/telepythy/raw/master/res/screenshot_4.png)\n<!-- ![](res/screenshot_4.png) -->\n\n**Linux/i3**\n\n![](https://github.com/dhagrow/telepythy/raw/master/res/screenshot_6.png)\n<!-- ![](res/screenshot_6.png) -->\n\n## Motivation\n\nThere are many Python shells:\n\n* The standard Python shell\n* [IDLE][12]\n* [IPython/Jupyter][3]\n* [ptpython][11]\n* [bpython][10]\n* [DreamPie][1]\n\nThey are all good in their own ways. I frequently use the standard Python shell, because it is always there. But when I have been able to install my preference for my most common use cases (prototyping and debugging), my choice was always DreamPie.\n\nUnfortunately, it looks as if all development [stopped][2] sometime before 2016, and the last official release was in 2012. I looked into creating a fork to add the features I was interested in, but the effort to modernize (i.e. Python 3) and refactor an unfamiliar and complex code-base was more than I cared to invest in. Starting a new project seemed much more fun.\n\nSo, I decided to start from scratch, and **Telepythy** is the result.\n\n## Installation\n\nThe most reliable way to install `telepythy` across platforms is with [pipx][9]:\n\n```shell\n$ pipx install telepythy\n```\n\nThis will install **Telepythy** in an isolated environment for the current user, and should work on Windows, Linux, and OSX (untested).\n\nFor Windows users, you can download an installer [here][13].\n\n## Usage\n\nOnce **Telepythy** and its dependencies have been installed, you can start the UI with:\n\n```shell\n$ telepythy-gui\n# or\n$ python -m telepythy.gui\n```\n\n**NOTE**: At this early state, it may be helpful to use the `--verbose` (`-v` or `-vv`) flag to track what **Telepythy** is doing (especially if reporting a bug).\n\n### Configuration\n\nStyle and font options can be configured with the UI. Manually editing the config file is currently the only way to persist any other options.\n\nThe config file is located according to the results of `platformdirs.user_config_dir()` (e.g. `~/.config/telepythy/telepythy.cfg` on Linux, `C:\\Users\\<username>\\AppData\\Local\\telepythy\\telepythy.cfg` on Windows).\n\n### Virtual Environments\n\nAny virtual environments discovered in `~/.virtualenvs` will be accessible automatically in the *Profiles* menu.\n\n### Embedding\n\nTo embed a **Telepythy** service in your code, you can use any of the following functions:\n\n```python\nimport telepythy\n\n# start a server thread\ntelepythy.start_server()\n\n# or start a client thread (with optional arguments)\ntelepythy.start_client(locals={'bar': False}, address='localhost:1337')\n\n# or start a client/server directly (blocking)\ntelepythy.client()\ntelepythy.server()\n```\n\nSee the `<telepythy>/examples` directory from the repository for examples on how to embed the service into existing code.\n\n### Local Interpreters\n\nTo add a custom local interpreter, you must create a profile referencing the path for the interpreter in the config file:\n\n```ini\n[profiles]\n<profile-name>.command = \"<command-for-interpreter>\"\n```\n\n### Remote Interpreters\n\nThe remote service needs to be accessible by whichever interpreter you intend to use. A minimal, service-only package can be installed from PyPI:\n\n```shell\n$ pip install telepythy-service\n```\n\nIt can then be started using one of the following commands:\n\n```shell\n$ telepythy-svc [-c,--connect] '<host>:<port>'\n$ telepythy-svc [-s,--serve] '<interface>:<port>'\n# or\n$ python -m telepythy ...\n```\n\nWith no options, a server will start listening on the default interface and port: `localhost:7373`.\n\nTo use **Telepythy** with a remote service, you must create a profile to either connect to a remote port, or serve on a port, in the config file.\n\nTo add a connect profile:\n\n```ini\n[profiles]\n<profile-name>.connect = \"<host>:<port>\"\n```\n\nTo add a serve profile:\n\n```ini\n[profiles]\n<profile-name>.serve = \"<interface>:<port>\"\n```\n\nYou can then use the profile by selecting it in the UI, or with the `--profile` command-line option:\n\n```shell\n$ telepythy-gui [-p,--profile] <profile-name>\n```\n\n## API\n\n*work in progress*\n\n## Security\n\nThere are no security measures in place within **Telepythy** to secure your source code in transit. The UI controller connects to the embedded service using a regular TCP connection. By default, the UI starts a server listening on *localhost* and executes a Python process that connects to it. In the future, the default may change to use UNIX domain sockets on Linux, and named pipes on Windows. An option for SSL is possible for those willing to manage certificates. However, securing communications in transit will always remain a responsibility of the user.\n\nFor connections across machines, I recommend using [SSH port forwarding][6]. <- (If you're still reading, this is something you should know about.)\n\n## Roadmap\n\n**Telepythy** is very much a work in progress. Here are some features that might be queued up for future releases (in no particular order):\n\n* Better completion (next on the docket)\n* Embedded documentation (i.e. docstring popups)\n* Smart copy/paste\n* Profile configuration UI\n* UNIX domain sockets\n* SSL sockets\n* Session autosave/import/export\n* Localization (at least Spanish)\n\nIf you experience bugs or have additional feature suggestions, please don't hesistate to create an [issue][5]. Note that I work on this project in my free time and I don't expect to work on features that I don't personally find useful. I do prioritize bugs, and welcome pull requests.\n\n[1]: http://www.dreampie.org/\n[2]: https://github.com/noamraph/dreampie/issues/65\n[3]: https://jupyter.org/\n[4]: https://wiki.qt.io/Qt_for_Python\n[5]: https://github.com/dhagrow/telepythy/issues/new\n[6]: https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding\n[7]: https://pygments.org\n[8]: https://www.qt.io\n[9]: https://pypa.github.io/pipx/\n[10]: https://bpython-interpreter.org\n[11]: https://github.com/prompt-toolkit/ptpython\n[12]: https://docs.python.org/3/library/idle.html\n[13]: https://github.com/dhagrow/telepythy/releases/download/0.5.1/telepythy-0.5.1-setup-x64.exe\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An embeddable, remote-capable Python shell",
    "version": "0.5.3",
    "project_urls": {
        "Homepage": "https://github.com/dhagrow/telepythy"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "26b9fcaf8c221e91ec2247ca30e9c7942d3cda276f16370f71966119c6c1667b",
                "md5": "3ff30fe637d3088642dbd04a3e55f449",
                "sha256": "039ff8acb3beef8bcbfbad3631908bb20a565d388b6f9298001949b5f760401f"
            },
            "downloads": -1,
            "filename": "telepythy-0.5.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3ff30fe637d3088642dbd04a3e55f449",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 71149,
            "upload_time": "2023-08-12T23:14:29",
            "upload_time_iso_8601": "2023-08-12T23:14:29.847319Z",
            "url": "https://files.pythonhosted.org/packages/26/b9/fcaf8c221e91ec2247ca30e9c7942d3cda276f16370f71966119c6c1667b/telepythy-0.5.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-12 23:14:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dhagrow",
    "github_project": "telepythy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.6"
                ]
            ]
        },
        {
            "name": "colorlog",
            "specs": [
                [
                    "==",
                    "6.7.0"
                ]
            ]
        },
        {
            "name": "darkdetect",
            "specs": [
                [
                    "==",
                    "0.7.1"
                ]
            ]
        },
        {
            "name": "mistune",
            "specs": [
                [
                    "==",
                    "3.0.1"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "23.1"
                ]
            ]
        },
        {
            "name": "platformdirs",
            "specs": [
                [
                    "==",
                    "3.9.1"
                ]
            ]
        },
        {
            "name": "Pygments",
            "specs": [
                [
                    "==",
                    "2.15.1"
                ]
            ]
        },
        {
            "name": "pyparsing",
            "specs": [
                [
                    "==",
                    "3.1.0"
                ]
            ]
        },
        {
            "name": "pyqtdarktheme",
            "specs": [
                [
                    "==",
                    "2.1.0"
                ]
            ]
        },
        {
            "name": "PySide6-Essentials",
            "specs": [
                [
                    "==",
                    "6.5.2"
                ]
            ]
        },
        {
            "name": "QtPy",
            "specs": [
                [
                    "==",
                    "2.3.1"
                ]
            ]
        },
        {
            "name": "shiboken6",
            "specs": [
                [
                    "==",
                    "6.5.2"
                ]
            ]
        },
        {
            "name": "snekcfg",
            "specs": [
                [
                    "==",
                    "0.1.1"
                ]
            ]
        }
    ],
    "lcname": "telepythy"
}
        
Elapsed time: 0.28489s