A tool to edit the outline of a PDF file and shift page numbers to match printed ones
Project description
PDF_outline
Un semplice strumento CLI ideato per tutti quegli studenti che nel tentativo di risparmiare un po' di peso nello zaino si convertono al digitale ma "trovano" soltanto pdf senza indice e soprattutto con una numerazione sfalsata a causa di indice, prefazione e quant altro.
Installazione
uv
uv tool install PDF_tools_outline
pipx
pipx install PDF_tools_outline
Development
Cloniamo il repo e installiamo gli hooks
git clone https://github.com/aGenius05/PDF_outline.git
cp ./hooks/* .git/hooks
uv
Si consiglia di utilizzare uv in quanto rende tutto molto più semplice
uv sync
uv pip install -e .
Installazione manuale
In questo caso l'installazioen è più laboriosa, avrai bisogno di python3, la libreria pikepdf, che si consiglia di installare in un virtual environment tramite pip3 eseguendo
python3 -m venv /path/to/venv/
source /path/to/venv/bin/activate
pip3 install -r requirements.txt
pip3 install -e .
infatti il file requirements.txt contiene la versione utilizzata da me quando ho sviluppato questo script, con quella sicuramente funzionerà.
Pubblicare
Un workflow automatico analizza se ci sono dei tag sul main e, in tal caso pubblica la versione corrispondente. Notare che gli hooks sono configurati per permettere di eseguire un push con tag sul main soltanto se vengono superati tutti gli unittests.
É possibile anche pubblicare manualmente su PyPi utilizzando il comando
uv build
uv publish
oppure con pip
python3 -m build
python3 -m twine dist/*
Utilizzo
L'utilizzo è molto semplice, dopo aver attivato il venv:
PDF_outline_add [file_input.pdf] [prima_pagina] [file_indice] [file_output.pdf]
dove file_input è il pdf che si vuole lavorare, prima_pagina è il numero della prima pagina effettiva nella numerazione "sbagliata", file_indice è il file dove è scritto l'indice e file_output è il nome che si vuole dare al file finito.
Gemini Gem
Per costruire il file dell'indice risulta molto efficace creare un Agent personalizzato di Gemini(Gem). Per fare ciò fornire il prompt.
TODO
- scrivere istruzioni per installare con
pipx - esporta indice esistente
- pagine doppie con numerazione giusta
- readme in più lingue
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdf_tools_outline-1.1.2.tar.gz.
File metadata
- Download URL: pdf_tools_outline-1.1.2.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7780bdbcc9c7abca525c34ef4e28a3876261af303c93e949af572cb189fed866
|
|
| MD5 |
de7bc87b74d44c9e02f2dcfd0da48c35
|
|
| BLAKE2b-256 |
915b50131fc3c77fef1eca8fc72badbb422281ad164b7de4f8f24392e3d21ca0
|
Provenance
The following attestation bundles were made for pdf_tools_outline-1.1.2.tar.gz:
Publisher:
python-publish.yml on aGenius05/PDF_tools_outline
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pdf_tools_outline-1.1.2.tar.gz -
Subject digest:
7780bdbcc9c7abca525c34ef4e28a3876261af303c93e949af572cb189fed866 - Sigstore transparency entry: 1115061394
- Sigstore integration time:
-
Permalink:
aGenius05/PDF_tools_outline@5ebdc1b7725b22b97b2d23523767b3c19146d47c -
Branch / Tag:
refs/tags/v1.1.2 - Owner: https://github.com/aGenius05
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5ebdc1b7725b22b97b2d23523767b3c19146d47c -
Trigger Event:
push
-
Statement type:
File details
Details for the file pdf_tools_outline-1.1.2-py3-none-any.whl.
File metadata
- Download URL: pdf_tools_outline-1.1.2-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cb7b824b7d7016725ede64d29a9607de3ad2cc58b7fbed85045e12e75e11773
|
|
| MD5 |
156f2ac3d8cfdf829c9b0a851d83b998
|
|
| BLAKE2b-256 |
5816e10264641296ec50790f24725deb4fab8d7a1385e379ecc65abfa293e73f
|
Provenance
The following attestation bundles were made for pdf_tools_outline-1.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on aGenius05/PDF_tools_outline
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pdf_tools_outline-1.1.2-py3-none-any.whl -
Subject digest:
5cb7b824b7d7016725ede64d29a9607de3ad2cc58b7fbed85045e12e75e11773 - Sigstore transparency entry: 1115061411
- Sigstore integration time:
-
Permalink:
aGenius05/PDF_tools_outline@5ebdc1b7725b22b97b2d23523767b3c19146d47c -
Branch / Tag:
refs/tags/v1.1.2 - Owner: https://github.com/aGenius05
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5ebdc1b7725b22b97b2d23523767b3c19146d47c -
Trigger Event:
push
-
Statement type: