Medikit automates keeping your projects' boilerplate files and directory sane and up to date.
It (optionally) generates and maintains a bunch of files, updating them according to rules you define.
It's not a dependency. All changes are commited in your source tree.
You write amazing code, Medikit focuses on keeping it clean and ordered.
Medikit generates and updates all non-business related files in your python or polyglot projects.
It's based on a extensible features set that combines to build the exact right files (like
Dockerfile, tests directory structure, package directory structure, etc.)
Want to update your project? Run
First time in a new project? Run
Medikit is an “eventual” dependency, meaning that developpers won't need it to actually use the project. All results of its execution are commited in your git repository.
The only configuration file required is a
Projectfile, which contains regular Python code.
It describes the feature you use (i.e Python, Make, Git, Docker and Pytest), the custom choices you
took about them and eventually some project-specific features (wanna add a
command? Three lines in there).
Once you run
medikit update, you'll get a
Makefile that contains everything
a developper needs to use this project. Whatever you have, it is the exposed interface, and all
newcomers can run
make help to understand their possibilities.
The base building blocks of a Medikit-managed projects are combinable features.
To add a feature, you need a
Projectfile at your project's root (which is written in python),
require(...) the feature:
from medikit import require python = require('python') python.setup( name='acme' )
You then need to run
medikit update to apply changes to your project's codebase (or
|Documentation Git||Git SCM support (always enabled)||
|Documentation Make||Makefile generation support (always enabled)||
|Documentation Format||Code formatting, using various tools ("black" and "isort" are the default)||
|Documentation Pytest||Tests, using pytest (requires python)||
|Documentation Python||Python 3.5+ package using setuptools||
|Documentation Sphinx||Sphinx documentation generator||
|Documentation Django||Django project (requires python)||
|Documentation Docker||Docker packaging support||
|Documentation Nodejs||Nodejs package, using Yarn||
|Documentation Webpack||Webpack web assets builder (requires nodejs)||
|Documentation Kube||Kubernetes deployment support||
|Documentation Pylint||Linting, using pylint (requires python)||
|Documentation Yapf||Code formatting, using yapf (requires python)||
To extend medikit, you have two options.
If you only need a "local" extension, that is only valid in a given project, you can extend it inline
Projectfile, most probably by listening to an event sent either by medikit, or a
Here is an example that extends the
make feature to add an environment variable and a target:
from medikit import listen, require make = require('make') @listen(make.on_generate) def on_make_generate(event): event.makefile['HELLO_NAME'] = 'World' event.makefile.add_target('hello', '@echo "Hello, $(HELLO_NAME)"', phony=True, doc="Say Hello")
medikit update calls will update your project with your customization.
The second option is to write a feature class, which is mostly a bunch of event listeners and a mechanism to autoregister into medikit.
Have a look at the builtin features source code, and write a similar class in your
own package. Then, you'll just need to add it as a
medikit.feature entrypoint and install your
As the mechanism for both inline extension and packaged features are the same, it's usually a good idea to test an idea / feature locally within a project, and only refactor it as a feature once you're satisfied enough.
Medikit and the surrounding material (like this website) is licensed under the Apache License, version 2.0.
The dependencies and other tools used by the features have their own licenses, please have a look at their websites if you're unsure about what's allowed.