Package: telepythy
TelepythyTelepythy is a desktop Python shell inspired byDreamPiewith some notable additional features, such as remote interpreters. It is designed to streamline a prototyping workflow.FeaturesCombines the flow of a REPL with the expressiveness of an editorUI based onQt 6Syntax highlighting based onPygmentsEmbeddable service with no third-party dependenciesRemote connections (as client or server via TCP)Seamless swapping between multiple interpreter profilesRequirementsUI 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)ScreenshotsWindowsWindows(You can make it look like default IDLE if you want)Linux/i3MotivationThere are many Python shells:The standard Python shellIDLEIPython/JupyterptpythonbpythonDreamPieThey 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 developmentstoppedsometime 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, andTelepythyis the result.InstallationThe most reliable way to installtelepythyacross platforms is withpipx:$pipxinstalltelepythyThis will installTelepythyin an isolated environment for the current user, and should work on Windows, Linux, and OSX (untested).For Windows users, you can download an installerhere.UsageOnceTelepythyand its dependencies have been installed, you can start the UI with:$telepythy-gui# or$python-mtelepythy.guiNOTE: At this early state, it may be helpful to use the--verbose(-vor-vv) flag to track whatTelepythyis doing (especially if reporting a bug).ConfigurationStyle 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 ofplatformdirs.user_config_dir()(e.g.~/.config/telepythy/telepythy.cfgon Linux,C:\Users\<username>\AppData\Local\telepythy\telepythy.cfgon Windows).Virtual EnvironmentsAny virtual environments discovered in~/.virtualenvswill be accessible automatically in theProfilesmenu.EmbeddingTo embed aTelepythyservice in your code, you can use any of the following functions:importtelepythy# start a server threadtelepythy.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>/examplesdirectory from the repository for examples on how to embed the service into existing code.Local InterpretersTo add a custom local interpreter, you must create a profile referencing the path for the interpreter in the config file:[profiles]<profile-name>.command="<command-for-interpreter>"Remote InterpretersThe remote service needs to be accessible by whichever interpreter you intend to use. A minimal, service-only package can be installed from PyPI:$pipinstalltelepythy-serviceIt can then be started using one of the following commands:$telepythy-svc[-c,--connect]'<host>:<port>'$telepythy-svc[-s,--serve]'<interface>:<port>'# or$python-mtelepythy...With no options, a server will start listening on the default interface and port:localhost:7373.To useTelepythywith 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:[profiles]<profile-name>.connect="<host>:<port>"To add a serve profile:[profiles]<profile-name>.serve="<interface>:<port>"You can then use the profile by selecting it in the UI, or with the--profilecommand-line option:$telepythy-gui[-p,--profile]<profile-name>APIwork in progressSecurityThere are no security measures in place withinTelepythyto 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 onlocalhostand 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 usingSSH port forwarding. <- (If you're still reading, this is something you should know about.)RoadmapTelepythyis 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/pasteProfile configuration UIUNIX domain socketsSSL socketsSession autosave/import/exportLocalization (at least Spanish)If you experience bugs or have additional feature suggestions, please don't hesistate to create anissue. 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.