An utility for configuring python projects from jinja templates.
Project description
fig-py is a command line tool for generating skeletons of python packages from a directory of jinja templates.
The interface is easy:
fig -p my-new-project -g my-github-user-name
This will initialize a highly-opinionated github repository, with your command line args inserted in relevant places throughout the following directory tree:
my-new-project ├── README.md ├── build_docs.sh ├── docs │ ├── Makefile │ ├── _static │ │ └── logo.png │ ├── _themes │ │ ├── flask_theme_support.py │ │ └── kr │ │ ├── autotoc.html │ │ ├── layout.html │ │ ├── relations.html │ │ ├── sidebarlogo.html │ │ ├── static │ │ │ └── flasky.css_t │ │ └── theme.conf │ ├── conf.py │ ├── index.rst │ └── install.rst ├── requirements.txt ├── setup.py ├── src │ └── __init__.py └── tests ├── README.md ├── __init__.py ├── fixtures │ └── README.md └── tests.py
This default template comes with nose for testing, sphinx for docs (with Kenneth Reitz’s Template), travis-ci for continuous integration and pandoc for rendering your markdown README.md on py-pi.
You can build and serve the docs by running build.sh.
Customizing
If you’d like, you can also create your own folder of jinja templates and pass it in as follows:
fig -p my-new-project -g my-github-user-name -t path/to/my-template/
You can also pass in a series of custom json key-value pairs if you want to add extra context:
fig -p my-new-project -g my-github-user-name -t my-template/ -k "{'key1':'value1', 'key2':'value2'}"
These values can be inserted anywhere in your custom templates using standard jinja syntax:
{{ key1 }}, {{ key2 }}
Heres the full cli specification:
usage: fig [-h] [-p PROJECT_NAME] [-g GITHUB_USER] [-a AUTHOR] [-e EMAIL] [-d DESCRIPTION] [-t TEMPLATE_PATH] [-k KWARGS] Initialize a python repository. optional arguments: -h, --help show this help message and exit -p PROJECT_NAME, --project-name PROJECT_NAME The name of your project. -g GITHUB_USER, --github-user GITHUB_USER Your github user name. -a AUTHOR, --author AUTHOR Your name. -e EMAIL, --email EMAIL Your email. -d DESCRIPTION, --description DESCRIPTION The projects' description. -t TEMPLATE_PATH, --template TEMPLATE_PATH A directory of custom templates -k KWARGS, --kwargs KWARGS A json string or a .json / .yml filepath of custom kwargs
Installation
pip install fig-py
TODO: * Don’t rely on os.system() * create repository on github * activate virtualenv * webhooks for read the docs / s3 upload for data / binaries.
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 fig-py-0.0.3.tar.gz
.
File metadata
- Download URL: fig-py-0.0.3.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80c939b66cb9fc7c74a9d2dec87f12892d1d1c281899171d2dc6c672cd27be09 |
|
MD5 | 8b59000bf5c9d2ed51feae97ecbde9e1 |
|
BLAKE2b-256 | 80bd0983c9229c8284cfbb2f6b548a253709848e9fcc15e0a0692227240e8baa |
File details
Details for the file fig-py-0.0.3.macosx-10.9-intel.exe
.
File metadata
- Download URL: fig-py-0.0.3.macosx-10.9-intel.exe
- Upload date:
- Size: 131.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4065a3a51ac3b7092e48909cd77e936fae0ca805a121da6e642569d1d0c8a50e |
|
MD5 | 564a98c0e80c4ddeb820720bc500937e |
|
BLAKE2b-256 | 14393c02df7761a6fd3281cdddfd649fbdc5836940fed86329fb1283c5fc38c3 |