Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/marrow/blueprint

Flexible manifest-driven file and folder creation.
https://github.com/marrow/blueprint

Last synced: about 2 months ago
JSON representation

Flexible manifest-driven file and folder creation.

Awesome Lists containing this project

README

        

h1(#title). Marrow Blueprint

bq(subtitle). Manifest-driven file and folder creation.

bq(byline). (C) 2010, Alice Bevan-McGregor

bq(byline). "https://github.com/pulp/marrow.blueprint":github-project

[github-project]https://github.com/pulp/marrow.blueprint

h2(#what-is). %1.% What is Marrow Blueprint?

The @marrow.blueprint@ package provides a streamlined way to generate on-disk files and folder trees using programmable manifests and template files embedded in another "Python":python package. Example use cases would include initial web application creation, Python package creation, or configuration files. Files can be template-driven using any templating language with "@alacarte@":alacarte integration.

In a larger scope @marrow.blueprint@ aims to replace other high-level directory tree templating libraries such as "Paste Script":pastescript while also implementing "Python 3":python compatibility.

Blueprints can accept command-line arguments (@--name=value@ pairs), define default values if the arguments are missing, and can interactively question the user for required values. Blueprints can be stored within zipped Python EGGs for efficient storage.

[alacarte]https://github.com/GothAlice/alacarte
[pastescript]http://pythonpaste.org/script/
[python]http://www.python.org/

h2(#installation). %2.% Installation

Installing @marrow.blueprint@ is easy, just execute the following in a terminal:

pip install marrow.blueprint

This will install the @blueprint@ command in your path, usually @/usr/bin@ or @/bin@.

If you add @marrow.blueprint@ to the @install_requires@ argument of the call to @setup()@ in your application's @setup.py@ file, @marrow.blueprint@ will be automatically installed and made available when your own application is installed.

h3(#install-dev). %2.1.% Development Version

Development takes place on "GitHub":github in the "marrow.blueprint":github-project project. Issue tracking, documentation, and downloads are provided there.

Installing the current development version requires "Git":git, a distributes source code management system. If you have Git, you can run the following to download and _link_ the development version into your Python runtime:

git clone https://github.com/pulp/marrow.blueprint.git

(cd marrow.blueprint; python setup.py develop)

You can upgrade to the latest version at any time:

(cd marrow.blueprint; git pull; python setup.py develop)

If you would like to make changes and contribute them back to the project, fork the GitHub project, make your changes, and submit a pull request. This process is beyond the scope of this documentation; for more information, see "GitHub's documentation":github-help.

[github]https://github.com/
[git]http://git-scm.com/
[github-help]http://help.github.com/

h2(#basic). %3.% Using Blueprints

The @blueprint@ command expects two positional arguments: @blueprint@ and @target@.

* @blueprint@ - The name of the blueprint to use.
* @target@ - The directory to create and extract the blueprint into.

Instead of being asked interactively for answers to questions, you can pass the answers to @blueprint@ ahead of time. For example:

blueprint create package MyPackage --name=MyPackage --package=mypkg --version=1.0

Any unanswered questions will still be prompted for. To prevent prompting for optional questions you can use the @-r/--required@ command line switch:

blueprint create -r package MyPackage --name=MyPackage --package=mypkg

h3(#environment). %3.1.% Environment Variables

You can define environment variables that declare defaults for the questions asked by @blueprint@. For example, you can set your default license and author information:

export BLUEPRINT_LICENSE="mit"

export BLUEPRINT_AUTHOR="Lord Wolfgang von Fahrvergnugen "

You will *not* be prompted for questions with answers in the environment. You can still override them on the command-line, however.

h2(#creating). %4.% Creating Blueprints

h2(#license). %5.% Marrow Blueprint License

Marrow Blueprint has been released under the MIT Open Source license.

h3. %5.1.% The MIT License

Copyright (C) 2010 Alice Bevan-McGregor and contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.