Skip to main content

DocHubProto class for creating index

Project description

# dochub-prototype
DocHub prototype -

## Usage

#/usr/bin/env python
from dochubproto import DocHubProto

p = DocHubProto()
idx = p.render_index()

## Environment

`DocHubProto` uses the following environment variables: `KEEPER_URL`,
`MAX_DOCUMENT_DATA_AGE`. If those are not specified, the default values
are, respectively, ``, `WARNING`, `templates`
relative to the `dochubproto` module, `doclist.jinja2`, `index.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, encoded as UTF-8. `render_index()` returns an HTML
document created from the document data, encoded as UTF-8.

* `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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sqre-dochub-proto, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size sqre_dochub_proto-0.0.2-py2.py3-none-any.whl (13.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size sqre-dochub-proto-0.0.2.tar.gz (11.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page