Metadata-Version: 2.4
Name: openresume-parser
Version: 0.1.6
Summary: Extract structured ATS-friendly JSON from resume PDF files
License-Expression: AGPL-3.0-or-later
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pypdf>=4.0
Requires-Dist: requests>=2.31
Requires-Dist: openai>=1.0
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Dynamic: license-file

# OpenResume Parser for Python

`openresume-parser` extracts structured, ATS-friendly resume data from PDF
files. Parsing runs locally by default.

## Install

Install the released package from PyPI:

```powershell
py -m pip install openresume-parser
```

## Usage

```python
from openresume import parse_resume_from_pdf

result = parse_resume_from_pdf("resume.pdf")
if result["ok"]:
    resume = result["resume"]
    print(resume["full_name"])          # "Jane Doe"
    print(resume["email"])              # "jane@example.com"
    print(resume["location"]["city"])   # "Mumbai"
    print(resume["experience"]["work_history"][0]["title"])  # "Software Engineer"
    print(resume["education"]["degree_course"])              # "B.Tech"
else:
    print(result["error"]["code"], result["error"]["message"])
```

PDF parsing uses `pypdf`. OCR.Space is opt-in and requires an API key supplied
by the application. The package includes its HTTP dependency:

```python
result = parse_resume_from_pdf(
    "scanned-resume.pdf",
    {"api_key": "your-api-key", "language": "eng"},
)
```

AI formatting is also opt-in. The manual parser runs first, then the extracted
data is sent to the configured OpenAI-compatible endpoint for JSON
normalization. Supply an API key, and optionally a custom base URL and prompt:

```python
from openresume import OpenAIOptions, parse_resume_from_pdf

result = parse_resume_from_pdf(
    "resume.pdf",
    ai=OpenAIOptions(
        api_key="your-api-key",
        base_url="https://api.openai.com/v1",
        model="gpt-4o-mini",
        prompt="Prefer the candidate's full legal name when clearly present.",
    ),
)
```

AI output is validated against the parser's resume schema. If configuration,
the request, or the response fails, the local manual result is returned and a
diagnostic warning is included. Do not commit API keys.

## Build and publish

Run these commands from this directory:

```powershell
py -m pip install --upgrade build twine
py -m build
py -m twine check dist/*
py -m twine upload dist/*
```

For a local install while developing:

```powershell
py -m pip install -e ".[test]"
py -m pytest
```

Do not commit PyPI credentials or OCR API keys. The package requires Python
3.9 or newer.
