From f9a861667a7edcc8795e7d0137e6bf150d117d43 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Tue, 29 Jun 2021 16:59:59 -0400 Subject: [PATCH] Add webqueue2api Package Getting Started docs --- docs-src/awesome-pages.yaml | 3 +- docs-src/index.md | 4 +- .../webqueue2api Package/Getting Started.md | 63 +++++++++++++++++++ .../webqueue2api Package/awesome-pages.yaml | 4 ++ 4 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 docs-src/webqueue2api Package/Getting Started.md create mode 100644 docs-src/webqueue2api Package/awesome-pages.yaml diff --git a/docs-src/awesome-pages.yaml b/docs-src/awesome-pages.yaml index 5e7d488..8944e13 100644 --- a/docs-src/awesome-pages.yaml +++ b/docs-src/awesome-pages.yaml @@ -3,4 +3,5 @@ nav: - index.md - 'Dev Environment Setup Guide.md' - - API: api \ No newline at end of file + - API: api + - webqueue2api Package \ No newline at end of file diff --git a/docs-src/index.md b/docs-src/index.md index 80934d4..3064b40 100644 --- a/docs-src/index.md +++ b/docs-src/index.md @@ -1 +1,3 @@ -See the [API Docs](api/Getting Started/). \ No newline at end of file +See the [API Docs](api/Getting Started/). + +See the [Python Package Docs](webqueue2api%20Package/Getting%20Started/) \ No newline at end of file diff --git a/docs-src/webqueue2api Package/Getting Started.md b/docs-src/webqueue2api Package/Getting Started.md new file mode 100644 index 0000000..fb4143f --- /dev/null +++ b/docs-src/webqueue2api Package/Getting Started.md @@ -0,0 +1,63 @@ +# Getting Started + +The webqueue2api Package is the base of the [webqueue2 API](http://127.0.0.1:6061/ECN/webqueue2-api/api/Getting%20Started/). It consists of two primary parts: + +- **Parser**: allows for the programtic access of data from the ECN queue system. +- **API**: exposes a [WSGI](https://wsgi.readthedocs.io/en/latest/what.html) compliant RESTful API. + +## Basic Usage + +!!! example "Load a single Queue and show its Items." + ```python + import webqueue2api + + bidc_queue = webqueue2api.Queue("bidc") + print(bidc_queue.items) + ``` + ```python + # Expected Output + [ + "[bidc2] (nvatkar) Re: Un-Domain PC setup," + "[bidc4] (maswabey) Question re. Autodesk Fusion 360 upda...," + "[bidc3] (dgmc) Move a managed PC onto self managed," + "[bidc1] (nvatkar) BIDC iPad purchase and PAL access - m..." + ] + ``` + +!!! example "Load a single Item and see when it was last updated." + ```python + import webqueue2api + + ce_1 = webqueue2api.Item("ce", 1) + print(ce_1.last_modified) + ``` + ```python + # Expected Output + "2021-06-04T11:01:00-0400" + ``` + +!!! example "Load all queues." + ```python + import webqueue2api + + all_queues = webqueue2api.load_queues() + + # Print random Queue name + print(all_queues[2].name) + ``` + ```python + # Expected Output + "che" + ``` + +!!! example "See configuration settings." + ```python + import webqueue2api + + # All configuration settings. + print(webqueue2api.config.parser.queue_directory) + ``` + ```python + # Expected Output: + "/home/pier/e/queue/Mail" + ``` \ No newline at end of file diff --git a/docs-src/webqueue2api Package/awesome-pages.yaml b/docs-src/webqueue2api Package/awesome-pages.yaml new file mode 100644 index 0000000..e502d65 --- /dev/null +++ b/docs-src/webqueue2api Package/awesome-pages.yaml @@ -0,0 +1,4 @@ +# YAML Configuration for Awesome Pages mkdocs Plugin +# See: https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin +nav: + - ... \ No newline at end of file