diff --git a/README.md b/README.md index f99b310..9013b58 100644 --- a/README.md +++ b/README.md @@ -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 [-f|--frequency ] -``` - -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. diff --git a/docs/api.rst b/docs/api.rst new file mode 100644 index 0000000..7a862ac --- /dev/null +++ b/docs/api.rst @@ -0,0 +1,20 @@ +API Reference +============= + +Deliveries +---------- + +.. automodule:: urbantz.delivery + :members: + +Exceptions +---------- + +.. automodule:: urbantz.exceptions + :members: + +Helper classes +-------------- + +.. automodule:: urbantz.utils + :members: diff --git a/docs/contributing.rst b/docs/contributing.rst new file mode 100644 index 0000000..6a420b1 --- /dev/null +++ b/docs/contributing.rst @@ -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 diff --git a/docs/index.rst b/docs/index.rst index ca5c09e..5dfd27d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 `_. + +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 `_. That's it. + +Scripts +------- + +This package provides a simple tracker script, ``urbantz.tracker``, that can be +invoked like this:: + + python -m urbantz.tracker [-f|--frequency ] + +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