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/3b/ee/ec1e46d6ae4682dd935c4c847c40744bc1952cc4a31eeebbed78a9c61d44/adafruit_circuitpython_prompt_toolkit-1.0.0.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.0",
"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": "c818006bd1194088cb6408492429a31a9d23458d080d48a6544f9f82be2e7574",
"md5": "4620de2c7f3d381607f6471a7626a8e7",
"sha256": "13c381eb386c6e59c2264ba1440ff6d4f8dbfbdd63cf7669bbf87669dfd51303"
},
"downloads": -1,
"filename": "adafruit_circuitpython_prompt_toolkit-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4620de2c7f3d381607f6471a7626a8e7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5976,
"upload_time": "2024-08-19T16:35:15",
"upload_time_iso_8601": "2024-08-19T16:35:15.229446Z",
"url": "https://files.pythonhosted.org/packages/c8/18/006bd1194088cb6408492429a31a9d23458d080d48a6544f9f82be2e7574/adafruit_circuitpython_prompt_toolkit-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3beeec1e46d6ae4682dd935c4c847c40744bc1952cc4a31eeebbed78a9c61d44",
"md5": "d77e2be93fd052507600eec17f4b391c",
"sha256": "96e33ebe26f69abfa98330e7b028e54ab836c07ab6e9bf0c5f510cf1649bb15f"
},
"downloads": -1,
"filename": "adafruit_circuitpython_prompt_toolkit-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "d77e2be93fd052507600eec17f4b391c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 27226,
"upload_time": "2024-08-19T16:35:16",
"upload_time_iso_8601": "2024-08-19T16:35:16.784900Z",
"url": "https://files.pythonhosted.org/packages/3b/ee/ec1e46d6ae4682dd935c4c847c40744bc1952cc4a31eeebbed78a9c61d44/adafruit_circuitpython_prompt_toolkit-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-19 16:35:16",
"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": [],
"lcname": "adafruit-circuitpython-prompt-toolkit"
}