Skip to content

Commit

Permalink
Add webqueue2api Package Getting Started docs
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Jun 29, 2021
1 parent 57abb05 commit f9a8616
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs-src/awesome-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
nav:
- index.md
- 'Dev Environment Setup Guide.md'
- API: api
- API: api
- webqueue2api Package
4 changes: 3 additions & 1 deletion docs-src/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
See the [API Docs](api/Getting Started/).
See the [API Docs](api/Getting Started/).

See the [Python Package Docs](webqueue2api%20Package/Getting%20Started/)
63 changes: 63 additions & 0 deletions docs-src/webqueue2api Package/Getting Started.md
Original file line number Diff line number Diff line change
@@ -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"
```
4 changes: 4 additions & 0 deletions docs-src/webqueue2api Package/awesome-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# YAML Configuration for Awesome Pages mkdocs Plugin
# See: https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin
nav:
- ...

0 comments on commit f9a8616

Please sign in to comment.