mswart / pyopenmensa

Python wrapper and helper for openmensa api and feed
http://pyom.devtation.de/
GNU Lesser General Public License v3.0
9 stars 7 forks source link

PyOpenMensa - use OpenMensa with Python

|Build Status| |Latest PyPI version| |Python versions| |Development status| |Documentation|

This small python library helps you to work with OpenMensa <http://openmensa.org/>__ by:

More information about OpenMensa and all possibilities for developers <http://doc.openmensa.org/>__.

Documentation

|Documentation|

Documentation is hosted by ReadTheDocs <https://readthedocs.org>: for the Full documentation about PyOpenMensa <https://pyopenmensa.readthedocs.org>

The documentation is created with Spinx <http://sphinx-doc.org/>__ and the documentation source code can be found in the doc/ directory.

tldr: Documentation

  1. You need Python <http://www.python.org/>__ 2.6, 2.7 or >=3.2.

  2. Install pyopenmensa:

    1. via pypi

      .. code:: bash

      pip install pyopenmensa

    2. via git

      .. code:: bash

      git clone git://github.com/mswart/pyopenmensa``

  3. Create Feed builder:

    .. code:: python

    import LazyBuilder - the container for all meals

    from pyopenmensa.feed import LazyBuilder canteen = LazyBuilder() # canteen container

  4. Add feed data (PyOpenMensa can do basic parsing and converting):

    .. code:: python

    from datetime import date canteen.addMeal(date(2013, 3, 4), 'Hauptgericht', 'Gulasch', notes=['Mit Süßstoff', 'Schwein'], prices={'student': 203, 'other': '3,05 €'} ) canteen.setDayClosed('5.3.2013')

  5. Receive XML Feed:

    .. code:: python

    print(canteen.toXMLFeed())

    And you have a valid OpenMensa V2 Feed <http://doc.openmensa.org/feed/v2/>__:

    .. code:: xml

    <?xml version="1.0" encoding="UTF-8"?>

    Gulasch Mit Süßstoff Schwein 3.05 2.03

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b my_markup)
  3. Commit your changes (git commit -am "Added Snarkdown")
  4. Push to the branch (git push origin my_markup)
  5. Open a Pull Request <https://github.com/mswart/pyopenmensa/pulls>__
  6. Enjoy a refreshing Diet Coke and wait

License

LGPL License

Copyright (c) 2012-2015 Malte Swart. LGPL license, see LICENSE for more details.

.. |Build Status| image:: https://travis-ci.org/mswart/pyopenmensa.png?branch=master :target: https://travis-ci.org/mswart/pyopenmensa :alt: Build Status

.. |Latest PyPI version| image:: https://img.shields.io/pypi/v/pyopenmensa.svg :target: https://pypi.python.org/pypi/pyopenmensa :alt: Latest PyPI version

.. |Python versions| image:: https://img.shields.io/pypi/pyversions/pyopenmensa.svg :target: https://pypi.python.org/pypi/pyopenmensa :alt: Supported Python Versions

.. |Development status| image:: https://img.shields.io/pypi/status/pyopenmensa.svg :target: https://pypi.python.org/pypi/pyopenmensa :alt: Development status

.. |Documentation| image:: https://readthedocs.org/projects/pyopenmensa/badge/?version=latest :target: https://pyopenmensa.readthedocs.org/en/latest/?badge=latest :alt: Documentation