Skip to main content

Build Status Latest PyPI version Supported Python Versions Development status Documentation

This small python library helps you to work with OpenMensa by:

  • support writing canteen feeds: The feed module makes it very easy to generate a valid OpenMensa Feed V2. This is in production use for the majority of canteens in OpenMensa.

  • python wrapper for OpenMensa data: Access data (canteens, meals) transparent from openmensa. (in development)

More information about OpenMensa and all possibilities for developers.

Documentation

Documentation

Documentation is hosted by ReadTheDocs: for the Full documentation about PyOpenMensa

The documentation is created with Spinx and the documentation source code can be found in the doc/ directory.

tldr: Documentation

  1. You need Python 2.6, 2.7 or >=3.2.

  2. Install pyopenmensa:

    1. via pypi

      pip install pyopenmensa
    2. via git

      git clone git://github.com/mswart/pyopenmensa``
  3. Create Feed builder:

    # 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):

    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:

    print(canteen.toXMLFeed())

    And you have a valid OpenMensa V2 Feed:

    <?xml version="1.0" encoding="UTF-8"?>
    <openmensa version="2.0" xmlns="http://openmensa.org/open-mensa-v2"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" si:schemaLocation="http://openmensa.org/open-mensa-v2 http://openmensa.org/open-mensa-v2.xsd">
      <canteen>
        <day date="2013-03-04">
          <category name="Hauptgericht">
            <meal>
              <name>Gulasch</name>
              <note>Mit Süßstoff</note>
              <note>Schwein</note>
              <price role="other">3.05</price>
              <price role="student">2.03</price>
            </meal>
          </category>
        </day>
        <day date="2013-03-05">
          <closed/>
        </day>
      </canteen>
    </openmensa>

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

  6. Enjoy a refreshing Diet Coke and wait

License

LGPL License

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

Release files for pyopenmensa 0.95.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyopenmensa 0.95.0
File Size Uploaded
pyopenmensa-0.95.0.tar.gz 13.4 kB Details

Release files / pyopenmensa-0.95.0.tar.gz

Download URL pyopenmensa-0.95.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
936100088ffc53699d2d893a1715210f4399a2881247342a6fb77947ebb0aaa0
BLAKE2b-256 checksum
How to use checksums
cf9b9e3b3aabaf75f685a6bce0580dbc7fe89ab03364311efab207f66397e591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.95.0 This release

1 release file

0.94.1

1 release file

0.94.0

1 release file

0.93.0

1 release file

0.92.1

1 release file

0.92.0

1 release file

0.91.0

1 release file

0.90.2

1 release file

0.90.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page