
Writing own pywizard-books [draft]
************************************

Spell-book, or just Book, is basically python egg that follow several conventions,
that simplify sharing, discovery and generation of these Books.

As you now each egg has setup.py file. In case of pywizard-book, there are several requirements to this file:

 * Firstly, name of package should be in form pywizard-book-%book_name%

   This requirement is not so strict, but if you follow this convention, installation of your book may be really easy::

        pywizard book install


If you use same namespace for several books, then you must declare shared namespace.
First place to do so is setup.py::

    setup(

        ...

        namespace_packages=['pywizard']

        ...
    )

Another thing is to add declaration to __init__.py of your package::

    from pkg_resources import declare_namespace

    declare_namespace('pywizard')

Also you need to declare entry point in your setup.py file::

     entry_points={
        'pywizard.books': [
            'pywizard@generate = pywizard.generate.book:main',
        ],
     },


Create a new book - github example
************************************

Go t github and create a new repository with name pywizard-book-%book_name%.
Instead of %book_name% insert name of your book. Then your book will be installable as::

    pywizard book install %githubuser%@%book_name%

.. note::
    You may use another approach for naming book, but then it will be bit more typing in console to install your package.

When creating repo select to insert python .gitignore file.
Next, checkout:

    git clone your_full_repo_path.git


