Skip to main content

A package templating system.

Project description

# jetpack

[![Build Status](](

Jetpack is a package
system based on the [mustache]( template syntax.

A jetpack template (pack) is just a directory containing subdirectories and
template files. A pack might be a
[python package](,
[R package](,
[Ruby gem](,

Packs are stored in a [hanger]( and
rendered by the jetpack utility.

## the Hanger

A simple hanger might look like this:


Each pack has it's own directory in the hanger and contains all the
subdirectories and template files for that pack. Additionally `pack.cfg` and
`pack.json` files may exist at the hanger and/or pack level.

### Template Files

Templates use the [mustache]( template syntax
(implemented with [pystache](

Partials are relative to the hanger directory.


# {{team}}
{{first}} {{last}}
## Bio
{{> pack2/bio.txt}}
Created: {{today}}


Belichick has extensive authority over the Patriots'...

### Context Files

Context is stored in **pack.json** files.


"team": "New England Patriots"


"first": "Bill",
"last": "Belichik",
"role": "coach"

#### Built-in Context

The default context includes the following tags, which can be overwritten in a
context file, if desired.


* today: %c
* year: %Y
* month: %m
* day: %d
* hour: %H
* minute: %M
* second: %S

### Configuration Files

Configuration is stored in **pack.cfg** files. The following options are

A pack object can inherit the templates, contexts, and configurations of other
packs. Base classes are separated by a comma.

base: python,generic

#### Inheritance

When base classes are specified, templates, contexts, and configurations are
inherited in the following order:

* pack
* pack bases (recursive)
* hanger

Circular imports are not permitted.

Set the format of built-in context tags by using the datetime

today: %c
year: %Y
month: %m
day: %d
hour: %H
minute: %M
second: %S

## Installation

$ git clone
$ python install


$ pip install jetpack

## Usage

jetpack provides a terminal command `jetpack`:

$ jetpack python -s /path/to/hanger
name: my_package
description: The best package!

try `jetpack --help` for additional details on usage.

and a python module for interaction:

import jetpack
jetpack.launch(hanger='/path/to/hanger', pack='python', name='my_package',
description='The best package!')

## Example

Fork my [hanger]( to get started. This
example demonstrates using...

* partials to create .gitignore and LICENSE
* subclasses to render python-flask pack from python pack
* built-in datetime context

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

jetpack-1.1.tar.gz (5.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page