Developer’s Guide

The developer guide is directed to fellow coders. You should read this if:

  • you want to contribute to the development of Chanjo
  • develop a Chanjo plugin that hooks into one of the entry points

Contributing

Currently the best resource on this topic is available at GitHub, in the CONTRIBUTING.md file.

Installation/dev environment

Check out the installation guide to learn how you can set up a Vagrant environment which is ready to start development in no time!

Develop a plugin

Chanjo exposes a couple of plugin interfaces using setuptools entry points.

When publishing a new Chanjo plugin you should register with the corresponding entry point in your setup.py script. It might look something like this:

setup(
  name='Chanjo-PluginName',
  ...
  entry_points={
    'chanjo.subcommands.3': [
      'plugin_name = chanjo_plugin.cli:main',
    ],
  },
  ...
)

The setup above would register a new subcommand to the command line interface as chanjo plugin.

When you write a Chanjo plugin name it something like “Chanjo-MyPlugin” to make it easy to find using pip search.

Note

It’s absolutly OK for plugins to to depend on Chanjo itself or any Chanjo dependencies.

New subcommand

Setuptools entry point: chanjo.subcommands.3

You can write a plugin that will show up as an additional subcommand when you type chanjo on the command line.

The implementation should use the Click command line framework. As long as you stick to Click, you can do pretty much whatever you want. Let’s your imagination run free! The only requirement is that it should tie into some form of Chanjo functionality like generating a report from a populated SQL database.

License

The MIT License (MIT)

Copyright (c) 2014, Robin Andeer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.