Introduction
============
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-prompt-toolkit/badge/?version=latest
:target: https://docs.circuitpython.org/projects/prompt_toolkit/en/latest/
:alt: Documentation Status
.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
:target: https://adafru.it/discord
:alt: Discord
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_prompt_toolkit/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_prompt_toolkit/actions
:alt: Build Status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: Black
Slimmed down implementation of `prompt_toolkit <https://github.com/prompt-toolkit/python-prompt-toolkit>`_ for CircuitPython
Dependencies
=============
This driver depends on:
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_
or individual libraries can be installed using
`circup <https://github.com/adafruit/circup>`_.
Installing from PyPI
=====================
This library is available in PyPI for CircuitPython tools that need it. If you
actually want to use it on CPython (not CircuitPython), then we recommend the
full `prompt_toolkit <https://github.com/prompt-toolkit/python-prompt-toolkit>`_
library that is also on PyPI.
Installing to a Connected CircuitPython Device with Circup
==========================================================
Make sure that you have ``circup`` installed in your Python environment.
Install it with the following command if necessary:
.. code-block:: shell
pip3 install circup
With ``circup`` installed and your CircuitPython device connected use the
following command to install:
.. code-block:: shell
circup install adafruit_prompt_toolkit
Or the following command to update an existing version:
.. code-block:: shell
circup update
Usage Example
=============
.. code-block:: python
# This example works over the second CDC and supports history.
import usb_cdc
# Rename import to make the rest of the code compatible with CPython's prompt_toolkit library.
import adafruit_prompt_toolkit as prompt_toolkit
# If the second CDC is available, then use it instead.
serial = usb_cdc.console
if usb_cdc.data:
serial = usb_cdc.data
session = prompt_toolkit.PromptSession(input=serial, output=serial)
while True:
response = session.prompt("$ ")
print("->", response, file=serial)
Documentation
=============
API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/prompt_toolkit/en/latest/>`_.
For information on building library documentation, please check out
`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
Contributing
============
Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_Prompt_Toolkit/blob/HEAD/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Raw data
{
"_id": null,
"home_page": null,
"name": "adafruit-circuitpython-prompt-toolkit",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "adafruit, blinka, circuitpython, micropython, prompt_toolkit",
"author": null,
"author_email": "Adafruit Industries <circuitpython@adafruit.com>",
"download_url": "https://files.pythonhosted.org/packages/34/49/d40711c330681122034c20c400c8bbf55262f21697f44d18448340fb2f30/adafruit_circuitpython_prompt_toolkit-1.0.1.tar.gz",
"platform": null,
"description": "Introduction\n============\n\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-prompt-toolkit/badge/?version=latest\n :target: https://docs.circuitpython.org/projects/prompt_toolkit/en/latest/\n :alt: Documentation Status\n\n\n.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg\n :target: https://adafru.it/discord\n :alt: Discord\n\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_prompt_toolkit/workflows/Build%20CI/badge.svg\n :target: https://github.com/adafruit/Adafruit_CircuitPython_prompt_toolkit/actions\n :alt: Build Status\n\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: Code Style: Black\n\nSlimmed down implementation of `prompt_toolkit <https://github.com/prompt-toolkit/python-prompt-toolkit>`_ for CircuitPython\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_\nor individual libraries can be installed using\n`circup <https://github.com/adafruit/circup>`_.\n\nInstalling from PyPI\n=====================\n\nThis library is available in PyPI for CircuitPython tools that need it. If you\nactually want to use it on CPython (not CircuitPython), then we recommend the\nfull `prompt_toolkit <https://github.com/prompt-toolkit/python-prompt-toolkit>`_\nlibrary that is also on PyPI.\n\nInstalling to a Connected CircuitPython Device with Circup\n==========================================================\n\nMake sure that you have ``circup`` installed in your Python environment.\nInstall it with the following command if necessary:\n\n.. code-block:: shell\n\n pip3 install circup\n\nWith ``circup`` installed and your CircuitPython device connected use the\nfollowing command to install:\n\n.. code-block:: shell\n\n circup install adafruit_prompt_toolkit\n\nOr the following command to update an existing version:\n\n.. code-block:: shell\n\n circup update\n\nUsage Example\n=============\n\n.. code-block:: python\n\n # This example works over the second CDC and supports history.\n\n import usb_cdc\n\n # Rename import to make the rest of the code compatible with CPython's prompt_toolkit library.\n import adafruit_prompt_toolkit as prompt_toolkit\n\n # If the second CDC is available, then use it instead.\n serial = usb_cdc.console\n if usb_cdc.data:\n serial = usb_cdc.data\n\n session = prompt_toolkit.PromptSession(input=serial, output=serial)\n\n while True:\n response = session.prompt(\"$ \")\n print(\"->\", response, file=serial)\n\nDocumentation\n=============\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/prompt_toolkit/en/latest/>`_.\n\nFor information on building library documentation, please check out\n`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n<https://github.com/adafruit/Adafruit_CircuitPython_Prompt_Toolkit/blob/HEAD/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Slimmed down implementation of prompt_toolkit for CircuitPython",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_Prompt_Toolkit"
},
"split_keywords": [
"adafruit",
" blinka",
" circuitpython",
" micropython",
" prompt_toolkit"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9c8664b91162146460744dc561e9ffd3f2082993b6c603e7eb4fee329b2d5095",
"md5": "8fc51f1b36b668f71f0e48264db05760",
"sha256": "0a5927b57e82dec3051637f63996a75c36fab911058d63feeca860da5dd675e9"
},
"downloads": -1,
"filename": "adafruit_circuitpython_prompt_toolkit-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8fc51f1b36b668f71f0e48264db05760",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5974,
"upload_time": "2024-10-07T22:34:38",
"upload_time_iso_8601": "2024-10-07T22:34:38.156788Z",
"url": "https://files.pythonhosted.org/packages/9c/86/64b91162146460744dc561e9ffd3f2082993b6c603e7eb4fee329b2d5095/adafruit_circuitpython_prompt_toolkit-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3449d40711c330681122034c20c400c8bbf55262f21697f44d18448340fb2f30",
"md5": "bfe1f42b5bea2a408e1f429ab7f4773e",
"sha256": "820ce24c1fc8cd5446694a9b053ab2baa6e6573606a1bd0e8de07349cd3278dd"
},
"downloads": -1,
"filename": "adafruit_circuitpython_prompt_toolkit-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "bfe1f42b5bea2a408e1f429ab7f4773e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 27218,
"upload_time": "2024-10-07T22:34:39",
"upload_time_iso_8601": "2024-10-07T22:34:39.069181Z",
"url": "https://files.pythonhosted.org/packages/34/49/d40711c330681122034c20c400c8bbf55262f21697f44d18448340fb2f30/adafruit_circuitpython_prompt_toolkit-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-07 22:34:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "adafruit",
"github_project": "Adafruit_CircuitPython_Prompt_Toolkit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "Adafruit-Blinka",
"specs": []
}
],
"lcname": "adafruit-circuitpython-prompt-toolkit"
}