https://github.com/lpenz/pthugefileviewer
Huge file viewer control for prompt-toolkit
https://github.com/lpenz/pthugefileviewer
prompt-toolkit python-prompt-toolkit
Last synced: 4 days ago
JSON representation
Huge file viewer control for prompt-toolkit
- Host: GitHub
- URL: https://github.com/lpenz/pthugefileviewer
- Owner: lpenz
- License: mit
- Created: 2024-03-31T15:16:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-06T21:07:04.000Z (about 1 year ago)
- Last Synced: 2025-04-25T19:41:33.510Z (24 days ago)
- Topics: prompt-toolkit, python-prompt-toolkit
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
[](https://github.com/lpenz/pthugefileviewer/actions/workflows/ci.yml)
[](https://coveralls.io/github/lpenz/pthugefileviewer?branch=main)
[](https://pypi.org/project/pthugefileviewer/)
[](https://github.com/lpenz/pthugefileviewer/releases)# pthugefileviewer
*pthugefileviewer* is a control for [prompt-toolkit] that can display
huge files. It does so by mmap'ing the file and only reading the lines
shown in the screen. It avoids any operation that would require
reading the whole file, like counting the lines.## Installation
### Releases
pthugefileviewer can be installed via [pypi]:
```
pip install pthugefileviewer
```For [nix] users, it is also available as a [flake].
### Repository
We can also clone the github repository and install pthugefileviewer from it with:
```
pip install .
```We can also install it for the current user only by running instead:
```
pip install --user .
```## Development
pthugefileviewer uses the standard python3 infra. To develop and test the module:
- Clone the repository and go into the directory:
```
git clone [email protected]:lpenz/pthugefileviewer.git
cd pthugefileviewer
```
- Use [`venv`] to create a local virtual environment with
```
python -m venv venv
```
- Activate the environment by running the shell-specific `activate`
script in `./venv/bin/`. For [fish], for instance, run:
```
source ./venv/bin/activate.fish
```
- Install pthugefileviewer in "editable mode":
```
pip install -e '.[test]'
```
- To run the tests:
```
pytest
```
Or, to run the tests with coverage:
```
pytest --cov
```
- Finally, to exit the environment and clean it up:
```
deactivate
rm -rf venv
```[pypi]: https://pypi.org/project/pthugefileviewer/
[nix]: https://nixos.org/
[flake]: https://nixos.wiki/wiki/Flakes
[`venv`]: https://docs.python.org/3/library/venv.html
[prompt-toolkit]: https://github.com/prompt-toolkit/python-prompt-toolkit