benjie-git / CardStock

CardStock is a cross-platform tool for quickly and easily building programs. It provides a drawing-program-like editor for visually laying out your programs' parts, and a code editor for adding event-driven python code.
Mozilla Public License 2.0
249 stars 9 forks source link
education prototyping python

CardStock

About

CardStock is a cross-platform tool for quickly and easily building graphical programs, called stacks, which can be made up of multiple pages called cards. It provides a drawing-program-like editor for building Graphical User Interfaces, and a code editor for adding event-driven python code.

Pong example

There have been many open source projects in the past that tried to capture the fun and simplicity of building programs in HyperCard, but in my opinion, none of them offered the open-ended possibilities and ease of use that made HyperCard such a magical-feeling tool. So in the grand open source tradition, I built my own.

The guiding principles behind my vision for CardStock are the following, in order of importance:

  1. Keep it approachable, understandable, simple, and efficient to use for python beginners, through the most salty of Senior Software Engineers.
  2. Make it as capable as possible, without adding unnecessary complexity.

Features

The Basics

More Advanced

Future Plans


Known Issues

Requirements

The prebuilt applications for Mac and Windows have no external dependencies.

Running CardStock from source requires Python 3.9 or newer (3.11+ recommended), and wxPython 4.1 or newer (wxPython 4.2.x recommended). CardStock requires installing the python modules attrdict3(linux-only), wxpython,simpleaudio, PyInstaller, and requests.
For mp3 playback support, you'll need to install the lame package (mp3 decoder), and python's streamp3.

Installation

You can either:

1. Download the latest, pre-built CardStock application for Mac or Windows

(This is strongly recommended for Windows users, as building from source is quite an adventure.)

  1. Download CardStock for Mac or Windows here: https://github.com/benjie-git/CardStock/releases/latest
  2. Note that the pre-built Windows app is not yet code-signed, so Windows may complain the first time you open the app. If a window appears saying "Windows protected your PC", click the More Info link at the end of the warning paragraph, and then the "Run Anyway" button that appears at the bottom of the window.

2. Run it from source:

  1. install python3

  2. Linux-only: apt install libasound2-dev lame libwebkit2gtk-4.0-dev # or equivalent on non-debian/ubuntu distros

  3. Mac-only: brew install lame

  4. pip3 install attrdict3

  5. pip3 install wxpython PyInstaller requests # note that wxpython can take a long time to build

  6. pip3 install --force git+https://github.com/cexen/py-simple-audio.git # The official simpleaudio package is no longer maintained. This fork includes a fix for compatability with python 3.12+

  7. To include mp3 support: pip3 install streamp3

    Note that this may require setting LDFLAGS and CPPFLAGS to allow finding the lame header and library files.

    You may need to run this as something like

    CPPFLAGS=-I/opt/homebrew/include LDFLAGS=-L/opt/homebrew/lib pip3 install streamp3 or

    CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib pip3 install streamp3

    depending on where the lame library was installed.

  8. download or clone this repository

  9. run python3 designer.py

  10. optionally run build.py to create your own standalone applications for the CardStock Designer application.

3. Install using pip/pypi:

  1. Linux-only: apt install libasound2-dev lame libwebkit2gtk-4.0-dev # or equivalent on non-debian/ubuntu distros

  2. Mac-only: brew install lame

  3. To include mp3 support: pip3 install streamp3

    Note that this may require setting LDFLAGS and CPPFLAGS to allow finding the lame header and library files.

    You may need to run this as something like

    CPPFLAGS=-I/opt/homebrew/include LDFLAGS=-L/opt/homebrew/lib pip3 install streamp3 or

    CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib pip3 install streamp3

    depending on where the lame library was installed.

  4. pip3 install cardstock # note that the dependency wxpython can take a very long time to build

  5. run using the newly installed cardstock command

Reference