automated-document-parser 0.1.2__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.
- automated_document_parser-0.1.2/.github/workflows/ci.yml +38 -0
- automated_document_parser-0.1.2/.github/workflows/publish.yml +73 -0
- automated_document_parser-0.1.2/.gitignore +87 -0
- automated_document_parser-0.1.2/.pre-commit-config.yaml +19 -0
- automated_document_parser-0.1.2/Makefile +59 -0
- automated_document_parser-0.1.2/PKG-INFO +21 -0
- automated_document_parser-0.1.2/README.md +0 -0
- automated_document_parser-0.1.2/pyproject.toml +40 -0
- automated_document_parser-0.1.2/requirements.txt +92 -0
- automated_document_parser-0.1.2/src/automated_document_parser/__init__.py +0 -0
- automated_document_parser-0.1.2/src/automated_document_parser/main.py +6 -0
- automated_document_parser-0.1.2/test/__init__.py +1 -0
- automated_document_parser-0.1.2/test/test_main.py +33 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ master, main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Set up Python
|
|
17
|
+
uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: '3.13'
|
|
20
|
+
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v5
|
|
23
|
+
with:
|
|
24
|
+
enable-cache: true
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: uv sync
|
|
28
|
+
|
|
29
|
+
- name: Run ruff format check
|
|
30
|
+
run: uv run ruff format --check
|
|
31
|
+
|
|
32
|
+
- name: Run pytest with coverage
|
|
33
|
+
run: uv run pytest --cov --cov-branch --cov-report=xml
|
|
34
|
+
|
|
35
|
+
- name: Upload coverage reports to Codecov
|
|
36
|
+
uses: codecov/codecov-action@v5
|
|
37
|
+
with:
|
|
38
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*' # Trigger on version tags like v0.1.0, v1.2.3, etc.
|
|
7
|
+
workflow_dispatch: # Allow manual trigger
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build-and-publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
id-token: write # Required for trusted publishing
|
|
14
|
+
contents: write # Required for creating releases
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: '3.13'
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v5
|
|
26
|
+
|
|
27
|
+
- name: Get version from pyproject.toml
|
|
28
|
+
id: get_version
|
|
29
|
+
run: |
|
|
30
|
+
VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
|
|
31
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
32
|
+
echo "Package version: $VERSION"
|
|
33
|
+
|
|
34
|
+
- name: Verify tag matches version
|
|
35
|
+
run: |
|
|
36
|
+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
|
|
37
|
+
PYPROJECT_VERSION="${{ steps.get_version.outputs.version }}"
|
|
38
|
+
if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ]; then
|
|
39
|
+
echo "Error: Tag version ($TAG_VERSION) does not match pyproject.toml version ($PYPROJECT_VERSION)"
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
echo "Version check passed: $TAG_VERSION"
|
|
43
|
+
|
|
44
|
+
- name: Install build dependencies
|
|
45
|
+
run: uv pip install --system build twine
|
|
46
|
+
|
|
47
|
+
- name: Build package
|
|
48
|
+
run: python -m build
|
|
49
|
+
|
|
50
|
+
- name: Check package
|
|
51
|
+
run: twine check dist/*
|
|
52
|
+
|
|
53
|
+
- name: Create GitHub Release
|
|
54
|
+
uses: softprops/action-gh-release@v2
|
|
55
|
+
with:
|
|
56
|
+
name: Release v${{ steps.get_version.outputs.version }}
|
|
57
|
+
body: |
|
|
58
|
+
Release version ${{ steps.get_version.outputs.version }}
|
|
59
|
+
|
|
60
|
+
See [CHANGELOG](https://github.com/${{ github.repository }}/blob/master/CHANGELOG.md) for details.
|
|
61
|
+
files: |
|
|
62
|
+
dist/*.whl
|
|
63
|
+
dist/*.tar.gz
|
|
64
|
+
draft: false
|
|
65
|
+
prerelease: false
|
|
66
|
+
|
|
67
|
+
- name: Publish to PyPI
|
|
68
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
69
|
+
with:
|
|
70
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
71
|
+
# Or use trusted publishing (recommended):
|
|
72
|
+
# Remove the password line above and configure trusted publishing
|
|
73
|
+
# in your PyPI account settings
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.nox/
|
|
42
|
+
.coverage
|
|
43
|
+
.coverage.*
|
|
44
|
+
.cache
|
|
45
|
+
nosetests.xml
|
|
46
|
+
coverage.xml
|
|
47
|
+
*.cover
|
|
48
|
+
*.log
|
|
49
|
+
.pytest_cache/
|
|
50
|
+
|
|
51
|
+
# Virtual environments
|
|
52
|
+
.env
|
|
53
|
+
.venv
|
|
54
|
+
env/
|
|
55
|
+
venv/
|
|
56
|
+
ENV/
|
|
57
|
+
env.bak/
|
|
58
|
+
venv.bak/
|
|
59
|
+
|
|
60
|
+
# IDEs
|
|
61
|
+
.vscode/
|
|
62
|
+
.idea/
|
|
63
|
+
*.swp
|
|
64
|
+
*.swo
|
|
65
|
+
*~
|
|
66
|
+
.DS_Store
|
|
67
|
+
|
|
68
|
+
# Ruff
|
|
69
|
+
.ruff_cache/
|
|
70
|
+
|
|
71
|
+
# mypy
|
|
72
|
+
.mypy_cache/
|
|
73
|
+
.dmypy.json
|
|
74
|
+
dmypy.json
|
|
75
|
+
|
|
76
|
+
# Pyre type checker
|
|
77
|
+
.pyre/
|
|
78
|
+
|
|
79
|
+
# pytype static type analyzer
|
|
80
|
+
.pytype/
|
|
81
|
+
|
|
82
|
+
# uv
|
|
83
|
+
uv.lock
|
|
84
|
+
|
|
85
|
+
# Python version files
|
|
86
|
+
.python-version
|
|
87
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
rev: v0.8.4
|
|
4
|
+
hooks:
|
|
5
|
+
# Run the linter
|
|
6
|
+
- id: ruff
|
|
7
|
+
args: [--fix]
|
|
8
|
+
# Run the formatter
|
|
9
|
+
- id: ruff-format
|
|
10
|
+
|
|
11
|
+
- repo: local
|
|
12
|
+
hooks:
|
|
13
|
+
- id: pytest
|
|
14
|
+
name: pytest
|
|
15
|
+
entry: pytest
|
|
16
|
+
language: system
|
|
17
|
+
pass_filenames: false
|
|
18
|
+
always_run: true
|
|
19
|
+
args: ['-v']
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
.PHONY: lint test requirements all build publish-test publish-pypi
|
|
2
|
+
|
|
3
|
+
all: lint test
|
|
4
|
+
|
|
5
|
+
lint:
|
|
6
|
+
uv run ruff check . --exclude "*.ipynb"
|
|
7
|
+
|
|
8
|
+
test:
|
|
9
|
+
uv run pytest test/
|
|
10
|
+
|
|
11
|
+
requirements:
|
|
12
|
+
uv pip compile pyproject.toml --no-reuse-hashes --output-file=requirements.txt
|
|
13
|
+
|
|
14
|
+
format:
|
|
15
|
+
uv run ruff format .
|
|
16
|
+
|
|
17
|
+
push: format requirements
|
|
18
|
+
@bash -c '{ \
|
|
19
|
+
set -e; \
|
|
20
|
+
git add .; \
|
|
21
|
+
read -p "Enter commit message: " msg; \
|
|
22
|
+
echo "DEBUG: Entered message: [$${msg}]"; \
|
|
23
|
+
if [ -z "$$(echo $${msg} | tr -d "[:space:]")" ]; then \
|
|
24
|
+
echo "Commit message cannot be blank or whitespace."; exit 1; \
|
|
25
|
+
fi; \
|
|
26
|
+
uv run pre-commit run --all-files || { \
|
|
27
|
+
echo "Pre-commit hooks failed. Files have been fixed. Please re-run make push."; \
|
|
28
|
+
exit 1; \
|
|
29
|
+
}; \
|
|
30
|
+
git add .; \
|
|
31
|
+
git commit -m "$${msg}"; \
|
|
32
|
+
git push; \
|
|
33
|
+
}'
|
|
34
|
+
|
|
35
|
+
build: format test
|
|
36
|
+
@echo "Building package..."
|
|
37
|
+
rm -rf dist/
|
|
38
|
+
uv run python -m build
|
|
39
|
+
@echo "Checking package..."
|
|
40
|
+
uv run twine check dist/*
|
|
41
|
+
@echo "Build complete! Distribution files in dist/"
|
|
42
|
+
|
|
43
|
+
publish-test: build
|
|
44
|
+
@echo "Uploading to TestPyPI..."
|
|
45
|
+
uv run twine upload --repository testpypi dist/* --username __token__ --password "$${PYPI_API_TOKEN}"
|
|
46
|
+
@echo "Published to TestPyPI!"
|
|
47
|
+
@echo "Install with: pip install --index-url https://test.pypi.org/simple/ langchain-document-parser"
|
|
48
|
+
|
|
49
|
+
publish-pypi: build
|
|
50
|
+
@echo "WARNING: Publishing to production PyPI!"
|
|
51
|
+
@read -p "Are you sure? (yes/N): " confirm; \
|
|
52
|
+
if [ "$${confirm}" != "yes" ]; then \
|
|
53
|
+
echo "Publish cancelled."; exit 1; \
|
|
54
|
+
fi
|
|
55
|
+
@echo "Uploading to PyPI..."
|
|
56
|
+
uv run twine upload dist/* --username __token__ --password "$${PYPI_API_TOKEN}"
|
|
57
|
+
@echo "Published to PyPI!"
|
|
58
|
+
@echo "Install with: pip install langchain-document-parser"
|
|
59
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: automated-document-parser
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: A document parser built with LangChain
|
|
5
|
+
Project-URL: Homepage, https://github.com/Pulkit12dhingra/automated-document-parser
|
|
6
|
+
Project-URL: Repository, https://github.com/Pulkit12dhingra/automated-document-parser
|
|
7
|
+
Project-URL: Issues, https://github.com/Pulkit12dhingra/automated-document-parser/issues
|
|
8
|
+
Author-email: Pulkit Dhingra <your.email@example.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
Keywords: document-parser,langchain,nlp
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Python: >=3.13
|
|
17
|
+
Requires-Dist: pre-commit>=4.0.1
|
|
18
|
+
Requires-Dist: pytest-cov>=7.0.0
|
|
19
|
+
Requires-Dist: pytest>=8.3.4
|
|
20
|
+
Requires-Dist: ruff>=0.14.4
|
|
21
|
+
Requires-Dist: twine>=6.2.0
|
|
File without changes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "automated-document-parser"
|
|
7
|
+
version = "0.1.2"
|
|
8
|
+
description = "A document parser built with LangChain"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.13"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Pulkit Dhingra", email = "your.email@example.com" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["langchain", "document-parser", "nlp"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
"ruff>=0.14.4",
|
|
25
|
+
"pytest>=8.3.4",
|
|
26
|
+
"pre-commit>=4.0.1",
|
|
27
|
+
"pytest-cov>=7.0.0",
|
|
28
|
+
"twine>=6.2.0",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://github.com/Pulkit12dhingra/automated-document-parser"
|
|
33
|
+
Repository = "https://github.com/Pulkit12dhingra/automated-document-parser"
|
|
34
|
+
Issues = "https://github.com/Pulkit12dhingra/automated-document-parser/issues"
|
|
35
|
+
|
|
36
|
+
[tool.hatch.build.targets.wheel]
|
|
37
|
+
packages = ["src/automated_document_parser"]
|
|
38
|
+
|
|
39
|
+
[tool.ruff]
|
|
40
|
+
extend-exclude = ["*.ipynb"]
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# This file was autogenerated by uv via the following command:
|
|
2
|
+
# uv pip compile pyproject.toml --no-reuse-hashes --output-file=requirements.txt
|
|
3
|
+
certifi==2025.10.5
|
|
4
|
+
# via requests
|
|
5
|
+
cfgv==3.4.0
|
|
6
|
+
# via pre-commit
|
|
7
|
+
charset-normalizer==3.4.4
|
|
8
|
+
# via requests
|
|
9
|
+
coverage==7.11.1
|
|
10
|
+
# via pytest-cov
|
|
11
|
+
distlib==0.4.0
|
|
12
|
+
# via virtualenv
|
|
13
|
+
docutils==0.22.3
|
|
14
|
+
# via readme-renderer
|
|
15
|
+
filelock==3.20.0
|
|
16
|
+
# via virtualenv
|
|
17
|
+
id==1.5.0
|
|
18
|
+
# via twine
|
|
19
|
+
identify==2.6.15
|
|
20
|
+
# via pre-commit
|
|
21
|
+
idna==3.11
|
|
22
|
+
# via requests
|
|
23
|
+
iniconfig==2.3.0
|
|
24
|
+
# via pytest
|
|
25
|
+
jaraco-classes==3.4.0
|
|
26
|
+
# via keyring
|
|
27
|
+
jaraco-context==6.0.1
|
|
28
|
+
# via keyring
|
|
29
|
+
jaraco-functools==4.3.0
|
|
30
|
+
# via keyring
|
|
31
|
+
keyring==25.6.0
|
|
32
|
+
# via twine
|
|
33
|
+
markdown-it-py==4.0.0
|
|
34
|
+
# via rich
|
|
35
|
+
mdurl==0.1.2
|
|
36
|
+
# via markdown-it-py
|
|
37
|
+
more-itertools==10.8.0
|
|
38
|
+
# via
|
|
39
|
+
# jaraco-classes
|
|
40
|
+
# jaraco-functools
|
|
41
|
+
nh3==0.3.2
|
|
42
|
+
# via readme-renderer
|
|
43
|
+
nodeenv==1.9.1
|
|
44
|
+
# via pre-commit
|
|
45
|
+
packaging==25.0
|
|
46
|
+
# via
|
|
47
|
+
# pytest
|
|
48
|
+
# twine
|
|
49
|
+
platformdirs==4.5.0
|
|
50
|
+
# via virtualenv
|
|
51
|
+
pluggy==1.6.0
|
|
52
|
+
# via
|
|
53
|
+
# pytest
|
|
54
|
+
# pytest-cov
|
|
55
|
+
pre-commit==4.3.0
|
|
56
|
+
# via automated-document-parser (pyproject.toml)
|
|
57
|
+
pygments==2.19.2
|
|
58
|
+
# via
|
|
59
|
+
# pytest
|
|
60
|
+
# readme-renderer
|
|
61
|
+
# rich
|
|
62
|
+
pytest==8.4.2
|
|
63
|
+
# via
|
|
64
|
+
# automated-document-parser (pyproject.toml)
|
|
65
|
+
# pytest-cov
|
|
66
|
+
pytest-cov==7.0.0
|
|
67
|
+
# via automated-document-parser (pyproject.toml)
|
|
68
|
+
pyyaml==6.0.3
|
|
69
|
+
# via pre-commit
|
|
70
|
+
readme-renderer==44.0
|
|
71
|
+
# via twine
|
|
72
|
+
requests==2.32.5
|
|
73
|
+
# via
|
|
74
|
+
# id
|
|
75
|
+
# requests-toolbelt
|
|
76
|
+
# twine
|
|
77
|
+
requests-toolbelt==1.0.0
|
|
78
|
+
# via twine
|
|
79
|
+
rfc3986==2.0.0
|
|
80
|
+
# via twine
|
|
81
|
+
rich==14.2.0
|
|
82
|
+
# via twine
|
|
83
|
+
ruff==0.14.4
|
|
84
|
+
# via automated-document-parser (pyproject.toml)
|
|
85
|
+
twine==6.2.0
|
|
86
|
+
# via automated-document-parser (pyproject.toml)
|
|
87
|
+
urllib3==2.5.0
|
|
88
|
+
# via
|
|
89
|
+
# requests
|
|
90
|
+
# twine
|
|
91
|
+
virtualenv==20.35.4
|
|
92
|
+
# via pre-commit
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Test package
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Sample test file for main module."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from automated_document_parser.main import main
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_main_runs_successfully(capsys):
|
|
9
|
+
"""Test that main function runs without errors."""
|
|
10
|
+
main()
|
|
11
|
+
captured = capsys.readouterr()
|
|
12
|
+
assert "Hello from document-parser!" in captured.out
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def test_main_output_format(capsys):
|
|
16
|
+
"""Test that main function produces expected output format."""
|
|
17
|
+
main()
|
|
18
|
+
captured = capsys.readouterr()
|
|
19
|
+
assert captured.out.strip() == "Hello from document-parser!"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@pytest.mark.parametrize(
|
|
23
|
+
"expected_substring",
|
|
24
|
+
[
|
|
25
|
+
"Hello",
|
|
26
|
+
"document-parser",
|
|
27
|
+
],
|
|
28
|
+
)
|
|
29
|
+
def test_main_contains_keywords(capsys, expected_substring):
|
|
30
|
+
"""Test that main output contains expected keywords."""
|
|
31
|
+
main()
|
|
32
|
+
captured = capsys.readouterr()
|
|
33
|
+
assert expected_substring in captured.out
|