pypdf-cli


Namepypdf-cli JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryA Python-based CLI that allows for comfortable every-day PDF manipulation with pypdf.
upload_time2023-09-23 02:36:12
maintainer
docs_urlNone
author
requires_python>=3.6
license
keywords pdf cli pypdf click
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pypdf-cli

------------

This command line tool is based on [click](https://github.com/pallets/click) and [pypdf](https://github.com/py-pdf/pypdf).
It allows access to most of pypdf's functionalities and adds other sensible functionalities.
The aim is to provide an OS-independent CLI that allows for comfortable every-day PDF manipulation.

## Download

Requires **python >= 3.6**

* Build locally:
  * Clone this repository
  * ``python -m pip install .``

* Install from [PyPi](https://pypi.org/project/pypdf-cli/):
  * ``python -m pip install pypdf-cli``

## Usage

``pypdf-cli [OPTIONS] COMMAND [ARGS]...``

``pypdf-cli COMMAND --help`` to learn about a command's options.

| Command | Description                                                    |
|---------|----------------------------------------------------------------|
| decrypt | Decrypt a pdf file with a password.                            |
| delete  | Delete a selection of pages from a pdf file.                   |
| encrypt | Encrypt a pdf file with a user and optional owner password.    |
| extract | Extract a selection of pages from a pdf file.                  |
| info    | Print information about a pdf file.                            |
| insert  | Insert a second pdf file into a pdf file at a specified index. |
| merge   | Merge two or more pdf files.                                   |
| remove  | Remove images, links, or text from a pdf file.                 |
| reverse | Reverse the pages of a pdf file.                               |
| rotate  | Rotate a selection of pages of a pdf file.                     |
| scale   | Scale a selection of pages of a pdf file.                      |
| split   | Split a pdf file at specified indices.            

## Commands

### decrypt
```
Usage: pypdf-cli decrypt [OPTIONS] INPUT_FILE

  Decrypt a pdf file with a password.

  INPUT_FILE is the location of the pdf file you wish to decrypt.

Options:
  -o, --output PATH  Optional location of the output pdf file. WARNING:
                     overwrites existing files.
  --password TEXT    The password to match.  [required]
  --help             Show this message and exit.

```

### delete
```
Usage: pypdf-cli delete [OPTIONS] INPUT_FILE

  Delete a selection of pages from a pdf file.

  INPUT_FILE is the location of the pdf file you wish to delete pages from.

Options:
  -p, --select-pages INT PAGES  Selection of pages. Enter list of integers and
                                ranges without spaces or wrap in quotation
                                marks. E.g. 1,3-5,7.
  -o, --output PATH             Optional location of the output pdf file.
                                WARNING: overwrites existing files.
  --help                        Show this message and exit.

```

### encrypt
```
Usage: pypdf-cli encrypt [OPTIONS] INPUT_FILE

  Encrypt a pdf file with a user and optional owner password. If no owner
  password is passed, it is the same as the user password.

  INPUT_FILE is the location of the pdf file you wish to encrypt.

Options:
  -o, --output PATH      Optional location of the output pdf file. WARNING:
                         overwrites existing files.
  --user-password TEXT   Allows for opening and reading the PDF file with the
                         restrictions provided.  [required]
  --owner-password TEXT  Allows for opening the PDF files without any
                         restrictions.                By default, the owner
                         password is the same as the user password.
  --use-40bit            Whether to use 40bit encryption. When false, 128bit
                         encryption will be used.
  --help                 Show this message and exit.

```

### extract
```
Usage: pypdf-cli extract [OPTIONS] INPUT_FILE

  Extract a selection of pages from a pdf file.

  INPUT_FILE is the location of the pdf file you wish to extract pages from.

Options:
  -p, --select-pages INT PAGES  Selection of pages. Enter list of integers and
                                ranges without spaces or wrap in quotation
                                marks. E.g. 1,3-5,7.
  -o, --output PATH             Optional location of the output pdf file.
                                WARNING: overwrites existing files.
  --help                        Show this message and exit.

```

### info
```
Usage: pypdf-cli info [OPTIONS] INPUT_FILE

  Print information about a pdf file.

  INPUT_FILE is the location of the pdf file you wish to get information of.

Options:
  --help  Show this message and exit.

```

### insert
```
Usage: pypdf-cli insert [OPTIONS] INPUT_FILES...

  Insert a second pdf file into a pdf file at a specified index. The new pdf
  file will contain the second file's pages starting at the index.

  INPUT_FILES 1. is the location of the pdf file you want to insert the second
  into. INPUT_FILES 2. is the location of the pdf file you want to insert into
  the first.

Options:
  -o, --output PATH             Optional location of the output pdf file.
                                WARNING: overwrites existing files.
  -p, --select-pages INT PAGES  Selection of page. Enter integer. E.g. 2.
                                [required]
  --help                        Show this message and exit.

```

### merge
```
Usage: pypdf-cli merge [OPTIONS] [INPUT_FILES]...

  Merge two or more pdf files. Files are appended in the order they are
  entered.

  INPUT_FILES are the locations of at least two pdf files to be merged.

Options:
  -o, --output PATH  Optional location of the output pdf file. WARNING:
                     overwrites existing files.
  --help             Show this message and exit.

```

### remove
```
Usage: pypdf-cli remove [OPTIONS] INPUT_FILE

  Remove images, links, or text from a pdf file.

  INPUT_FILE is the location of the pdf file you wish to remove images, links,
  or text from.

Options:
  -o, --output PATH  Optional location of the output pdf file. WARNING:
                     overwrites existing files.
  --images           Whether to remove images.
  --links            Whether to remove links.
  --text             Whether to remove text.
  --help             Show this message and exit.

```

### reverse
```
Usage: pypdf-cli reverse [OPTIONS] INPUT_FILE

  Reverse the pages of a pdf file.

  INPUT_FILE is the location of the pdf file you wish to reverse.

Options:
  -o, --output PATH  Optional location of the output pdf file. WARNING:
                     overwrites existing files.
  --help             Show this message and exit.

```

### rotate
```
Usage: pypdf-cli rotate [OPTIONS] INPUT_FILE

  Rotate a selection of pages of a pdf file.

  INPUT_FILE is the location of the pdf file you wish to rotate.

Options:
  -p, --select-pages INT PAGES  Selection of pages. Enter list of integers and
                                ranges without spaces or wrap in quotation
                                marks. E.g. 1,3-5,7.
  -o, --output PATH             Optional location of the output pdf file.
                                WARNING: overwrites existing files.
  -a, --all                     Select every index.
  --angle INTEGER               Angle to rotate pages clockwise. Must be
                                increment of 90.  [required]
  --help                        Show this message and exit.

```

### scale
```
Usage: pypdf-cli scale [OPTIONS] INPUT_FILE

  Scale a selection of pages of a pdf file. Uses scaleBy by default. Use
  --scale-to to scale to a flat value.

  INPUT_FILE is the location of the pdf file you wish to scale.

Options:
  -p, --select-pages INT PAGES  Selection of pages. Enter list of integers and
                                ranges without spaces or wrap in quotation
                                marks. E.g. 1,3-5,7.
  -o, --output PATH             Optional location of the output pdf file.
                                WARNING: overwrites existing files.
  -a, --all                     Select every index.
  --scale-to                    Whether to change width and height of pages to
                                a flat value.
  --horizontal FLOAT            Horizontal factor or value to scale pages by
                                or to.  [required]
  --vertical FLOAT              Vertical factor or value to scale pages by or
                                to.  [required]
  --help                        Show this message and exit.

```

### split
```
Usage: pypdf-cli split [OPTIONS] INPUT_FILE

  Split a pdf file at specified indices. The file is split AFTER a specified
  index. E.g. pages = {1, 2, 3, 4} and indices = [2, 3] results in {1, 2},
  {3}, and {4}. That means an index needs to be lower than the number of
  pages. The output files are numerated as <output>_1.pdf, <output>_2.pdf,
  etc.

  INPUT_FILE is the location of the pdf file you want to split.

Options:
  -p, --select-pages INT PAGES  Selection of pages. Enter list of integers and
                                ranges without spaces or wrap in quotation
                                marks. E.g. 1,3-5,7.
  -o, --output PATH             Optional location of the output pdf file.
                                WARNING: overwrites existing files.
  -a, --all                     Select every index.
  --help                        Show this message and exit.

```


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pypdf-cli",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "pdf,cli,pypdf,click",
    "author": "",
    "author_email": "Tobias Lass <tobi208@github.com>",
    "download_url": "https://files.pythonhosted.org/packages/fd/10/aaed6273d1f4aacaa735db8ee7fe8553a5f35c5e163176f632c7daacb931/pypdf_cli-1.0.0.tar.gz",
    "platform": null,
    "description": "# pypdf-cli\n\n------------\n\nThis command line tool is based on [click](https://github.com/pallets/click) and [pypdf](https://github.com/py-pdf/pypdf).\nIt allows access to most of pypdf's functionalities and adds other sensible functionalities.\nThe aim is to provide an OS-independent CLI that allows for comfortable every-day PDF manipulation.\n\n## Download\n\nRequires **python >= 3.6**\n\n* Build locally:\n  * Clone this repository\n  * ``python -m pip install .``\n\n* Install from [PyPi](https://pypi.org/project/pypdf-cli/):\n  * ``python -m pip install pypdf-cli``\n\n## Usage\n\n``pypdf-cli [OPTIONS] COMMAND [ARGS]...``\n\n``pypdf-cli COMMAND --help`` to learn about a command's options.\n\n| Command | Description                                                    |\n|---------|----------------------------------------------------------------|\n| decrypt | Decrypt a pdf file with a password.                            |\n| delete  | Delete a selection of pages from a pdf file.                   |\n| encrypt | Encrypt a pdf file with a user and optional owner password.    |\n| extract | Extract a selection of pages from a pdf file.                  |\n| info    | Print information about a pdf file.                            |\n| insert  | Insert a second pdf file into a pdf file at a specified index. |\n| merge   | Merge two or more pdf files.                                   |\n| remove  | Remove images, links, or text from a pdf file.                 |\n| reverse | Reverse the pages of a pdf file.                               |\n| rotate  | Rotate a selection of pages of a pdf file.                     |\n| scale   | Scale a selection of pages of a pdf file.                      |\n| split   | Split a pdf file at specified indices.            \n\n## Commands\n\n### decrypt\n```\nUsage: pypdf-cli decrypt [OPTIONS] INPUT_FILE\n\n  Decrypt a pdf file with a password.\n\n  INPUT_FILE is the location of the pdf file you wish to decrypt.\n\nOptions:\n  -o, --output PATH  Optional location of the output pdf file. WARNING:\n                     overwrites existing files.\n  --password TEXT    The password to match.  [required]\n  --help             Show this message and exit.\n\n```\n\n### delete\n```\nUsage: pypdf-cli delete [OPTIONS] INPUT_FILE\n\n  Delete a selection of pages from a pdf file.\n\n  INPUT_FILE is the location of the pdf file you wish to delete pages from.\n\nOptions:\n  -p, --select-pages INT PAGES  Selection of pages. Enter list of integers and\n                                ranges without spaces or wrap in quotation\n                                marks. E.g. 1,3-5,7.\n  -o, --output PATH             Optional location of the output pdf file.\n                                WARNING: overwrites existing files.\n  --help                        Show this message and exit.\n\n```\n\n### encrypt\n```\nUsage: pypdf-cli encrypt [OPTIONS] INPUT_FILE\n\n  Encrypt a pdf file with a user and optional owner password. If no owner\n  password is passed, it is the same as the user password.\n\n  INPUT_FILE is the location of the pdf file you wish to encrypt.\n\nOptions:\n  -o, --output PATH      Optional location of the output pdf file. WARNING:\n                         overwrites existing files.\n  --user-password TEXT   Allows for opening and reading the PDF file with the\n                         restrictions provided.  [required]\n  --owner-password TEXT  Allows for opening the PDF files without any\n                         restrictions.                By default, the owner\n                         password is the same as the user password.\n  --use-40bit            Whether to use 40bit encryption. When false, 128bit\n                         encryption will be used.\n  --help                 Show this message and exit.\n\n```\n\n### extract\n```\nUsage: pypdf-cli extract [OPTIONS] INPUT_FILE\n\n  Extract a selection of pages from a pdf file.\n\n  INPUT_FILE is the location of the pdf file you wish to extract pages from.\n\nOptions:\n  -p, --select-pages INT PAGES  Selection of pages. Enter list of integers and\n                                ranges without spaces or wrap in quotation\n                                marks. E.g. 1,3-5,7.\n  -o, --output PATH             Optional location of the output pdf file.\n                                WARNING: overwrites existing files.\n  --help                        Show this message and exit.\n\n```\n\n### info\n```\nUsage: pypdf-cli info [OPTIONS] INPUT_FILE\n\n  Print information about a pdf file.\n\n  INPUT_FILE is the location of the pdf file you wish to get information of.\n\nOptions:\n  --help  Show this message and exit.\n\n```\n\n### insert\n```\nUsage: pypdf-cli insert [OPTIONS] INPUT_FILES...\n\n  Insert a second pdf file into a pdf file at a specified index. The new pdf\n  file will contain the second file's pages starting at the index.\n\n  INPUT_FILES 1. is the location of the pdf file you want to insert the second\n  into. INPUT_FILES 2. is the location of the pdf file you want to insert into\n  the first.\n\nOptions:\n  -o, --output PATH             Optional location of the output pdf file.\n                                WARNING: overwrites existing files.\n  -p, --select-pages INT PAGES  Selection of page. Enter integer. E.g. 2.\n                                [required]\n  --help                        Show this message and exit.\n\n```\n\n### merge\n```\nUsage: pypdf-cli merge [OPTIONS] [INPUT_FILES]...\n\n  Merge two or more pdf files. Files are appended in the order they are\n  entered.\n\n  INPUT_FILES are the locations of at least two pdf files to be merged.\n\nOptions:\n  -o, --output PATH  Optional location of the output pdf file. WARNING:\n                     overwrites existing files.\n  --help             Show this message and exit.\n\n```\n\n### remove\n```\nUsage: pypdf-cli remove [OPTIONS] INPUT_FILE\n\n  Remove images, links, or text from a pdf file.\n\n  INPUT_FILE is the location of the pdf file you wish to remove images, links,\n  or text from.\n\nOptions:\n  -o, --output PATH  Optional location of the output pdf file. WARNING:\n                     overwrites existing files.\n  --images           Whether to remove images.\n  --links            Whether to remove links.\n  --text             Whether to remove text.\n  --help             Show this message and exit.\n\n```\n\n### reverse\n```\nUsage: pypdf-cli reverse [OPTIONS] INPUT_FILE\n\n  Reverse the pages of a pdf file.\n\n  INPUT_FILE is the location of the pdf file you wish to reverse.\n\nOptions:\n  -o, --output PATH  Optional location of the output pdf file. WARNING:\n                     overwrites existing files.\n  --help             Show this message and exit.\n\n```\n\n### rotate\n```\nUsage: pypdf-cli rotate [OPTIONS] INPUT_FILE\n\n  Rotate a selection of pages of a pdf file.\n\n  INPUT_FILE is the location of the pdf file you wish to rotate.\n\nOptions:\n  -p, --select-pages INT PAGES  Selection of pages. Enter list of integers and\n                                ranges without spaces or wrap in quotation\n                                marks. E.g. 1,3-5,7.\n  -o, --output PATH             Optional location of the output pdf file.\n                                WARNING: overwrites existing files.\n  -a, --all                     Select every index.\n  --angle INTEGER               Angle to rotate pages clockwise. Must be\n                                increment of 90.  [required]\n  --help                        Show this message and exit.\n\n```\n\n### scale\n```\nUsage: pypdf-cli scale [OPTIONS] INPUT_FILE\n\n  Scale a selection of pages of a pdf file. Uses scaleBy by default. Use\n  --scale-to to scale to a flat value.\n\n  INPUT_FILE is the location of the pdf file you wish to scale.\n\nOptions:\n  -p, --select-pages INT PAGES  Selection of pages. Enter list of integers and\n                                ranges without spaces or wrap in quotation\n                                marks. E.g. 1,3-5,7.\n  -o, --output PATH             Optional location of the output pdf file.\n                                WARNING: overwrites existing files.\n  -a, --all                     Select every index.\n  --scale-to                    Whether to change width and height of pages to\n                                a flat value.\n  --horizontal FLOAT            Horizontal factor or value to scale pages by\n                                or to.  [required]\n  --vertical FLOAT              Vertical factor or value to scale pages by or\n                                to.  [required]\n  --help                        Show this message and exit.\n\n```\n\n### split\n```\nUsage: pypdf-cli split [OPTIONS] INPUT_FILE\n\n  Split a pdf file at specified indices. The file is split AFTER a specified\n  index. E.g. pages = {1, 2, 3, 4} and indices = [2, 3] results in {1, 2},\n  {3}, and {4}. That means an index needs to be lower than the number of\n  pages. The output files are numerated as <output>_1.pdf, <output>_2.pdf,\n  etc.\n\n  INPUT_FILE is the location of the pdf file you want to split.\n\nOptions:\n  -p, --select-pages INT PAGES  Selection of pages. Enter list of integers and\n                                ranges without spaces or wrap in quotation\n                                marks. E.g. 1,3-5,7.\n  -o, --output PATH             Optional location of the output pdf file.\n                                WARNING: overwrites existing files.\n  -a, --all                     Select every index.\n  --help                        Show this message and exit.\n\n```\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A Python-based CLI that allows for comfortable every-day PDF manipulation with pypdf.",
    "version": "1.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/tobi208/pypdf-cli/issues",
        "Homepage": "https://github.com/tobi208/pypdf-cli"
    },
    "split_keywords": [
        "pdf",
        "cli",
        "pypdf",
        "click"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "764e4da70a4386097198fe1652f9779f0d42ce743fe15d555900ec8659ec83c9",
                "md5": "6ae36e83e0fa920eddf60d02a72c3707",
                "sha256": "bec1c4a6f62c5f01457fe9aa302b9daa9f4c0cd7dd23b8ac2afcf97d7864cd0d"
            },
            "downloads": -1,
            "filename": "pypdf_cli-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6ae36e83e0fa920eddf60d02a72c3707",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 20051,
            "upload_time": "2023-09-23T02:36:10",
            "upload_time_iso_8601": "2023-09-23T02:36:10.947304Z",
            "url": "https://files.pythonhosted.org/packages/76/4e/4da70a4386097198fe1652f9779f0d42ce743fe15d555900ec8659ec83c9/pypdf_cli-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fd10aaed6273d1f4aacaa735db8ee7fe8553a5f35c5e163176f632c7daacb931",
                "md5": "81f6ea3aa53eb9708bf8f4310caac128",
                "sha256": "a349ac39dbea7b4c033094b27346424c29ccbfec3b30bdeed8eabf285d4f6c93"
            },
            "downloads": -1,
            "filename": "pypdf_cli-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "81f6ea3aa53eb9708bf8f4310caac128",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 19855,
            "upload_time": "2023-09-23T02:36:12",
            "upload_time_iso_8601": "2023-09-23T02:36:12.600857Z",
            "url": "https://files.pythonhosted.org/packages/fd/10/aaed6273d1f4aacaa735db8ee7fe8553a5f35c5e163176f632c7daacb931/pypdf_cli-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-23 02:36:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tobi208",
    "github_project": "pypdf-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pypdf-cli"
}
        
Elapsed time: 0.12816s