Skip to main content

pakkan-pdf

PDF 内の text や image へのアクセスをコンテキストマネージャーを使ってシンプルに行える。 pdfminer/pdfminer.six の Wrapper ライブラリです。

install

pip install pakkanpdf

使い方

  • PdfExtractor の pdf_path に pdf のパスを与え、work_dir に存在するディレクトリを指定する
    • work_dir に image を書き出すための一時ディレクトリが作成さえる
  • extractor.text を使うと、PDF の text を取得できる
  • extractor.image_file_paths を使うと、PDF の image (file path) を取得できる
from pakkanpdf import PdfExtractor

def test_sample():
    with PdfExtractor(pdf_path="data/example.pdf", work_dir="demo_work_dir") as extractor:
        assert "これはサンプルのPDFです" in extractor.text
        assert extractor.image_file_paths == ["demo_work_dir/work_images/X8.jpg"]

Metadata

Release files for pakkanpdf 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pakkanpdf 0.1.3
File Size Uploaded Provenance Actions
pakkanpdf-0.1.3.tar.gz 7.0 kB Without provenance Details for pakkanpdf-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pakkanpdf 0.1.3
File Interpreter ABI Platform Actions
pakkanpdf-0.1.3-py3-none-any.whl Python 3 none any Details for pakkanpdf-0.1.3-py3-none-any.whl

Total release size: 14.2 kB

Release files / pakkanpdf-0.1.3.tar.gz

Download URL pakkanpdf-0.1.3.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5d8a5de2f9bbce11943443c2000cb02f02e827cac46c18ee7a99badf2b7734d0
BLAKE2b-256 checksum
How to use checksums
4193aac8ad91c1e53599974db5d23f979c4dbb05490bf2dd9953861c99ef363c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.12 Darwin/20.6.0

Release files / pakkanpdf-0.1.3-py3-none-any.whl

Download URL pakkanpdf-0.1.3-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd2eb1803c7f9cbc5b46d6ccd0663727df9d43ce4f5ad0e8a4a59e1f86d2bdf9
BLAKE2b-256 checksum
How to use checksums
f086319dcbd246a4495a00e73ee3a76610ab353147dc21649a3617535c8df618
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.12 Darwin/20.6.0

Security for pakkanpdf 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page