Skip to main content

Client library for Sidekick Visual Coding Buddy

Project description

Sidekick Python Library (sidekick-py)

GitHub Repository PyPI version VS Code Marketplace License: MIT

This library provides the Python interface for interacting with the Sidekick Visual Coding Buddy frontend UI, typically running within VS Code. It allows your Python scripts to easily create, update, and interact with visual modules like grids (Grid), consoles (Console), variable visualizers (Viz), drawing canvases (Canvas), and UI controls (Control).

Installation

Install the library using pip:

pip install sidekick-py

You will also need the Sidekick VS Code extension installed and running in VS Code.

Minimal Usage Example

First, open the Sidekick panel in VS Code (Press Ctrl+Shift+P, search for and run Sidekick: Show Panel).

Then, save and run the following Python script:

import sidekick

# 1. Create a 16x16 Grid
grid = sidekick.Grid(16, 16)

# 2. Define what happens when a cell is clicked
def handle_click(x, y):
    # Update the clicked cell in the Sidekick UI
    grid.set_color(x, y, 'red')
    print(f"Cell ({x}, {y}) clicked!") # Optional: Print to terminal

# 3. Register the click handler
grid.on_click(handle_click)

# 4. Keep the script running to listen for clicks!
#    Without this, the script would end, and clicks wouldn't be handled.
sidekick.run_forever()

After running the script, clicking the grid cells in the Sidekick panel will turn them red. Press Ctrl+C in the terminal to stop.

Learn More

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

sidekick_py-0.0.5.tar.gz (85.1 kB view details)

Uploaded Source

File details

Details for the file sidekick_py-0.0.5.tar.gz.

File metadata

  • Download URL: sidekick_py-0.0.5.tar.gz
  • Upload date:
  • Size: 85.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for sidekick_py-0.0.5.tar.gz
Algorithm Hash digest
SHA256 a1df21d9651de398d36cba9d980f662990402c0a8db8068a2655162bfbef87b9
MD5 709dca60e1ccd83f94d923f3f51aa569
BLAKE2b-256 cd1b31c160b7a91d331602545b39b299dd26be92f75bc8ed29530b8769b937f0

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