Skip to main content

Huge file viewer control for prompt-toolkit

Project description

CI coveralls PyPI github

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 git@github.com: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
    

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

pthugefileviewer-0.5.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

pthugefileviewer-0.5.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file pthugefileviewer-0.5.0.tar.gz.

File metadata

  • Download URL: pthugefileviewer-0.5.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pthugefileviewer-0.5.0.tar.gz
Algorithm Hash digest
SHA256 66556cd6796ad07d7c43967c695358b3e817ba3ba0a754c4af292807af5c3b8e
MD5 88b5684d5c23431c6374eabb4ada0f77
BLAKE2b-256 b8551cdf1f1f794bdfac586889a78dc595d1712d5cb87bbecf2bd873d4d74aa5

See more details on using hashes here.

File details

Details for the file pthugefileviewer-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pthugefileviewer-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6293327d90009735cdb4a728123f3a8008c5ff3aa06ee7abd5b4c30018f8da99
MD5 e2aa52ffebf5081e632da0cc71c3d6fa
BLAKE2b-256 8bc06dcc20c3fa0e77cd19d1142882af82bb84bfed388b10a8009762f2a3ec0e

See more details on using hashes here.

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