<commit_before># pdftotext

[![PyPI](https://img.shields.io/pypi/v/pdftotext.svg)](https://pypi.python.org/pypi/pdftotext)
[![Tests](https://github.com/jalan/pdftotext/actions/workflows/tests.yml/badge.svg)](https://github.com/jalan/pdftotext/actions)
[![Downloads](https://pepy.tech/badge/pdftotext)](https://pepy.tech/project/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:<commit_msg>Fix tests status badge<commit_after># pdftotext

[![PyPI](https://img.shields.io/pypi/v/pdftotext.svg)](https://pypi.python.org/pypi/pdftotext)
[![Tests](https://github.com/jalan/pdftotext/workflows/tests/badge.svg)](https://github.com/jalan/pdftotext/actions)
[![Downloads](https://pepy.tech/badge/pdftotext)](https://pepy.tech/project/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:
{'fraction_non_alphanumeric': 0.1793921423276501, 'fraction_numerical': 0.0, 'mean_word_length': 4.9734513274336285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3967735', 'n_tokens_mistral': 550, 'n_tokens_neox': 527, 'n_words': 94}