Skip to main content

General Viewer

Project description

# General Viewer (GViewer)

#### Simple, Light Weight, but Powerful
GViewer is a tui(Terminal UI) library that depends on [urwid](https://github.com/urwid/urwid) simplified writing a tui based reporting system.
You could just write less code, and the library could help you display the data.


## Installation
```
pip install gviewer
```


## Usage
#### Data Store
- BaseStaticDataStore
```python
data_store = BaseStaticDataStore(data)
```
- Custom Implementation
```python
class CustomDataStore(BasicDataStore):
def set_up(self):
# your implementation
```

#### Displayer
```python
class MyDisplayer(BaseDisplayer):
def to_summary(self, message):
# your implementation
# return a str or text markup
# reference: http://urwid.org/manual/displayattributes.html#text-markup

def get_detail_displayers(self):
# your implementation
# return an array of tuple that contains detail view title and a function that transform message to detail
# return [("title1", self.detail1), ("title2", self.detail2), ("title3", self.any_name_you_want)]

def detail1(self, message):
# return DetailGroup
```

#### GViewer
```python
viewer = GViewer(data_store, displayer)
viewer.start()
```

## Contribution
Please feel free to create issue or create PR


Project details


Download files

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

Source Distribution

gviewer-1.1.0.tar.gz (6.8 kB view hashes)

Uploaded Source

Built Distribution

gviewer-1.1.0-py2-none-any.whl (12.2 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page