textual-pdf


Nametextual-pdf JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryDisplay PDF files in textual widgets!
upload_time2025-08-25 06:26:38
maintainerNone
docs_urlNone
authorNSPC911
requires_python>=3.13
licenseNone
keywords pdf python textual tui
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Textual PDF

A Textual widget for viewing PDF files.

## Installation

Install the package using your package manager:

```sh
pip install textual-pdf
uv add textual-pdf
poetry add textual-pdf
```

## Usage

Here is a simple example of how to use the `PDFViewer` widget in your Textual application:

```python
from textual.app import App, ComposeResult
from textual_pdf.pdf_viewer import PDFViewer

class PDFApp(App):
    def compose(self) -> ComposeResult:
        yield PDFViewer("path/to/your/document.pdf")

app = PDFApp()
app.run()
```

The `PDFViewer` class also comes with an option to switch protocols

`PDFViewer` supports whatever image protocols `textual-image` supports, which are `TGP`, `Sixel`, and `Halfcell` and `Unicode`

`TGP` and `Sixel` are the most recommended to use as they allow the clearest image to be produced. `Halfcell` and `Unicode` are not readable at all, and simply exists for the fun of it.

```py
# use tgp
PDFViewer("path/to/your/document.pdf", protocol="TGP")
# autodetect (default)
PDFViewer("path/to/your/document.pdf", protocol="Auto")
```

## CLI

This package also provides a command-line interface to view PDF files directly from your terminal.

```sh
textual-pdf-view /path/to/your/document.pdf
```

## Key Bindings

| Key                                   | Action              |
| ------------------------------------- | ------------------- |
| `Down`, `Right`, `j`, `l`, `PageDown` | Go to next page     |
| `Up`, `Left`, `k`, `h`, `PageUp`      | Go to previous page |
| `PageDown`                            | Go to next page     |
| `PageUp`                              | Go to previous page |
| `Home`                                | Go to first page    |
| `End`                                 | Go to last page     |

## License

This project is licensed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "textual-pdf",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.13",
    "maintainer_email": null,
    "keywords": "pdf, python, textual, tui",
    "author": "NSPC911",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/f9/7e/8bcd0c4f6224a15fff444ec541ee3cf4dde46eb06cc5a3bc03c2796def2a/textual_pdf-0.1.1.tar.gz",
    "platform": null,
    "description": "# Textual PDF\n\nA Textual widget for viewing PDF files.\n\n## Installation\n\nInstall the package using your package manager:\n\n```sh\npip install textual-pdf\nuv add textual-pdf\npoetry add textual-pdf\n```\n\n## Usage\n\nHere is a simple example of how to use the `PDFViewer` widget in your Textual application:\n\n```python\nfrom textual.app import App, ComposeResult\nfrom textual_pdf.pdf_viewer import PDFViewer\n\nclass PDFApp(App):\n    def compose(self) -> ComposeResult:\n        yield PDFViewer(\"path/to/your/document.pdf\")\n\napp = PDFApp()\napp.run()\n```\n\nThe `PDFViewer` class also comes with an option to switch protocols\n\n`PDFViewer` supports whatever image protocols `textual-image` supports, which are `TGP`, `Sixel`, and `Halfcell` and `Unicode`\n\n`TGP` and `Sixel` are the most recommended to use as they allow the clearest image to be produced. `Halfcell` and `Unicode` are not readable at all, and simply exists for the fun of it.\n\n```py\n# use tgp\nPDFViewer(\"path/to/your/document.pdf\", protocol=\"TGP\")\n# autodetect (default)\nPDFViewer(\"path/to/your/document.pdf\", protocol=\"Auto\")\n```\n\n## CLI\n\nThis package also provides a command-line interface to view PDF files directly from your terminal.\n\n```sh\ntextual-pdf-view /path/to/your/document.pdf\n```\n\n## Key Bindings\n\n| Key                                   | Action              |\n| ------------------------------------- | ------------------- |\n| `Down`, `Right`, `j`, `l`, `PageDown` | Go to next page     |\n| `Up`, `Left`, `k`, `h`, `PageUp`      | Go to previous page |\n| `PageDown`                            | Go to next page     |\n| `PageUp`                              | Go to previous page |\n| `Home`                                | Go to first page    |\n| `End`                                 | Go to last page     |\n\n## License\n\nThis project is licensed under the MIT License.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Display PDF files in textual widgets!",
    "version": "0.1.1",
    "project_urls": {
        "Issues": "https://github.com/NSPC911/textual-pdf/issues",
        "Source": "https://github.com/NSPC911/textual-pdf"
    },
    "split_keywords": [
        "pdf",
        " python",
        " textual",
        " tui"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fadda8db159b48061c2a7b582d18caebe67d873e91d975d9b34def87d29565a8",
                "md5": "b1d6f5136279afdfca4dabbe6e5b357f",
                "sha256": "703a8b742634b2ff6460cfef5d7ec19d5d88cfe23ee5cd8b169854e15e796d65"
            },
            "downloads": -1,
            "filename": "textual_pdf-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b1d6f5136279afdfca4dabbe6e5b357f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.13",
            "size": 6205,
            "upload_time": "2025-08-25T06:26:31",
            "upload_time_iso_8601": "2025-08-25T06:26:31.660490Z",
            "url": "https://files.pythonhosted.org/packages/fa/dd/a8db159b48061c2a7b582d18caebe67d873e91d975d9b34def87d29565a8/textual_pdf-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f97e8bcd0c4f6224a15fff444ec541ee3cf4dde46eb06cc5a3bc03c2796def2a",
                "md5": "b0aea43fbbb6624ee76f217a30113368",
                "sha256": "c4f642eff21f8ee728294ece77d72c6e436b7ce77ecc29ad1962121a41d2a6f2"
            },
            "downloads": -1,
            "filename": "textual_pdf-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b0aea43fbbb6624ee76f217a30113368",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.13",
            "size": 2059469,
            "upload_time": "2025-08-25T06:26:38",
            "upload_time_iso_8601": "2025-08-25T06:26:38.741641Z",
            "url": "https://files.pythonhosted.org/packages/f9/7e/8bcd0c4f6224a15fff444ec541ee3cf4dde46eb06cc5a3bc03c2796def2a/textual_pdf-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-25 06:26:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NSPC911",
    "github_project": "textual-pdf",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "textual-pdf"
}
        
Elapsed time: 0.49808s