Skip to content

Getting Started⚓︎

The webqueue2api Package provides both a parser to read data from ECN's queue and allow for programatic data access as well as an WSGI application to serve the webqueue2 API.

The webqueue2api Package has the following structure:

  • webqueue2api: Contains global configuration and exports utilities/data classes.
    • parser: Contains classes for reading data from queue text files and making it available via objects.
    • api: Contains a WSGI application to host a RESTful API that relies on parser.

Basic Usage⚓︎

Load all queues.

import webqueue2api
all_queues = webqueue2api.load_queues()
for queue in all_queues:
    print(f"{queue.name} has {len(queue.items)} items."
# Expected Output
"tech has 72 items"
"ce has 38 items"
...

Load some queues.

import webqueue2api
all_queues = webqueue2api.load_queues("che", "tech", "ce")
print( len( all_queues ) )
# Expected Output
3

Load a queue and get the number of items in it.

import webqueue2api
ce_queue = webqueue2api.Queue("ce")
print( len( ce_queue.items ) )
# Expected Output
29

Load an item and get its subject.

import webqueue2api
ce_1 = webqueue2api.Item("ce", 1)
print( len( ce_1.subject ) )
# Expected Output
"Re: Battery Replacement"