Skip to main content
# jetpack

[![Build Status](https://travis-ci.org/bmweiner/jetpack.svg?branch=master)](https://travis-ci.org/bmweiner/jetpack)

Jetpack is a package
[templating](https://en.wikipedia.org/wiki/Template_processor)
system based on the [mustache](http://mustache.github.io/) template syntax.

A jetpack template (pack) is just a directory containing subdirectories and
template files. A pack might be a
[python package](https://docs.python.org/2/tutorial/modules.html#packages),
[R package](https://cran.r-project.org/manuals.html#R-exts),
[Ruby gem](http://guides.rubygems.org/make-your-own-gem/),
anything...

Packs are stored in a [hanger](https://github.com/bmweiner/hanger) and
rendered by the jetpack utility.

## the Hanger

A simple hanger might look like this:

hanger/
pack1/
profile.md
pack.json
pack2/
bio.txt
pack.cfg
pack.json

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](http://mustache.github.io/) template syntax
(implemented with [pystache](https://github.com/defunkt/pystache)).

Partials are relative to the hanger directory.

hanger/pack1/profile.md

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

hanger/pack2/bio.txt

Belichick has extensive authority over the Patriots'...

### Context Files

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

hanger/pack.json

{
"team": "New England Patriots"
}

hanger/pack1/pack.json

{
"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.

**datetime**

* 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
available:

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

[class]
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
[directives](https://docs.python.org/2/library/time.html#time.strftime).

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

## Installation

$ git clone https://github.com/bmweiner/jetpack.git
$ python setup.py install

or

$ 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](https://github.com/bmweiner/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

Metadata

Release files for jetpack 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jetpack 1.1
File Size Uploaded Provenance Actions
jetpack-1.1.tar.gz 5.5 kB Without provenance Details for jetpack-1.1.tar.gz

Release files / jetpack-1.1.tar.gz

Download URL jetpack-1.1.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d274a6a0077f6b51ca94cf6229da503d6c5f28169baee0704542f809c761b76e
BLAKE2b-256 checksum
How to use checksums
58a4c42d0a3a80a1cbc55e907f43d4ea201fd4bbd827243a37b2cb46334c7c7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for jetpack 1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page