Write reST docs

This commit is contained in:
Lucidiot 2018-10-25 18:43:27 +02:00
parent 14873598c8
commit fa5c126eb3
No known key found for this signature in database
GPG Key ID: AE3F7205692FA205
4 changed files with 139 additions and 49 deletions

View File

@ -1,33 +1,6 @@
# pyurbantz
A Python package to help with an undocumented API of UrbanTZ.
The UrbanTZ company provides a delivery management platform of the same name
for other companies. To provide delivery tracking to their customers, those
companies can send links to a tracking page on UrbanTZ's website, which uses
a unique delivery ID in the URL to show tracking information.
Those tracking pages perform requests to an undocumented API endpoint with this
tracking ID. The endpoint provides much more information than what is actually
used in the pages; this package aims to provide a Python interface to help
creating better tracking interfaces.
## Requirements
This package just needs [requests](https://python-requests.org). That's it.
## Scripts
This package provides a simple tracker script, `urbantz.tracker`, that can be
invoked like this:
``` bash
python -m urbantz.tracker <ID> [-f|--frequency <seconds>]
```
The script will perform a request every 10 seconds (by default) to the
UrbanTZ API, then print the current date, time, and distance between the
delivery truck and the destination.
A Python package to help with an undocumented API of UrbanTZ. [Browse documentation](https://lucidiot.gitlab.io/pyurbantz)
## Development
@ -40,9 +13,3 @@ Sample setup using
mkvirtualenv pyurbantz -a .
pip install -e .[dev]
```
### Linting
The source code follows the PEP 8 code style and performs CI checks using the
`flake8` tool. To perform the same checks locally, run `flake8` on the root
directory of this repository.

20
docs/api.rst Normal file
View File

@ -0,0 +1,20 @@
API Reference
=============
Deliveries
----------
.. automodule:: urbantz.delivery
:members:
Exceptions
----------
.. automodule:: urbantz.exceptions
:members:
Helper classes
--------------
.. automodule:: urbantz.utils
:members:

53
docs/contributing.rst Normal file
View File

@ -0,0 +1,53 @@
Contributing
============
Contributions to the project are greatly appreciated.
Bugs and suggestions
--------------------
You may `submit an issue`_ to GitLab to warn of any bugs, ask for new features,
or ask any questions that are not answered in this documentation.
When reporting a bug, do not forget to put in your version of Python and your
version of *pyurbantz*. This will greatly help when troubleshooting, as most
errors often come from version incompatibilities.
Development
-----------
Setup
^^^^^
You will need a virtual envionment to work properly. `virtualenvwrapper`_ is
recommended::
git clone https://gitlab.com/Lucidiot/pyurbantz
cd pyurbantz
mkvirtualenv -a . pyurbantz
pip install -e .[dev]
This will clone the repository, create a virtual environment named ``pyurbantz``,
then tell pip to let the package be editable (``-e``). The ``[dev]`` suffix adds
the extra requirements useful for development.
Linting
^^^^^^^
The source code follows the PEP 8 code style and performs CI checks using the
``flake8`` tool. To perform the same checks locally, run ``flake8`` on the root
directory of this repository.
Documentation
-------------
The documentation you are reading is generated by the `Sphinx`_ tool.
The text files that hold the documentation's contents are written in
`reStructuredText`_ and are available under the ``/docs`` folder of the
`GitLab repository`_.
.. _submit an issue: https://gitlab.com/Lucidiot/pyurbantz/issues/new
.. _virtualenvwrapper: https://virtualenvwrapper.readthedocs.io
.. _GitLab repository: https://gitlab.com/Lucidiot/pyurbantz
.. _Sphinx: http://www.sphinx-doc.org/
.. _reStructuredText: http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html

View File

@ -1,20 +1,70 @@
.. pyurbantz documentation master file, created by
sphinx-quickstart on Thu Oct 25 17:43:40 2018.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Python UrbanTZ client
=====================
Welcome to pyurbantz's documentation!
=====================================
:ref:`genindex` - :ref:`modindex` - :ref:`search`
.. image:: https://img.shields.io/pypi/v/pyurbantz.svg
:target: https://pypi.org/project/pyurbantz
.. image:: https://img.shields.io/pypi/l/pyurbantz.svg
:target: https://pypi.org/project/pyurbantz
.. image:: https://img.shields.io/pypi/format/pyurbantz.svg
:target: https://pypi.org/project/pyurbantz
.. image:: https://img.shields.io/pypi/pyversions/pyurbantz.svg
:target: https://pypi.org/project/pyurbantz
.. image:: https://img.shields.io/pypi/status/pyurbantz.svg
:target: https://pypi.org/project/pyurbantz
.. image:: https://gitlab.com/Lucidiot/pyurbantz/badges/master/pipeline.svg
:target: https://gitlab.com/Lucidiot/pyurbantz/pipelines
.. image:: https://requires.io/github/Lucidiot/pyurbantz/requirements.svg?branch=master
:target: https://requires.io/github/Lucidiot/pyurbantz/requirements/?branch=master
.. image:: https://img.shields.io/github/last-commit/Lucidiot/pyurbantz.svg
:target: https://gitlab.com/Lucidiot/pyurbantz/commits
.. image:: https://img.shields.io/badge/badge%20count-9-brightgreen.svg
:target: https://gitlab.com/Lucidiot/pyurbantz
A Python package to help with an undocumented API of
`UrbanTZ <https://www.urbantz.com/>`_.
The UrbanTZ company provides a delivery management platform of the same name
for other companies. To provide delivery tracking to their customers, those
companies can send links to a tracking page on UrbanTZ's website, which uses
a unique delivery ID in the URL to show tracking information.
Those tracking pages perform requests to an undocumented API endpoint with this
tracking ID. The endpoint provides much more information than what is actually
used in the pages; this package aims to provide a Python interface to help
creating better tracking interfaces.
Requirements
------------
This package just needs `requests <https://python-requests.org>`_. That's it.
Scripts
-------
This package provides a simple tracker script, ``urbantz.tracker``, that can be
invoked like this::
python -m urbantz.tracker <ID> [-f|--frequency <seconds>]
The script will perform a request every 10 seconds (by default) to the
UrbanTZ API, then print the current date, time and distance between the
delivery truck and the destination.
Other topics
------------
.. toctree::
:maxdepth: 2
:caption: Contents:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
contributing
api