-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
350 additions
and
799 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Development | ||
|
||
These are some development specific notes for particular releases. They are both for the developers of pdftitle or -although not intended- integrators of pdftitle as a library to other projects. | ||
|
||
## v0.14 | ||
|
||
- build system is changed from setup.py to pyproject.toml, build system is still setuptools. | ||
|
||
## v0.13 | ||
|
||
- `get_title_from_doc` method can be used with PDFDocument objects | ||
- `GetTitleParameters` class is added to not change the signature of `get_title_from_...` methods everytime a new option is added. | ||
- new use_metadata parameters are added. | ||
- `metadata.py` containing title extraction methods from the metadata is added. | ||
|
||
## v0.12 | ||
|
||
- `pdftitle.py` is moved from the root folder of the project to `pdftitle` directory | ||
- some functionality in `pdftitle.py` are moved into separate files (`device.py`, `interpreter.py`) | ||
- custom logging functionality is removed and standard logging is implemented. the logging config is initialized in `run`, thus if `get_title_from_{file,io}` is used, the logging config should be explicitly initalized beforehand. | ||
- pdftitle specific exceptions are moved and raised as PDFTitleException (it was Exception before) | ||
- global variables are removed, thus the signature of `get_title_from_file` and `get_title_from_io` functions are changed to include the parameters (fixes #33) | ||
- `get_title_from_io` method is splitted into multiple methods (one method for each algorithm etc.), but these are not supposed to be used publicly (all are `__` prefixed) | ||
- `get_title_from_io` and `get_title_from_file` are also imported in `__init__.py` | ||
- running pdftitle command only handles PDFTitleException gracefully (prints stack trace and exits with non-zero error code). it was handling Exception gracefully before. | ||
- type hints are added for public methods | ||
- most if not all string formatting is converted to f-strings | ||
- title case, ligature conversion and changing file name are not performed in `get_title_from_{file, io}` methods. `title.title()`, `pdftitle.convert_ligatures(title)` and `pdftitle.change_file_name(pdf_file, new_name)` methods should be called explicitly afterwards. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
reuse annotate --style python --merge-copyrights --license=GPL-3.0-or-later --copyright="Mete Balci" --year 2024 pdftitle/*.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# SPDX-FileCopyrightText: 2024 Mete Balci | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
"""pdftitle constants""" | ||
|
||
__version__ = "0.14" | ||
|
||
ALGO_ORIGINAL = "original" | ||
ALGO_MAX2 = "max2" | ||
ALGO_ELIOT = "eliot" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[build-system] | ||
requires = ["setuptools >= 61.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
dynamic = ["version"] | ||
name = "pdftitle" | ||
dependencies = [ | ||
"pdfminer.six>=20240706", | ||
] | ||
requires-python = ">= 3.8" | ||
authors = [ | ||
{name = "Mete Balci", email = "metebalci@gmail.com"}, | ||
] | ||
description = "pdftitle is a small utility to extract the title from a PDF file" | ||
readme = {file = "README.md", content-type = "text/markdown"} | ||
keywords = ["pdf", "title", "text", "extract"] | ||
classifiers = [ | ||
'Development Status :: 3 - Alpha', | ||
'Environment :: Console', | ||
'Intended Audience :: Science/Research', | ||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', | ||
'Topic :: Utilities', | ||
'Programming Language :: Python :: 3.8', | ||
] | ||
|
||
[project.scripts] | ||
pdftitle = "pdftitle:run" | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/metebalci/pdftitle" | ||
Documentation = "https://github.com/metebalci/pdftitle" | ||
Repository = "https://github.com/metebalci/pdftitle.git" | ||
Issues = "https://github.com/metebalci/pdftitle/issues" | ||
Changelog = "https://github.com/metebalci/pdftitle/blob/master/CHANGELOG.md" | ||
|
||
[tool.setuptools] | ||
packages = ["pdftitle"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "pdftitle.__version__"} |
This file was deleted.
Oops, something went wrong.