Build system for font development.
Project description
Hellbox is a modular, editor-agnostic build system designed for font development. Hellbox is similar to some “Flow-based Programming” environments, consisting of a system of chained blackbox components.
Hellbox is in the early stages of development. This document is more of a roadmap than documentation of the current implementation. Expect API changes without notice until v1.0.
Goals
Consistency Hellbox tasks don’t take arguments by design, favoring consistent task output
Modularity Hellbox packages should be resuable and composable, while maintaining flexibility for custom workflows
Isolation Hellbox tasks and packages are version locked and isolated from other projects and Python installations
Overview
Hellbox aims to provide both an environment and framework for defining build pipelines.
Hellbox tasks are composed of “chutes” — modules that perform a single operation over one or more files. Chutes are connected together using the >> operator, linking the output of one chute to the input of the next.
from hellbox import Hellbox
from hellbox_generate_otf import GenerateOtf
with Hellbox("build") as task:
task.describe("Builds .otf files from .ufo source")
task.read("*.ufo") >> GenerateOtf() >> task.write("./otf")
With the above configuration, running hell run build will generate OTF files from all of the UFO sources, and write them to the otf directory.
Installation
First install hell, a CLI for managing hellbox projects. Then run hell init inside of your project (or hell install inside of an existing hellbox-enabled project).
This will set up a new virtual environment with Python 3 using pipenv, create a Hellfile.py for defining tasks, and install the hellbox library itself.
Chutes
There are two ways of defining a Hellbox chute, depending on the complexity and amount of configuration required.
The basic setup for defining your own chutes requires you to create a new subclass of Chute. You must define a method run which accepts a single files argument (an array) and returns a new array of modified files. Besides run, you can define any other methods you like on the new class.
from hellbox.chute import Chute
class FilterFilesByExt(Chute):
def __init__(self, *extensions):
self.extensions = extensions
def run(self, files):
return [f for f in files if f.extension in self.extensions]
You can then use your chute in your Hellfile as such:
with Hellbox("backup") as task:
task.read("build/*") >> FilterFilesByExt("otf", "txt") >> task.write("backup")
If your chute doesn’t require arguments when initialized, you may prefer to define it with a function instead of a class. Using the @Chute.create function decorator makes a function definition act like a subclass of Chute:
from hellbox.chute import Chute
@Chute.create
def GenerateWoff2(files):
# do something to files...
return files
with Hellbox("webfonts") as task:
task.read("build/*.ttf") >> GenerateWoff2() >> task.write("webfonts")
CLI
Hellbox comes with a command line tool hell which offers a thin layer over pipenv. Using the CLI is highly recommended, as it makes working in isolation dead simple.
Development
Install development dependencies with make. Run tests with make test.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file hellbox-0.1.3.tar.gz
.
File metadata
- Download URL: hellbox-0.1.3.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23ac513d45ef32f9ba692c9213900e551f361a4724c14afbe465f2e9cb665c3d |
|
MD5 | 687e135514877029d5c5039020c1d58d |
|
BLAKE2b-256 | 1060b5d1db999cc6c10eb8f06ba3ae962c23f62c041e1c6ac58f2b3d3cfdc4a3 |
File details
Details for the file hellbox-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: hellbox-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08f6b08d6796fc4edaefb4b8cacee57e79d8c1628112b297702d4e1479ab51b7 |
|
MD5 | b1358f6953499a5e33f3a55370f6dc18 |
|
BLAKE2b-256 | dfdcd9f9c7e869464c49706f344ca72d978f1ef45973b2c9a40fea1adeb0d704 |