Invoke native applications to view and render data from files.
Project description
Invoke native applications to view files
Invoke native applications to view and render data from files.
Features:
- Uses Dash to render Excel, CSV and TSV files.
- Render PDF and HTML in the default web browser.
Features on macOS:
- Default web browser used for HTML, Preview.app used for PDF files.
- Resize the window and a per display basis.
- Go to a specified page in Preview.app.
- Multiple file rendering in browser tabs.
The features on macOS are needed for other operating systems.
Installing
The easiest way to install the command line program is via the pip installer:
pip3 install zensols.rend
For macOS systems, also install AppleScript: pip install applescript.
Usage
Create a configuration file with the dimensions of each of the screens you work with and where you want Preview.app to be displayed. You can validate these configurations by having the application echo them back at you:
$ rend config
Command Line
Invoke the application to show the file and display it:
$ rend example.pdf
See the configuration file example.
From Python
The package is designed to be easy invoke from Python as well (note the parenthesis needed to make the instance):
from zensols.rend import ApplicationFactory
if (__name__ == '__main__'):
app = ApplicationFactory().get_instance()
app('test-resources/sample.pdf')
Pandas DataFrames can be rendered using the browser API (note the lack of
parenthesis as it is called as a class method):
from zensols.rend import BrowserManager, ApplicationFactory
import pandas as pd
if (__name__ == '__main__'):
mng: BrowserManager = ApplicationFactory.get_browser_manager()
url = 'https://raw.githubusercontent.com/scpike/us-state-county-zip/master/geo-data.csv'
df = pd.read_csv(url)
mng.show(df)
Documentation
See the full documentation. The API reference is also available.
Contributing
Currently the more advanced features are only available on macOS. However, the API is written to easily add other operating systems as plugins. If you would like to write one for other operating systems, please contact and/or submit a pull request.
Changelog
An extensive changelog is available here.
Community
Please star this repository and let me know how and where you use this API. Contributions as pull requests, feedback, and any input is welcome.
License
Copyright (c) 2022 - 2026 Paul Landes
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zensols_rend-1.3.1-py3-none-any.whl.
File metadata
- Download URL: zensols_rend-1.3.1-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35442516bea53e5917484ba7468105821b6c91905fd8e44fb0c19153dec28453
|
|
| MD5 |
74366d91b8088521cfadcabe252e9aaf
|
|
| BLAKE2b-256 |
887918dfbd718a966b28bed169833388d07e84825290a80fe3e26e9d2fdc8145
|