DocHubProto class for creating www.lsst.io index
Project description
# dochub-prototype
DocHub prototype - www.lsst.io.generator
## Usage
```python
#/usr/bin/env python
from dochubproto import DocHubProto
p = DocHubProto()
ul = p.render()
```
## Environment
`DocHubProto` uses the following environment variables: `KEEPER_URL`,
`LOGLEVEL`, `TEMPLATE_DIR`, `TEMPLATE_NAME`, and
`MAX_DOCUMENT_DATA_AGE`. If those are not specified, the default values
are, respectively, `https://keeper.lsst.codes`, `WARNING`, `templates`
relative to the `dochubproto` module, `doclist.jinja2`, and `3600` (age is
expressed in seconds and must be convertible to a Python float).
## Methods
* `check_state()` returns one of `STATE_EMPTY`, `STATE_READY`,
`STATE_REFRESHING`, or `STATE_STALE`, which map to the strings
`empty`, `ready`, `refreshing`, or `stale`, respectively. A stale
document is one that has not been updated in more than the maximum
document data age as specified at instance initialization (see above,
default one hour).
* `get_document_data()` and `get_fresh_document_data()` return a `dict`
whose keys are document sections (e.g. `DMTN`) and within each
section, a list ordered by document handle (e.g. `dmtn-038`).
* `render()` returns an HTML unordered list entity created from the
document data.
* `debug()`, `info()`, `warning()`, `error()`, and `critical()` each
log a message at the specified level; it uses a `structlog` logger to
log JSON output via `apikit`.
DocHub prototype - www.lsst.io.generator
## Usage
```python
#/usr/bin/env python
from dochubproto import DocHubProto
p = DocHubProto()
ul = p.render()
```
## Environment
`DocHubProto` uses the following environment variables: `KEEPER_URL`,
`LOGLEVEL`, `TEMPLATE_DIR`, `TEMPLATE_NAME`, and
`MAX_DOCUMENT_DATA_AGE`. If those are not specified, the default values
are, respectively, `https://keeper.lsst.codes`, `WARNING`, `templates`
relative to the `dochubproto` module, `doclist.jinja2`, and `3600` (age is
expressed in seconds and must be convertible to a Python float).
## Methods
* `check_state()` returns one of `STATE_EMPTY`, `STATE_READY`,
`STATE_REFRESHING`, or `STATE_STALE`, which map to the strings
`empty`, `ready`, `refreshing`, or `stale`, respectively. A stale
document is one that has not been updated in more than the maximum
document data age as specified at instance initialization (see above,
default one hour).
* `get_document_data()` and `get_fresh_document_data()` return a `dict`
whose keys are document sections (e.g. `DMTN`) and within each
section, a list ordered by document handle (e.g. `dmtn-038`).
* `render()` returns an HTML unordered list entity created from the
document data.
* `debug()`, `info()`, `warning()`, `error()`, and `critical()` each
log a message at the specified level; it uses a `structlog` logger to
log JSON output via `apikit`.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sqre-dochub-proto-0.0.1.tar.gz
.
File metadata
- Download URL: sqre-dochub-proto-0.0.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1aa28b4b8730416e587f1e8ef1b674aea262c1d2a16e730a1eb90b0e0ae17fc |
|
MD5 | d1f1c97c341da59749db2a82f2a06c02 |
|
BLAKE2b-256 | 2111b038013f940797bc8edf53519626fa4e7927abc3cc8f7d98b14c1562e0b0 |
File details
Details for the file sqre_dochub_proto-0.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: sqre_dochub_proto-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eab17e0c112d2f9adbd32b21d0f5cd82b12df6f7deba0e97e8c3716afc2bbd97 |
|
MD5 | 20af00fe3e8a9436cea562cafc486427 |
|
BLAKE2b-256 | 7f4d722a64599f001e5e9336bebac11ad8a8efabf77e710f41206ffd803721f5 |