From 74e93050beaab365570db937e90287cbe08243dd Mon Sep 17 00:00:00 2001 From: JiJi Date: Tue, 5 May 2026 22:14:49 +0800 Subject: [PATCH] feat: update docs and python requirements --- .github/workflows/ci.yml | 5 +-- README.en.md | 70 ---------------------------------------- README.md | 38 +++++++++++----------- README_zh.md | 70 ++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 32 ++++++++++++++++++ setup.cfg | 25 -------------- setup.py | 5 --- 7 files changed, 124 insertions(+), 121 deletions(-) delete mode 100644 README.en.md create mode 100644 README_zh.md create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ab22eb..51ad1a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,13 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.10' cache: 'pip' - run: | - pip install -r requirements.txt + pip install build setuptools-scm python -m build - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: + user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 508066c..0000000 --- a/README.en.md +++ /dev/null @@ -1,70 +0,0 @@ -![](assets/logo.svg) - -[简体中文](README.md) | [**English**](README.en.md) - ---- - -## Introduction - -[PDFuck](https://github.com/mmdjiji/pdfuck) is a tool to remove PDF editing password, which is used in CLI (command line) mode. - -## Installation - -Before installing, please ensure that you have installed Python (>=3.0) and its matching version of pip, and then enter the following command at the command prompt: - -```bash -pip install pdfuck -``` - -## Usage - -### Remove PDF password - -For example, if you want to remove the password from the PDF file which is located in `example.pdf`, just enter the following command: - -```bash -pdfuck example.pdf -``` - -The default path of the output file is `example.fucked.pdf`. - -### Manually specify the output file path - -If you want to specify the path of the output file manually, you can use the `-o` parameter, for example: - -```bash -pdfuck example.pdf -o target.pdf -``` - -### PDF file requires opening password - -Use the `-p` parameter to manually specify the opening password, for example: - -```bash -pdfuck example.pdf -p password -``` - -## Credit - -Thanks for the following open source projects. The completion of this project is inseparable from the code contributed by these authors. - -* [pikepdf](https://github.com/pikepdf/pikepdf) - -## Workflow - -### Configure development environment - -```bash -pip install -r requirements.txt -``` - -### Build and test - -```bash -python -m build -pip install --editable . -``` - -## License - -[GPL-3.0](LICENSE) diff --git a/README.md b/README.md index 7c58e8d..e997508 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,70 @@ ![](assets/logo.svg) -[**简体中文**](README.md) | [English](README.en.md) +**English** | [简体中文](README_zh.md) --- -## 简介 +## Introduction -[PDFuck](https://github.com/mmdjiji/pdfuck) 是一个去除 PDF 编辑密码的工具,以命令行方式使用。 +[PDFuck](https://github.com/mmdjiji/pdfuck) is a tool to remove PDF editing password, which is used in CLI (command line) mode. -## 安装 +## Installation -在安装前,请确保你安装了 Python (>=3.0) 及与之版本相匹配的 pip,然后在命令提示符中输入下面的命令: +Before installing, please ensure that you have installed Python (>=3.0) and its matching version of pip, and then enter the following command at the command prompt: ```bash pip install pdfuck ``` -## 使用 +## Usage -### 去除 PDF 密码 +### Remove PDF password -例如,想要去除密码的 PDF 文件位于 `example.pdf`,只需输入下面的命令: +For example, if you want to remove the password from the PDF file which is located in `example.pdf`, just enter the following command: ```bash pdfuck example.pdf ``` -输出文件的默认路径为 `example.fucked.pdf`。 +The default path of the output file is `example.fucked.pdf`. -### 手动指定输出文件路径 +### Manually specify the output file path -如果想要手动指定输出文件的路径,可以使用 `-o` 参数,例如: +If you want to specify the path of the output file manually, you can use the `-o` parameter, for example: ```bash pdfuck example.pdf -o target.pdf ``` -### PDF 文件含有打开密码 +### PDF file requires opening password -使用 `-p` 参数手动指定打开密码,例如: +Use the `-p` parameter to manually specify the opening password, for example: ```bash pdfuck example.pdf -p password ``` -## 致谢 +## Credit -感谢以下开源项目,本项目的完成离不开这些作者贡献的代码。 +Thanks for the following open source projects. The completion of this project is inseparable from the code contributed by these authors. * [pikepdf](https://github.com/pikepdf/pikepdf) -## 工作流 +## Workflow -### 配置开发环境 +### Configure development environment ```bash pip install -r requirements.txt ``` -### 构建与测试 +### Build and test ```bash python -m build pip install --editable . ``` -## 开源协议 +## License [GPL-3.0](LICENSE) diff --git a/README_zh.md b/README_zh.md new file mode 100644 index 0000000..9e7f617 --- /dev/null +++ b/README_zh.md @@ -0,0 +1,70 @@ +![](assets/logo.svg) + +[English](README.md) | **简体中文** + +--- + +## 简介 + +[PDFuck](https://github.com/mmdjiji/pdfuck) 是一个去除 PDF 编辑密码的工具,以命令行方式使用。 + +## 安装 + +在安装前,请确保你安装了 Python (>=3.0) 及与之版本相匹配的 pip,然后在命令提示符中输入下面的命令: + +```bash +pip install pdfuck +``` + +## 使用 + +### 去除 PDF 密码 + +例如,想要去除密码的 PDF 文件位于 `example.pdf`,只需输入下面的命令: + +```bash +pdfuck example.pdf +``` + +输出文件的默认路径为 `example.fucked.pdf`。 + +### 手动指定输出文件路径 + +如果想要手动指定输出文件的路径,可以使用 `-o` 参数,例如: + +```bash +pdfuck example.pdf -o target.pdf +``` + +### PDF 文件含有打开密码 + +使用 `-p` 参数手动指定打开密码,例如: + +```bash +pdfuck example.pdf -p password +``` + +## 致谢 + +感谢以下开源项目,本项目的完成离不开这些作者贡献的代码。 + +* [pikepdf](https://github.com/pikepdf/pikepdf) + +## 工作流 + +### 配置开发环境 + +```bash +pip install -r requirements.txt +``` + +### 构建与测试 + +```bash +python -m build +pip install --editable . +``` + +## 开源协议 + +[GPL-3.0](LICENSE) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c50b5ee --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,32 @@ +[build-system] +requires = ["setuptools>=64", "setuptools-scm>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "pdfuck" +dynamic = ["version"] +description = "PDFuck: Remove the password of your PDF file. A tool to remove PDF editing password, which is used in CLI (command line) mode." +readme = "README.md" +license = "GPL-3.0" +authors = [ + { name = "JiJi", email = "i@mmdjiji.com" }, +] +requires-python = ">=3.8" +dependencies = [ + "pikepdf", +] +classifiers = [ + "Programming Language :: Python :: 3", +] + +[project.urls] +Homepage = "https://github.com/mmdjiji/pdfuck" + +[project.scripts] +pdfuck = "pdfuck:main" + +[tool.setuptools.packages.find] +where = ["src"] +include = ["pdfuck*"] + +[tool.setuptools_scm] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ddb69aa..0000000 --- a/setup.cfg +++ /dev/null @@ -1,25 +0,0 @@ -[metadata] -name = pdfuck -version = 1.0.2 -author = JiJi -description = PDFuck: Remove the password of your PDF file -long_description = file: README.md -long_description_content_type = text/markdown -license = GPL-3.0 -url = https://github.com/mmdjiji/pdfuck -classifiers = - Programming Language :: Python :: 3 - -[options] -packages = find: -install_requires = - pikepdf -include_package_data = True - -[options.entry_points] -console_scripts = - pdfuck = pdfuck:main - -[options.packages.find] -where=src -include=pdfuck* \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 4b2f6c4..0000000 --- a/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- - -import setuptools -setuptools.setup()