%global _empty_manifest_terminate_build 0 Name: python-pdftotext Version: 2.2.2 Release: 1 Summary: Simple PDF text extraction License: MIT URL: https://github.com/jalan/pdftotext Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e0/e3/79a2ad7ca71160fb6442772155389881672c98bd44c6022303ce242cbfb9/pdftotext-2.2.2.tar.gz BuildArch: noarch %description # pdftotext [![PyPI Status](https://img.shields.io/pypi/v/pdftotext.svg)](https://pypi.python.org/pypi/pdftotext) [![Azure Status](https://dev.azure.com/jalanpalmer/jalanpalmer/_apis/build/status/jalan.pdftotext?branchName=master)](https://dev.azure.com/jalanpalmer/jalanpalmer/_build/latest?definitionId=1&branchName=master) [![AppVeyor status](https://ci.appveyor.com/api/projects/status/uwcjxgu31kirkiuj/branch/master?svg=true)](https://ci.appveyor.com/project/jalan/pdftotext/branch/master) [![Coverage Status](https://coveralls.io/repos/github/jalan/pdftotext/badge.svg?branch=master)](https://coveralls.io/github/jalan/pdftotext?branch=master) [![Downloads](https://img.shields.io/pypi/dm/pdftotext.svg)](https://pypistats.org/packages/pdftotext) Simple PDF text extraction ```python import pdftotext # Load your PDF with open("lorem_ipsum.pdf", "rb") as f: pdf = pdftotext.PDF(f) # If it's password-protected with open("secure.pdf", "rb") as f: pdf = pdftotext.PDF(f, "secret") # How many pages? print(len(pdf)) # Iterate over all the pages for page in pdf: print(page) # Read some individual pages print(pdf[0]) print(pdf[1]) # Read all the text into one string print("\n\n".join(pdf)) ``` ## OS Dependencies These instructions assume you're using Python 3 on a recent OS. Package names may differ for Python 2 or for an older OS. ### Debian, Ubuntu, and friends ``` sudo apt install build-essential libpoppler-cpp-dev pkg-config python3-dev ``` ### Fedora, Red Hat, and friends ``` sudo yum install gcc-c++ pkgconfig poppler-cpp-devel python3-devel ``` ### macOS ``` brew install pkg-config poppler python ``` ### Windows Currently tested only when using conda: - Install the Microsoft Visual C++ Build Tools - Install poppler through conda: ``` conda install -c conda-forge poppler ``` ## Install ``` pip install pdftotext ``` %package -n python3-pdftotext Summary: Simple PDF text extraction Provides: python-pdftotext BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-pdftotext # pdftotext [![PyPI Status](https://img.shields.io/pypi/v/pdftotext.svg)](https://pypi.python.org/pypi/pdftotext) [![Azure Status](https://dev.azure.com/jalanpalmer/jalanpalmer/_apis/build/status/jalan.pdftotext?branchName=master)](https://dev.azure.com/jalanpalmer/jalanpalmer/_build/latest?definitionId=1&branchName=master) [![AppVeyor status](https://ci.appveyor.com/api/projects/status/uwcjxgu31kirkiuj/branch/master?svg=true)](https://ci.appveyor.com/project/jalan/pdftotext/branch/master) [![Coverage Status](https://coveralls.io/repos/github/jalan/pdftotext/badge.svg?branch=master)](https://coveralls.io/github/jalan/pdftotext?branch=master) [![Downloads](https://img.shields.io/pypi/dm/pdftotext.svg)](https://pypistats.org/packages/pdftotext) Simple PDF text extraction ```python import pdftotext # Load your PDF with open("lorem_ipsum.pdf", "rb") as f: pdf = pdftotext.PDF(f) # If it's password-protected with open("secure.pdf", "rb") as f: pdf = pdftotext.PDF(f, "secret") # How many pages? print(len(pdf)) # Iterate over all the pages for page in pdf: print(page) # Read some individual pages print(pdf[0]) print(pdf[1]) # Read all the text into one string print("\n\n".join(pdf)) ``` ## OS Dependencies These instructions assume you're using Python 3 on a recent OS. Package names may differ for Python 2 or for an older OS. ### Debian, Ubuntu, and friends ``` sudo apt install build-essential libpoppler-cpp-dev pkg-config python3-dev ``` ### Fedora, Red Hat, and friends ``` sudo yum install gcc-c++ pkgconfig poppler-cpp-devel python3-devel ``` ### macOS ``` brew install pkg-config poppler python ``` ### Windows Currently tested only when using conda: - Install the Microsoft Visual C++ Build Tools - Install poppler through conda: ``` conda install -c conda-forge poppler ``` ## Install ``` pip install pdftotext ``` %package help Summary: Development documents and examples for pdftotext Provides: python3-pdftotext-doc %description help # pdftotext [![PyPI Status](https://img.shields.io/pypi/v/pdftotext.svg)](https://pypi.python.org/pypi/pdftotext) [![Azure Status](https://dev.azure.com/jalanpalmer/jalanpalmer/_apis/build/status/jalan.pdftotext?branchName=master)](https://dev.azure.com/jalanpalmer/jalanpalmer/_build/latest?definitionId=1&branchName=master) [![AppVeyor status](https://ci.appveyor.com/api/projects/status/uwcjxgu31kirkiuj/branch/master?svg=true)](https://ci.appveyor.com/project/jalan/pdftotext/branch/master) [![Coverage Status](https://coveralls.io/repos/github/jalan/pdftotext/badge.svg?branch=master)](https://coveralls.io/github/jalan/pdftotext?branch=master) [![Downloads](https://img.shields.io/pypi/dm/pdftotext.svg)](https://pypistats.org/packages/pdftotext) Simple PDF text extraction ```python import pdftotext # Load your PDF with open("lorem_ipsum.pdf", "rb") as f: pdf = pdftotext.PDF(f) # If it's password-protected with open("secure.pdf", "rb") as f: pdf = pdftotext.PDF(f, "secret") # How many pages? print(len(pdf)) # Iterate over all the pages for page in pdf: print(page) # Read some individual pages print(pdf[0]) print(pdf[1]) # Read all the text into one string print("\n\n".join(pdf)) ``` ## OS Dependencies These instructions assume you're using Python 3 on a recent OS. Package names may differ for Python 2 or for an older OS. ### Debian, Ubuntu, and friends ``` sudo apt install build-essential libpoppler-cpp-dev pkg-config python3-dev ``` ### Fedora, Red Hat, and friends ``` sudo yum install gcc-c++ pkgconfig poppler-cpp-devel python3-devel ``` ### macOS ``` brew install pkg-config poppler python ``` ### Windows Currently tested only when using conda: - Install the Microsoft Visual C++ Build Tools - Install poppler through conda: ``` conda install -c conda-forge poppler ``` ## Install ``` pip install pdftotext ``` %prep %autosetup -n pdftotext-2.2.2 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-pdftotext -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Sun Apr 23 2023 Python_Bot - 2.2.2-1 - Package Spec generated