Internals
=========

Submission
----------

Uploads work in the same fashion supported by PyPI_ and Sphinx-PyPI-upload_.
You submit documentation by performing a POST request with the mimetype
``multipart/form-data``. There are three fields: ``:action``, which has the
value ``doc_upload``; ``name``, which contains the name of the package; and
``content``, which contains a Zip file of the documentation.

Name normalisation
------------------

Names are converted to lowercase and any underscores and fullstops are
converted to hyphens. Runs of multiple hyphen are collapsed down to single
hyphens. Leading and trailing hyphens are rejected. After normalisation,
any names that are not at least two characters long and contain characters
other than alphanumerics and hyphens are rejected.

Storage
-------

Zip files are stored as is in a shallow directory hierarchy where the name of
a directory is based on the first two characters of the packages it contains.
Thus the documentation for the *dbkit* package would be stored as
``db/dbkit.zip``.

.. _PyPI: https://pypi.python.org/
.. _Sphinx-PyPI-upload: https://bitbucket.org/jezdez/sphinx-pypi-upload/
