*****
Purdy
*****
During talks or screencasts I don't want to be typing code, it is too error
prone and too likely to mess up my speaking flow. **Purdy** is both a set of
programs and a library to display colourized code in a series of animations.
The ``purdy`` command takes one of a Python program, a Python REPL console file
or a Bash console file. Source code is presented to the screen as if typing.
For console files, the typing pauses at a prompt, waiting for interaction.
Prompts are:
* ``>>>`` or ``...`` for Python REPL
* ``$`` for Bash console
If the program is paused at a prompt, pressing the **right** arrow will
continue. Typing animation can be skipped over by pressing the letter "s"
instead. Animation can be undone by pressing the **left** arrow. More info on
keys can be found in the help dialog, viewed by pressing "?".
Example Usage:
.. code-block:: bash
$ purdy code-snippet.py
The result looks like this:
.. image:: screenshot.gif
Once the code has been displayed, further key presses are ignored. At any time
you can press "q" to quit.
Purdy Programs
##############
The following programs come with the `purdy` library:
* ``purdy`` -- Animated display that looks like a program is being typed to the
screen.
* ``pat`` -- "purdy cat", prints ANSI colourized source.
* ``prat`` -- "purdy RTF cat", prints colourized source in RTF document format.
Particularly useful for copying to a clipboard and pasting full colourized
source into a document. On OS X `prat <filename> | pbcopy` will put the
output directly to the clipboard.
* ``subpurdy`` -- Full set of commands to control Purdy. Sub-commands dictate
behaviour. Does a variety of code presentation. Includes ANSI, RTF, HTML
output as well as the typewriter animations.
More information can be found in the Command Line Program Documentation.
Purdy TUI Controls
##################
The following keys help you to control the TUI purdy programs:
* ``?`` -- Help screen
* ``<RIGHT>`` -- next animation step
* ``<LEFT>`` -- previous animation step
* ``s`` -- go to the next step, skipping any animation
For custom made code using the purdy library, the following controls will also
work:
* ``S`` -- go to the next section, skipping any animation.
* ``<TAB>`` -- focus next window area in a multi Screen display
* ``<SHIFT><TAB>`` -- focus previous window area in a multi Screen display
Additionally the ``s``, ``S``, and ``<LEFT>`` commands all support skipping
multiple steps by specifying a number first. For example the sequence ``12s``
would skip past the next 12 steps.
Purdy Library
#############
The ``purdy`` script is fairly simple. You can create more complex animations
by writing programs using the purdy library. Custom programs can have split
screens, highlighting lines, slide transitions and more. More information can
be found in the Library Documentation.
Installation
############
.. code-block:: bash
$ pip install purdy
Supports
########
Purdy has been tested with Python 3.8 through 3.12. Terminal control is done
with the `Urwid <http://urwid.org/>`_ library. Parsing and tokenization is
done through `Pygments <https://pygments.org/>`_. Both libraries are
execellent and I'm grateful they're publically available.
Docs & Source
#############
Docs: http://purdy.readthedocs.io/en/latest/
Source: https://github.com/cltrudeau/purdy
Raw data
{
"_id": null,
"home_page": "https://github.com/cltrudeau/purdy",
"name": "purdy",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "code display",
"author": "Christopher Trudeau",
"author_email": "ctrudeau+pypi@arsensa.com",
"download_url": "https://files.pythonhosted.org/packages/b4/8e/c13168c7259caf14b5dd66aa1897f38ce812311bd3d8914db9185641ccf2/purdy-1.14.0.tar.gz",
"platform": null,
"description": "*****\nPurdy\n*****\n\n\nDuring talks or screencasts I don't want to be typing code, it is too error\nprone and too likely to mess up my speaking flow. **Purdy** is both a set of\nprograms and a library to display colourized code in a series of animations.\n\nThe ``purdy`` command takes one of a Python program, a Python REPL console file\nor a Bash console file. Source code is presented to the screen as if typing.\nFor console files, the typing pauses at a prompt, waiting for interaction. \nPrompts are: \n\n* ``>>>`` or ``...`` for Python REPL\n* ``$`` for Bash console\n\nIf the program is paused at a prompt, pressing the **right** arrow will\ncontinue. Typing animation can be skipped over by pressing the letter \"s\"\ninstead. Animation can be undone by pressing the **left** arrow. More info on\nkeys can be found in the help dialog, viewed by pressing \"?\".\n\nExample Usage:\n\n.. code-block:: bash\n\n $ purdy code-snippet.py\n\nThe result looks like this:\n\n.. image:: screenshot.gif\n\nOnce the code has been displayed, further key presses are ignored. At any time\nyou can press \"q\" to quit.\n\n\nPurdy Programs\n##############\n\n\nThe following programs come with the `purdy` library:\n\n* ``purdy`` -- Animated display that looks like a program is being typed to the\n screen.\n* ``pat`` -- \"purdy cat\", prints ANSI colourized source.\n* ``prat`` -- \"purdy RTF cat\", prints colourized source in RTF document format.\n Particularly useful for copying to a clipboard and pasting full colourized\n source into a document. On OS X `prat <filename> | pbcopy` will put the\n output directly to the clipboard.\n* ``subpurdy`` -- Full set of commands to control Purdy. Sub-commands dictate \n behaviour. Does a variety of code presentation. Includes ANSI, RTF, HTML\n output as well as the typewriter animations.\n\nMore information can be found in the Command Line Program Documentation.\n\n\nPurdy TUI Controls\n##################\n\nThe following keys help you to control the TUI purdy programs:\n\n* ``?`` -- Help screen\n* ``<RIGHT>`` -- next animation step\n* ``<LEFT>`` -- previous animation step\n* ``s`` -- go to the next step, skipping any animation\n\nFor custom made code using the purdy library, the following controls will also\nwork:\n\n* ``S`` -- go to the next section, skipping any animation. \n* ``<TAB>`` -- focus next window area in a multi Screen display\n* ``<SHIFT><TAB>`` -- focus previous window area in a multi Screen display\n\nAdditionally the ``s``, ``S``, and ``<LEFT>`` commands all support skipping\nmultiple steps by specifying a number first. For example the sequence ``12s``\nwould skip past the next 12 steps.\n\n\nPurdy Library\n#############\n\nThe ``purdy`` script is fairly simple. You can create more complex animations\nby writing programs using the purdy library. Custom programs can have split\nscreens, highlighting lines, slide transitions and more. More information can\nbe found in the Library Documentation.\n\n\nInstallation\n############\n\n.. code-block:: bash\n\n $ pip install purdy\n\n\nSupports\n########\n\nPurdy has been tested with Python 3.8 through 3.12. Terminal control is done\nwith the `Urwid <http://urwid.org/>`_ library. Parsing and tokenization is\ndone through `Pygments <https://pygments.org/>`_. Both libraries are\nexecellent and I'm grateful they're publically available.\n\n\nDocs & Source\n#############\n\nDocs: http://purdy.readthedocs.io/en/latest/\n\nSource: https://github.com/cltrudeau/purdy\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Terminal based code snippet display tool",
"version": "1.14.0",
"project_urls": {
"Homepage": "https://github.com/cltrudeau/purdy"
},
"split_keywords": [
"code",
"display"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "18885ec78c96b86f19d355333eb8dbdca5259fb44c100f05c7e9614dde71be0c",
"md5": "8db55b752f5955a6a96ae24445b15579",
"sha256": "a892c42f0755be779f3acf68004a61e5d63dded6b66fadf3778774bbe4c3f96a"
},
"downloads": -1,
"filename": "purdy-1.14.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "8db55b752f5955a6a96ae24445b15579",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 66045,
"upload_time": "2024-11-07T14:30:08",
"upload_time_iso_8601": "2024-11-07T14:30:08.196542Z",
"url": "https://files.pythonhosted.org/packages/18/88/5ec78c96b86f19d355333eb8dbdca5259fb44c100f05c7e9614dde71be0c/purdy-1.14.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b48ec13168c7259caf14b5dd66aa1897f38ce812311bd3d8914db9185641ccf2",
"md5": "d0d920d51030966795eb9e1fbaf2b9d5",
"sha256": "4e814526d8be76df9fa4c20fe3a502ba09fe6381a57f2643dec3b327ec02b284"
},
"downloads": -1,
"filename": "purdy-1.14.0.tar.gz",
"has_sig": false,
"md5_digest": "d0d920d51030966795eb9e1fbaf2b9d5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 53791,
"upload_time": "2024-11-07T14:30:09",
"upload_time_iso_8601": "2024-11-07T14:30:09.898551Z",
"url": "https://files.pythonhosted.org/packages/b4/8e/c13168c7259caf14b5dd66aa1897f38ce812311bd3d8914db9185641ccf2/purdy-1.14.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-07 14:30:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cltrudeau",
"github_project": "purdy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "purdy"
}