This project is an opinionated template for ML projects which creates package skeletons.
Once generated, the package skeletons have the following features:
- Good base folder structure for many kinds of ML Projects
- CI testing (travis, tox and pytest)
- Automated building, versioning and hosting of documentation (sphinx on github pages)
- using
pipenv
and thePipfile
format to manage virtual environments and dependencies.
The project template is populated and then processed by the excellent Cookiecutter Python tool.
The objective of this project is to provide a generic machine learning template for python based projects. This includes folder structure, testing and documentation tools integrated with travis and github which should work well for most small to midsize (in terms of number of features & examples) projects using a single instance of a machine.
- post hook sphinx-quickstart
- travis config for docs to gh_pages
- Testing setup with py.test
- Travis-CI: Ready for Travis Continuous Integration testing
- Tox testing: Setup to easily test for Python versions
- Sphinx docs: Documentation ready for generation with, for example, ReadTheDocs
- Bumpversion: Pre-configured version bumping with a single command
- Auto-release to PyPI when you push a new tag to master (optional)
- Command line interface using Click (optional)
Linux:
Windows:
Not supported for now.
Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):
pipenv install cookiecutter
Generate a Python package project from this template:
cookiecutter https://github.com/project-delphi/cookiecutter-ml-template.git
Then:
- Create a repo and put it there.
- Add the repo to your Travis-CI account.
- Install the dev requirements using
pipenv
from anPipfile
.pipenv install
- Register your project with PyPI.
- Run the Travis CLI command travis encrypt --add deploy.password to encrypt your PyPI password in Travis config and activate automated deployment on PyPI when you push a new tag to master branch.
- Add the repo to your ReadTheDocs account + turn on the ReadTheDocs service hook.
- Release your package by pushing a new tag to master.
- Add a requirements.txt file that specifies the packages you will need for your project and their versions. For more info see the pip docs for requirements files.
- Activate your project on pyup.io.
For more details, see the cookiecutter-pypackage tutorial.
Not Exactly What You Want? Don't worry, you have options. You can look at:
- Similar Projects
- Other Cookiecutter Templates
- Non Cookiecutter Package Skeletons
- Fork this project
- Submit a Pull Request
Related Cookiecutter Templates:
- pytorch-template for pytorch projects
- deeplearning: template for deeplearning projects
- Driven Data's data science template for data science projects
Other Project Templates Without Cookiecutter
Also see the network and family tree for this repo. (If you find anything that should be listed here, please add it and send a pull request!)
If you have differences in your preferred setup, I encourage you to fork this to create your own version. Or create your own; it doesn't strictly have to be a fork.
Pull requests are welcome, if they're small, atomic, and if they make my own packaging experience better.
Aside from PR's you can contact me on twitter.
You can take our detailed course that covers all the features of the cookiecutter project, which has the added bonus of funding it:
También disponible en español:
This template is heavily based on PyPackage template from @audreyr.
It is also inspired by Data Science template from Driven Data.
You can check out the full license here
This project is licensed under the terms of the MIT license.