diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-11 02:24:17 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-11 02:24:17 +0000 |
commit | 7636125d2b55ebeb8643af9af56da8e6c5ec509a (patch) | |
tree | 05ed5cd30a4a5d21d08bff777e3d45820e27fa2d | |
parent | 671ec7803a436565cd1f22c91cb071af9e5ba686 (diff) |
automatic import of python-pdftotext
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-pdftotext.spec | 306 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 308 insertions, 0 deletions
@@ -0,0 +1 @@ +/pdftotext-2.2.2.tar.gz diff --git a/python-pdftotext.spec b/python-pdftotext.spec new file mode 100644 index 0000000..c568f60 --- /dev/null +++ b/python-pdftotext.spec @@ -0,0 +1,306 @@ +%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 + +[](https://pypi.python.org/pypi/pdftotext) +[](https://dev.azure.com/jalanpalmer/jalanpalmer/_build/latest?definitionId=1&branchName=master) +[](https://ci.appveyor.com/project/jalan/pdftotext/branch/master) +[](https://coveralls.io/github/jalan/pdftotext?branch=master) +[](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 + +[](https://pypi.python.org/pypi/pdftotext) +[](https://dev.azure.com/jalanpalmer/jalanpalmer/_build/latest?definitionId=1&branchName=master) +[](https://ci.appveyor.com/project/jalan/pdftotext/branch/master) +[](https://coveralls.io/github/jalan/pdftotext?branch=master) +[](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 + +[](https://pypi.python.org/pypi/pdftotext) +[](https://dev.azure.com/jalanpalmer/jalanpalmer/_build/latest?definitionId=1&branchName=master) +[](https://ci.appveyor.com/project/jalan/pdftotext/branch/master) +[](https://coveralls.io/github/jalan/pdftotext?branch=master) +[](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 +* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 2.2.2-1 +- Package Spec generated @@ -0,0 +1 @@ +8814a3bdc5c9ad6bc6c3189914b597af pdftotext-2.2.2.tar.gz |