Metadata-Version: 2.4
Name: lions-pycard
Version: 0.1.0
Summary: A Python HyperCard-like card editor with scriptable buttons.
Author: Lion Kimbro
License-Expression: MIT
Project-URL: Homepage, https://github.com/LionKimbro/pycard
Project-URL: Repository, https://github.com/LionKimbro/pycard
Project-URL: Issues, https://github.com/LionKimbro/pycard/issues
Keywords: hypercard,tkinter,gui,cards,editor,scripting
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lionscliapp
Dynamic: license-file

# pycard

`pycard` is a Python HyperCard-like editor built with `tkinter`.

It provides a card-style canvas where you can place UI objects (`Label`, `Button`, `Entry`, `Text`), edit properties, save/load cards as JSON, and attach Python scripts to buttons.

## Features

- Visual card editor with select/move/create tools
- Object types: `label`, `button`, `entry`, `text`
- Property editor (double-click objects in edit mode)
- Per-button Python scripting (`on_click_code`)
- Script helpers in execution context:
  - `find_object_by_id(...)`
  - `find_object_by_name(...)`
  - `find_object_by_text(...)`
  - `get_text(...)`
  - `set_text(...)`
- Card persistence to `.pycard/cards.json`
- Window size persistence

## Repository

- https://github.com/LionKimbro/pycard

## Install

```bash
pip install pycard
```

## Run

```bash
pycard
```

or:

```bash
python -m pycard
```

## Basic Use

1. Open `Window -> Edit Mode`.
2. Use the detached `Tools` window to choose an object type.
3. Click the card to create an object (auto-returns to `Select`).
4. Double-click an object to edit properties.
5. Use `File -> Save` to persist to `.pycard/cards.json`.
6. Turn off edit mode to run button scripts.

## Example Button Script

```python
target = find_object_by_name("status")
if target:
    set_text(target, "Clicked!")
print("status text:", get_text("status"))
```

## Development

Requirements:
- Python 3.10+

Commands:

```bash
python -m pytest -q
python -m py_compile src/pycard/app.py src/pycard/cli.py
```

## License

MIT
