Skip to content

Commit 45e1fcb

Browse files
authored
MAINT: Rename cpdf to pdfly (#14)
Closes #12
1 parent 178069a commit 45e1fcb

14 files changed

+42
-42
lines changed

.github/workflows/github-ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: |
3333
pip install -r requirements/ci.txt
3434
35-
- name: Install cpdf
35+
- name: Install pdfly
3636
run: |
3737
pip install .
3838

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
2-
[![PyPI version](https://badge.fury.io/py/cpdf.svg)](https://pypi.org/project/cpdf/)
3-
[![GitHub last commit](https://img.shields.io/github/last-commit/py-pdf/cpdf)](https://github.com/py-pdf/cpdf)
4-
[![Python Support](https://img.shields.io/pypi/pyversions/cpdf.svg)](https://pypi.org/project/cpdf/)
2+
[![PyPI version](https://badge.fury.io/py/pdfly.svg)](https://pypi.org/project/pdfly/)
3+
[![GitHub last commit](https://img.shields.io/github/last-commit/py-pdf/pdfly)](https://github.com/py-pdf/pdfly)
4+
[![Python Support](https://img.shields.io/pypi/pyversions/pdfly.svg)](https://pypi.org/project/pdfly/)
55

6-
# cpdf
6+
# pdfly
77

8-
cpdf is a pure-python cli application for manipulating PDF files.
8+
pdfly (say: PDF-li) is a pure-python cli application for manipulating PDF files.
99

1010
## Installation
1111

1212
```bash
13-
pip install -U cpdf
13+
pip install -U pdfly
1414
```
1515

16-
As `cpdf` is an application, you might want to install it with [`pipx`](https://pypi.org/project/pipx/).
16+
As `pdfly` is an application, you might want to install it with [`pipx`](https://pypi.org/project/pipx/).
1717

1818
## Usage
1919

2020
```console
21-
$ cpdf --help
22-
Usage: cpdf [OPTIONS] COMMAND [ARGS]...
21+
$ pdfly --help
22+
Usage: pdfly [OPTIONS] COMMAND [ARGS]...
2323

24-
cpdf is a pure-python cli application for manipulating PDF files.
24+
pdfly is a pure-python cli application for manipulating PDF files.
2525

2626
Options:
2727
--version
@@ -40,8 +40,8 @@ Commands:
4040
You can see the help of every subcommand by typing:
4141

4242
```console
43-
$ cpdf 2-up --help
44-
Usage: cpdf 2-up [OPTIONS] PDF OUT
43+
$ pdfly 2-up --help
44+
Usage: pdfly 2-up [OPTIONS] PDF OUT
4545

4646
Create a booklet-style PDF from a single input.
4747

cpdf/__main__.py

-6
This file was deleted.

cpdf/__init__.py pdfly/__init__.py

File renamed without changes.

pdfly/__main__.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""Execute pdfly as a module."""
2+
3+
from pdfly.cli import entry_point
4+
5+
if __name__ == "__main__":
6+
entry_point()

cpdf/_version.py pdfly/_version.py

File renamed without changes.

cpdf/cat.py pdfly/cat.py

File renamed without changes.

cpdf/cli.py pdfly/cli.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33

44
import typer
55

6-
import cpdf.cat
7-
import cpdf.compress
8-
import cpdf.extract_images
9-
import cpdf.metadata
10-
import cpdf.up2
6+
import pdfly.cat
7+
import pdfly.compress
8+
import pdfly.extract_images
9+
import pdfly.metadata
10+
import pdfly.up2
1111

1212

1313
def version_callback(value: bool) -> None:
1414
if value:
15-
typer.echo(f"cpdf {cpdf.__version__}")
15+
typer.echo(f"pdfly {pdfly.__version__}")
1616
raise typer.Exit()
1717

1818

1919
entry_point = typer.Typer(
2020
add_completion=False,
21-
help=("cpdf is a pure-python cli application for manipulating PDF files."),
21+
help=("pdfly is a pure-python cli application for manipulating PDF files."),
2222
)
2323

2424

@@ -32,12 +32,12 @@ def common(
3232

3333
@entry_point.command(name="extract-images") # type: ignore[misc]
3434
def extract_images(pdf: Path) -> None:
35-
cpdf.extract_images.main(pdf)
35+
pdfly.extract_images.main(pdf)
3636

3737

3838
@entry_point.command(name="2-up") # type: ignore[misc]
3939
def up2(pdf: Path, out: Path) -> None:
40-
cpdf.up2.main(pdf, out)
40+
pdfly.up2.main(pdf, out)
4141

4242

4343
@entry_point.command(name="cat") # type: ignore[misc]
@@ -51,21 +51,21 @@ def cat(
5151
False, help="show page ranges as they are being read"
5252
),
5353
) -> None:
54-
cpdf.cat.main(filename, fn_pgrgs, output, verbose)
54+
pdfly.cat.main(filename, fn_pgrgs, output, verbose)
5555

5656

5757
@entry_point.command(name="meta") # type: ignore[misc]
5858
def metadata(
5959
pdf: Path,
60-
output: cpdf.metadata.OutputOptions = typer.Option( # noqa
61-
cpdf.metadata.OutputOptions.text.value,
60+
output: pdfly.metadata.OutputOptions = typer.Option( # noqa
61+
pdfly.metadata.OutputOptions.text.value,
6262
"--output",
6363
"-o",
6464
help="output format",
6565
show_default=True,
6666
),
6767
) -> None:
68-
cpdf.metadata.main(pdf, output)
68+
pdfly.metadata.main(pdf, output)
6969

7070

7171
@entry_point.command(name="extract-text") # type: ignore[misc]
@@ -80,11 +80,11 @@ def extract_text(pdf: Path):
8080

8181
@entry_point.command(name="compress") # type: ignore[misc]
8282
def compress(pdf: Path, output: Path):
83-
cpdf.compress.main(pdf, output)
83+
pdfly.compress.main(pdf, output)
8484

8585

86-
up2.__doc__ = cpdf.up2.__doc__
87-
extract_images.__doc__ = cpdf.extract_images.__doc__
88-
cat.__doc__ = cpdf.cat.__doc__
89-
metadata.__doc__ = cpdf.metadata.__doc__
90-
compress.__doc__ = cpdf.compress.__doc__
86+
up2.__doc__ = pdfly.up2.__doc__
87+
extract_images.__doc__ = pdfly.extract_images.__doc__
88+
cat.__doc__ = pdfly.cat.__doc__
89+
metadata.__doc__ = pdfly.metadata.__doc__
90+
compress.__doc__ = pdfly.compress.__doc__

cpdf/compress.py pdfly/compress.py

File renamed without changes.
File renamed without changes.

cpdf/metadata.py pdfly/metadata.py

File renamed without changes.

cpdf/up2.py pdfly/up2.py

File renamed without changes.

setup.cfg

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
# https://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files
3-
name = cpdf
3+
name = pdfly
44

55
author = Martin Thoma
66
author_email = [email protected]
@@ -12,7 +12,7 @@ long_description = file: README.md
1212
long_description_content_type = text/markdown
1313
keywords = pdf, pure-python
1414

15-
url = https://github.com/py-pdf/cpdf
15+
url = https://github.com/py-pdf/pdfly
1616
license = BSD-3-Clause
1717
license_file = LICENSE
1818

@@ -42,7 +42,7 @@ install_requires =
4242

4343
[options.entry_points]
4444
console_scripts =
45-
cpdf = cpdf.cli:entry_point
45+
pdfly = pdfly.cli:entry_point
4646

4747
[tool:pytest]
4848
addopts = --doctest-modules --cov=. --cov-report html:tests/reports/coverage-html --cov-report term-missing --ignore=docs/ --durations=3 --timeout=30

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from setuptools import find_packages, setup
66

7-
VERSIONFILE = "cpdf/_version.py"
7+
VERSIONFILE = "pdfly/_version.py"
88
with open(VERSIONFILE) as fp:
99
verstrline = fp.read()
1010
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"

0 commit comments

Comments
 (0)