Skip to main content

A tool that automates presentation of software demos.

Project description

CodeAnim

CodeAnim is a tool to help you animate VS Code. It provides methods that enable you to type, move the cursor, and send commands to VS Code. It works by sending keystrokes using the pynput library.

Installation

We recommend install CodeAnim using uv.

uv tool install codeanim --python 3.12

Usage

CodeAnim runs commands from Markdown files where codeanim commands are enclosed in a python codeanim fence.

Example

Create a Markdown file called codeanim-markdown-demo.md with the following contents:

# A Markdown Header

Some text to be read.

```python codeanim
# Bring VS Code to the front
vscode.activate()

# Open myfile.py
vscode.focus("myfile.py")

# Insert print("Hello, World!") into myfile.py
write('print("Hello, World!")\n')

# Execute the script
vscode.run()
```

To execute the CodeAnim commands in the Markdown file:

codeanim run codeanim-markdown-demo.md

Flags

  • Set -v or --verbose to enable verbose mode. Commands will be printed out as they are executed.
  • Set --live to enable presentation mode. In this mode, a wait() will be injected after every codeanim fence.

Development

Formatting

This project adopts the Ruff formatter and is enforced by a GitHub action.

VS Code

Useful extensions when developing CodeAnim:

Tests

There aren't any unit tests yet. In the tests folder, there is an end-to-end test that uses CodeAnim to open the scratch.py file, types out some code, and executes it. To run the test:

./e2e-test.sh

Then, validate that it worked by observing that the animation runs, types out:

print("Hello, World!")

And executes the script.

Limitations

CodeAnim currently only works on MacOS because of a dependency on AppleScript, which is used to switch to the VS Code window. Also, many of the commands send Mac specific keystrokes. With some effort, CodeAnim can be made to work on other platforms.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codeanim-0.3.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codeanim-0.3.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file codeanim-0.3.0.tar.gz.

File metadata

  • Download URL: codeanim-0.3.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for codeanim-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ee44a5d87fa8c45c8fc1c4705e0f30e94cd15ea24d3e948271485846863741d7
MD5 af4ca6735fccbb89e8e86212eed5a795
BLAKE2b-256 2744c7040a202ee604051f7583144cbc3c0b0005b66c3b0ae5dbdd23ee08c9a3

See more details on using hashes here.

File details

Details for the file codeanim-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: codeanim-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for codeanim-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a0487b9cc2d86d26c5847086183839c32dba2ef1776e6381661c93dc084e439
MD5 b26e42359162f7c31d320c4b505d5d25
BLAKE2b-256 f36851b674c36e35f3a8fde32804473cc75671c2846aedfa6c2b18d707b03d62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page