moo is a tool for managing data structures. moo operates on:
- schema
- data structures describing the structure of data (including schema).
- model
- data structure matching schema to a template.
- templates
- marked up text in some target format which is parameterized by a model and from which a document (eg, C++ code file) may be generated.
- codegen
- generated artifacts
The current moo version is
moo version
0.1.0
moo requires Python 3.5 or newer and python
below is assumed to
provide that.
moo installs in to your favorite Python environment in most of the usual ways. Some examples are given below. Due to a name conflict (this) moo is not expected to be distributed through PyPI.
Here, python
is assumed to be Python 3. Use whatever your favorite Python environment is to assure that. Some suggestions:
$ python3 -m venv venv $ source venv/bin/activiate
Install direnv
and activate it in your shell, then:
$ echo "layout python3" > .envrc $ direnv allow
See more at https://github.com/direnv/direnv
To install the dependencies, you may use the latest requirements.txt
file or one from a release.
$ python -m pip install -r https://raw.githubusercontent.com/brettviren/moo/master/requirements.txt
$ python -m pip install https://github.com/brettviren/moo/archive/0.3.0.tar.gz
$ python -m pip install git+git://github.com/brettviren/moo.git#egg=moo
Or, to allow working on the code:
$ git clone git@github.com:brettviren/moo.git $ cd moo $ pyton -m pip install -e .
The moo command line interface provides various commands and online help:
$ moo --help
See documentation section for details.
- https://brettviren.github.io/moo
- code repository and its README
- moo high level documentation
- moo object schema paradigm
- moo object types
- moo and build systems
- moo as Wire-Cell user package generator
- moo for LaTeX and spreadsheet generator
The name moo is a play on the Japanese term 無 which may be interpreted to English in a few ways. Some are listed below along with how the meaning reflects on aspects of moo.
- Untainted pure mind
- moo avoids being “opinionated”, is centered on ideas expressed as abstract data structures and so can be used for a wide variety of things from generating code, documents or package skeletons. moo forms its data structures by ingesting most of the popular file formats likely to be used. And, moo can produce any file format for which a user may create a template.
- No strings attached
- moo is not intended to be an invasive tool. moo artifacts can be generated as desired and moo may be left behind. moo does not lock-in particular formats. moo extends this freedom to your own applications. By adopting moo codegen philosophy an app need not lock-in itself to particular data formats, representations, or serializations technologies.
- Nothingness
- moo is not really anything itself but rather it is the bits that go between other real things which perform the “heavy lifting” (Jsonnet, anyconfig, Jinja, JSON Schema, user templates). moo lets apps embrace the power of this nothingness by switching developer effort away from repetitive programming tasks and toward data structure and template development and then through code generation that effort gains multiplicative power.