Skip to main content

Overview

Clearedge is a Python package designed to simplify the process of extracting raw text and metadata from documents. You can use it to retrieve not only the text but also valuable metadata including titles, subheadings, page numbers, file names, bounding box (bbox) coordinates, and chunk types. Whether you're working on document analysis, data extraction projects, or building a RAG app with LLM, Clearedge provides a straightforward and efficient solution.

Features

  • Text Extraction: Extract raw text from documents (currently supports pdf only. other file types coming soon).
  • Metadata Retrieval: Obtain metadata such as subheadings, page numbers, file names, bounding boxes and more.
  • Bounding Box Coordinates: Access bbox coordinates for text chunks, enabling spatial analysis of text placement within documents.
  • Chunk Type Identification: Identify types of text chunks (e.g., table, text and more) for advanced content analysis.
  • Support for Multiple Formats (coming soon): Compatible with popular document formats, ensuring broad usability.

Installation

Prerequisites

To install clearedge, you will need Python 3.8 or later.

Since we use Tesseract, you will need extra dependencies.

For MacOS users, you need to run:

brew install tesseract

For ubuntu users, you need to run:

sudo apt install tesseract-ocr

Latest release

You can then install the latest release of the package using pypi as follows:

pip install clearedge

Quick Start

Here's a simple example to get you started with clearedge:

from clearedge.reader.pdf import process_pdf

# Call the extractor with the path to your document
chunks = process_pdf('/path/to/your/document.pdf', use_ocr=True) # do not add use_ocr for faster processing. output is less accurate without ocr.

# Extract text and metadata
for chunk in chunks:
    text, metadata = chunk.text, chunk.metadata
    print(text) # Accessing extracted text
    print(metadata.to_dict()) # Accessing metadata

Documentation

For more detailed information on all the features and functionalities of Clearedge, please refer to the official documentation (coming soon).

Contributing

Contributions to Clearedge are welcome! If you have suggestions for improvements or bug fixes, please feel free to: Open an issue to discuss what you would like to change. Submit pull requests for us to review.

Citation

If you wish to cite this project, feel free to use this BibTeX reference:

@misc{clearedge2024,
    title={clearedge: RAG preprocessor},
    author={Clearedge AI},
    year={2024},
    publisher = {GitHub},
    howpublished = {\url{https://github.com/Clearedge-AI/clearedge}}
}

License

Clearedge is released under the Apache 2.0 License. See the LICENSE file for more details.

Acknowledgments

This project was inspired by the need for a simple, yet comprehensive tool for document analysis and metadata extraction. We thank all contributors and users for their support and feedback. Clearedge aims to be a valuable tool for developers, researchers, and anyone involved in processing and analyzing document content. We hope it simplifies your projects and helps you achieve your goals more efficiently.

Metadata

Release files for clearedge 0.1.17

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

Source distribution (sdist)

Source distribution for clearedge 0.1.17
File Size Uploaded
clearedge-0.1.17.tar.gz 7.1 MB Details

Built distribution (wheel)

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

Total release size: 14.2 MB

Release files / clearedge-0.1.17.tar.gz

Download URL clearedge-0.1.17.tar.gz
Size 7.1 MB
Tags Source
SHA-256 checksum
How to use checksums
b38574a9c70a2d9b637c8a3339af0b5208b9ab80a14e426c69dd865ebd8c9f0d
BLAKE2b-256 checksum
How to use checksums
8e3f4a600b86bab71521cdf2992bf45febc2cbdea964069dc49b526626d993b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.2 Darwin/22.2.0

Release files / clearedge-0.1.17-py3-none-any.whl

Download URL clearedge-0.1.17-py3-none-any.whl
Size 7.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e63d0003fb47184c80adc71e28c1ef5d4eb74e3b9b3cd2871f20c6a8198bfe5a
BLAKE2b-256 checksum
How to use checksums
a08c6782242407af69c65040197c9d15fb02c5b3297fcf38dfa091707d460df4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.2 Darwin/22.2.0

Release history Release notifications | RSS feed

This release

0.1.17 This release

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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