content-extraction 0.2.0__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {content_extraction-0.2.0 → content_extraction-0.3.1}/PKG-INFO +3 -2
- {content_extraction-0.2.0 → content_extraction-0.3.1}/pyproject.toml +11 -3
- content_extraction-0.3.1/src/content_extraction/process_document.sh +36 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction.egg-info/PKG-INFO +3 -2
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction.egg-info/SOURCES.txt +1 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction.egg-info/requires.txt +1 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/README.md +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/setup.cfg +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/__init__.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/common_std_io.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/do_ocr.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/dspy_modules.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/extract_from_pptx.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/file_handlers.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/fix_ocr.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/logging_config.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/parse_html.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/process.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/semantic_chunk_html.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/split_and_create_digest.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction.egg-info/dependency_links.txt +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction.egg-info/top_level.txt +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/tests/test_section_parser.py +0 -0
- {content_extraction-0.2.0 → content_extraction-0.3.1}/tests/test_semantic_chunk_html.py +0 -0
@@ -1,12 +1,13 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: content_extraction
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.1
|
4
4
|
Summary: Project dedicated to content extraction from unstructured files that contain some useful information.
|
5
|
-
Requires-Python: >=3.
|
5
|
+
Requires-Python: >=3.12
|
6
6
|
Description-Content-Type: text/markdown
|
7
7
|
Requires-Dist: beautifulsoup4>=4.13.4
|
8
8
|
Requires-Dist: lxml>=6.0.0
|
9
9
|
Requires-Dist: python-pptx>=1.0.2
|
10
|
+
Requires-Dist: requests>=2.32.4
|
10
11
|
|
11
12
|
# HTML Content Extraction Tool
|
12
13
|
|
@@ -5,13 +5,21 @@ build-backend = "setuptools.build_meta"
|
|
5
5
|
[tool.setuptools.packages.find]
|
6
6
|
where = ["src"]
|
7
7
|
|
8
|
+
[tool.setuptools.package-data]
|
9
|
+
"content_extraction" = ["process_document.sh"]
|
10
|
+
|
8
11
|
[project]
|
9
12
|
name = "content_extraction"
|
10
|
-
version = "0.
|
13
|
+
version = "0.3.1"
|
11
14
|
description = "Project dedicated to content extraction from unstructured files that contain some useful information."
|
12
15
|
readme = "README.md"
|
13
|
-
requires-python = ">=3.
|
14
|
-
dependencies = [
|
16
|
+
requires-python = ">=3.12"
|
17
|
+
dependencies = [
|
18
|
+
"beautifulsoup4>=4.13.4",
|
19
|
+
"lxml>=6.0.0",
|
20
|
+
"python-pptx>=1.0.2",
|
21
|
+
"requests>=2.32.4",
|
22
|
+
]
|
15
23
|
|
16
24
|
[dependency-groups]
|
17
25
|
dev = [
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# Fail immediately if any command fails
|
4
|
+
set -e
|
5
|
+
|
6
|
+
# Check if the correct number of arguments is provided
|
7
|
+
if [ "$#" -ne 2 ]; then
|
8
|
+
echo "Usage: $0 <input_file_path> <output_directory>"
|
9
|
+
exit 1
|
10
|
+
fi
|
11
|
+
|
12
|
+
INPUT_FILE="$1"
|
13
|
+
OUTPUT_DIR="$2"
|
14
|
+
|
15
|
+
# Step 1: Perform OCR and save the result to the directory
|
16
|
+
echo "Performing OCR on $INPUT_FILE..."
|
17
|
+
python -m content_extraction.do_ocr "$INPUT_FILE" -o "$OUTPUT_DIR"
|
18
|
+
|
19
|
+
# Step 2: Combine the OCR pages into a single file
|
20
|
+
echo "Combining pages into a single Markdown file..."
|
21
|
+
cd "$OUTPUT_DIR"
|
22
|
+
ls page-*.md | sort | xargs -I{} sh -c 'cat "{}"; echo; echo' > combined.md
|
23
|
+
|
24
|
+
# Step 3: Extract headings from the combined Markdown file
|
25
|
+
echo "Extracting headings from combined.md..."
|
26
|
+
grep "^#" combined.md > headings.md
|
27
|
+
|
28
|
+
# Step 4: Fix any OCR errors using provided script
|
29
|
+
echo "Fixing OCR errors..."
|
30
|
+
fixed_text=$(python -m content_extraction.fix_ocr combined.md headings.md)
|
31
|
+
echo "$fixed_text" > fixed.md
|
32
|
+
|
33
|
+
# Step 5: Render the markdown file to HTML
|
34
|
+
pandoc fixed.md -s -f markdown -t html -o index.html
|
35
|
+
|
36
|
+
echo "All processes completed successfully. Output saved in $OUTPUT_DIR"
|
{content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction.egg-info/PKG-INFO
RENAMED
@@ -1,12 +1,13 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: content_extraction
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.1
|
4
4
|
Summary: Project dedicated to content extraction from unstructured files that contain some useful information.
|
5
|
-
Requires-Python: >=3.
|
5
|
+
Requires-Python: >=3.12
|
6
6
|
Description-Content-Type: text/markdown
|
7
7
|
Requires-Dist: beautifulsoup4>=4.13.4
|
8
8
|
Requires-Dist: lxml>=6.0.0
|
9
9
|
Requires-Dist: python-pptx>=1.0.2
|
10
|
+
Requires-Dist: requests>=2.32.4
|
10
11
|
|
11
12
|
# HTML Content Extraction Tool
|
12
13
|
|
{content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction.egg-info/SOURCES.txt
RENAMED
@@ -10,6 +10,7 @@ src/content_extraction/fix_ocr.py
|
|
10
10
|
src/content_extraction/logging_config.py
|
11
11
|
src/content_extraction/parse_html.py
|
12
12
|
src/content_extraction/process.py
|
13
|
+
src/content_extraction/process_document.sh
|
13
14
|
src/content_extraction/semantic_chunk_html.py
|
14
15
|
src/content_extraction/split_and_create_digest.py
|
15
16
|
src/content_extraction.egg-info/PKG-INFO
|
File without changes
|
File without changes
|
File without changes
|
{content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/common_std_io.py
RENAMED
File without changes
|
File without changes
|
{content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/dspy_modules.py
RENAMED
File without changes
|
{content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/extract_from_pptx.py
RENAMED
File without changes
|
{content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/file_handlers.py
RENAMED
File without changes
|
File without changes
|
{content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/logging_config.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction/semantic_chunk_html.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{content_extraction-0.2.0 → content_extraction-0.3.1}/src/content_extraction.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|