Skip to content

qiita-spots/qtp-template-cookiecutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cookiecutter Qiita Type Plugin Template

Cookiecutter template for a Qiita Type plugin.

This template sets up the skeleton code to create a Qiita type plugin.

Getting Started

To create your own Qiita Type plugin, first install Cookiecutter:

$ pip install -U cookiecutter

Then, generate the skeleton of the plugin by running cookiecutter (it will create the skeleton in the current directory):

$ cookiecutter https://github.com/qiita-spots/qtp-template-cookiecutter

You'll be prompted to introduce values so cookiecutter can set up the skeleton correctly. You can introduce new values or just hit enter to use the default values. Any of these values can be manually changed through the code:

  • project_name: This is the name of your project. It will be added on the project README.rst file and the setup.py file. Qiita Type Plugin is appended to the project name. We highly recommend to not use the default value.
  • repo_name: The github repository name. The default value is generated by lowercasing the project_name value and changing spaces by -.
  • organization_name: The github organization name in which the repository will live.
  • module_name: The name of the module. The default value is generated by replacing the - characters in the repo_name value by _.
  • author: The name of the plugin author
  • email: The email to contact the plugin author
  • URL: The URL of the project. The default value is generated using the organization_name and repo_name values.
  • license: The license of the project. Choose between BSD 3-clause, MIT or Apache. Default is BSD 3-clause.

Example:

$ cookiecutter /Users/jose/qiime_software/qtp-template-cookiecutter/
project_name [New Types]: biom
repo_name [qtp-biom]:
organization_name [qiita-spots]:
module_name [qtp_biom]:
author [Qiita development team]:
email [[email protected]]:
url [https://github.com/qiita-spots/qtp-biom]:
Select license:
1 - BSD 3-clause License
2 - MIT License
3 - Apache Software License 2.0
Choose from 1, 2, 3 [1]:

Cookiecutter will create a directory using the repo_name value in the current directory. The generated skeleton takes care of most of the initial plugin setup and Qiita communication, as well as common repository set up, including travis and coverages. As a plugin developer, you need to enable travis and coverage to be correctly reported. Additionally, you will need to complete the TODO marked sections in the code. Follow the instructions within the comments. The following list contains a general overview of what's required in those TODO sections:

  • File README.rst: Add a description of the artifact types added by the type plugin
  • File module_name/__init__.py: Create a list of QiitaArtifactType elements to register the types into Qiita
  • File module_name/validate.py: Code to validate and fix the files of a new artifact
  • File module_name/summary.py: Code to generate an HTML summary of an artifact
  • File module_name/tests/test_validate.py: Code to properly test the validation of the artifact you are adding
  • File module_name/tests/test_summary.py: Code to properly test the HTML generation of an the new artifact summary

Once all the TODO's are completed, your can upload your code to github and see the tests run (if travis and coveralls are enabled).

About

Cookiecutter template for Qiita Type plugins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages