Project generator for use with the datakit framework.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
datakit_project
docs
tests
.gitignore
.travis.yml
HISTORY.rst
LICENSE
MANIFEST.in
Makefile
README.rst
requirements-dev.txt
requirements.txt
setup.cfg
setup.py
tox.ini

README.rst

Linux build status on Travis CI Documentation Status

datakit-project plugin

A datakit plugin for generating project skeletons from Cookiecutter templates.

Installation

For a system-wide install, at the command line:

$ sudo pip install datakit-project

Usage

datakit-project relies on the Cookiecutter library to generate project templates from local git repositories as well as repositories hosted on Github.

Creating your first project

There are a few ways to create a project from a template:

# From a local project
$ datakit project create --template /local/path/to/cookiecutter-basic-project

# From Github
$ datakit project create --template https://github.com/associatedpress/cookiecutter-basic-project.git

# From Github, but using an alias (less typing! WOOT!)
$ datakit project create --template gh:associatedpress/cookiecutter-basic-project

When you create a project, you will be prompted on the command-line for a series of information. Fill in the info or hit return to accept defaults, as appropriate.

The project will be generated in the same directory where the command was invoked.

Default template

As a convenience, the template used on your first project will be set as a default for future projects:

$ datakit project create # Uses cookiecutter-basic-project

You can update the default template by using the --make-default flag:

$ datakit project create --make-default --template gh:associatedpress/cookiecutter-some-other-project

Or you can directy edit the default_template variable in the :ref:`plugin-configuration`:

# Edit ~/.datakit/plugins/datakit-project/config.json
{"default_template": "/path/to/.cookiecutters/cookiecutter-basic-project"}

Installing more templates

Datakit suports use of more than one template. You simply need to specify the new template:

$ datakit project create --template gh:associatedpress/cookiecutter-some-other-project

Once installed locally, you can save a few key strokes:

# Here, we drop the Github alias and organization
$ datakit project create --template cookiecutter-some-other-project

Or save yourself even more typing and make it the default template:

$ datakit project create --make-default --template cookiecutter-some-other-project

See :ref:`default-template` for more details on updating the default template.

Default user configs

Save yourself even more typing -- picking up on a theme here? -- by creating a user configuration file with your email and full name.

These values will be used as defaults whenever you create a new project.

These configs should be stored in a cookiecutter user configuration file located at ~/.cookiecutterrc.

Add and customize the below settings to the config file:

default_context:
    full_name: <Firstname Lastname>
    email: <your email>

This is a YAML-format file, so pay close attention to formatting! In particular, note the single space after the full_name and email settings.

Templates

Datakit stores new templates in the standard Cookiecutter location: ~/.cookiecutters.

Plugin Configuration

By default, datakit-project stores its configurations in ~/.datakit/plugins/datakit-project/config.json.