1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
.. _calling-from-python:
Calling Cookiecutter Functions From Python
------------------------------------------
You can use Cookiecutter from Python:
.. code-block:: python
from cookiecutter.main import cookiecutter
# Create project from the cookiecutter-pypackage/ template
cookiecutter('cookiecutter-pypackage/')
# Create project from the cookiecutter-pypackage.git repo template
cookiecutter('https://github.com/audreyfeldroy/cookiecutter-pypackage.git')
This is useful if, for example, you're writing a web framework and need to provide developers with a tool similar to `django-admin.py startproject` or `npm init`.
See the :ref:`API Reference <apiref>` for more details.
|