https://github.com/xtensor-stack/xtensor-python-cookiecutter
Cookiecutter for a Python project making use of xtensor
https://github.com/xtensor-stack/xtensor-python-cookiecutter
Last synced: 9 months ago
JSON representation
Cookiecutter for a Python project making use of xtensor
- Host: GitHub
- URL: https://github.com/xtensor-stack/xtensor-python-cookiecutter
- Owner: xtensor-stack
- License: bsd-3-clause
- Created: 2016-11-11T01:23:33.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-12-26T17:52:15.000Z (about 6 years ago)
- Last Synced: 2025-04-09T09:51:48.759Z (9 months ago)
- Language: Python
- Homepage:
- Size: 189 KB
- Stars: 31
- Watchers: 6
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 
[](https://travis-ci.org/xtensor-stack/xtensor-python-cookiecutter)
[](https://ci.appveyor.com/project/xtensor-stack/xtensor-python-cookiecutter)
[](https://xtensor.readthedocs.io/en/latest/?badge=latest)
[](https://gitter.im/QuantStack/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
#### A [cookiecutter](https://github.com/audreyr/cookiecutter) template for creating a custom Python extension with xtensor
## What is xtensor-python-cookiecutter?
`xtensor-python-cookiecutter` helps extension authors create Python extension modules making use of xtensor.
It takes care of the initial work of generating a project skeleton with
- A complete `setup.py` compiling the extension module
- A few examples included in the resulting project including
- A universal function defined from C++
- A function making use of an algorithm from the STL on a numpy array
- Unit tests
- The generation of the HTML documentation with sphinx
## Usage
Install [cookiecutter](https://github.com/audreyr/cookiecutter):
$ pip install cookiecutter
After installing cookiecutter, use the xtensor-python-cookiecutter:
$ cookiecutter https://github.com/xtensor-stack/xtensor-python-cookiecutter.git
As xtensor-python-cookiecutter runs, you will be asked for basic information about
your custom extension project. You will be prompted for the following
information:
- `author_name`: your name or the name of your organization,
- `author_email`: your project's contact email,
- `github_project_name`: name of the GitHub repository for your project,
- `github_organization_name`: name of the GithHub organization for your project,
- `python_package_name`: name of the Python package created by your extension,
- `cpp_namespace`: name for the cpp namespace holding the implementation of your extension,
- `project_short_description`: a short description for your project.
This will produce a directory containing all the required content for a minimal extension
project making use of xtensor with all the required boilerplate for package management,
together with a few basic examples. The generated Python extension requires an installation
of `xtensor` `^0.18.0`, `xtensor-python` `^0.21.0`, `numpy`, and `pybind11` `^2.1.0`.
Install the module:
$ pip install ./{{ cookiecutter.github_project_name }}/
If you have [Jupyter](jupyter.org) installed, run the [Test_Run notebook](http://nbviewer.jupyter.org/github/xtensor-stack/xtensor-python-cookiecutter/blob/master/Test_Run.ipynb):
$ cd {{ cookiecutter.github_project_name }}
$ jupyter notebook
## Resources
- [Documentation of xtensor](https://xtensor.readthedocs.io/en/latest/)
- [Documentation of xtensor-python](https://xtensor-pyhton.readthedocs.io/en/latest/)
- [Documentation of xtensor-julia](https://xtensor-julia.readthedocs.io/en/latest/)