Installation

Boxes.py is a pure Python project that does support the regular setuptools method of shipping with setup.py. setup.py --help-commands and setup.py CMD --help provide the necessary documentation for building, installing or building binary formats.

Requirements

Python

Boxes.py is implemented in Python 3. For supported minor version see setup.py.

Python modules

Boxes.py need a set of Python modules:

affine>=2.0 markdown qrcode>=7.3.1 setuptools shapely>=1.8.2 sphinx

When using a distribution the packages will typically be name be python-MODULE or python3-MODULE

pstoedit

While not a hard requirement Boxes.py uses pstoedit (sometimes ps2edit) to offer formats that are not supported by directly by the graphics backend: DXF, gcode, PLT. Currently the location Boxes.py looks for pstoedit is hard coded to /usr/bin/pstoedit in the boxes.formats.Formats class.

Python modules for development

For development (e.g. running the test suite and generating the documentation) the following modules are also needed:

lxml mypy pre-commit pytest>=8.1.1 types-Markdown

Sphinx

For building the documentation locally you need the Sphinx documentation generator (package name may be python-sphinx or python3-sphinx). It is not needed for anything else. Boxes.py can be run and changed just fine without.

Running from working dir

Due to lazy developer(s) Boxes.py can also run from the Git checkout. The scripts in scripts/ are all supposed to just work right after git clone. The Inkscape needs a bit manual work to get running. See below.

Inkscape

As binary

Boxes.py can be used as a set of Inkscape plugins. The package does install the necessary .inx files to /usr/share/inkscape/extensions on unix operating systems. The .inx files assume that the boxes executable is available in the path (which it is when installing the binary package)

git repository easy way

After cloning it may be most convenient to generate the .inx files right in place by executing scripts/boxes2inkscape with the target path as only parameter.

  • global: scripts/boxes2inkscape /usr/share/inkscape/extensions/

  • userspace: scripts/boxes2inkscape ~/.config/inkscape/extensions/

On non unix operating the target directories may differ. You can look up the directories “User extensions” and “Inkscape extensions” within the Inkscape preferences Edit -> Preferences… -> System.

git repository manual way

setup.py build creates the *.inx files in the inkex/ directory.

They then have to be copied in either the global or the per user extension directory of Inkscape. These are /usr/share/inkscape/extensions/ and ~/.config/inkscape/extensions/ on a unix operating system. On non unix operating the target directories may differ. You can look up the directories “User extensions” and “Inkscape extensions” within the Inkscape preferences Edit -> Preferences… -> System.

As an alternative you can create a symlink to the inkex/ directory within the desired inkscape extension directory.

Platform specific instructions