Act as a software engineer. Only respond with code blocks. Data Extraction Epic
Story 1: Extracting Relevant Data Points
As a user, I want the Python application to extract relevant data points from certified crash reports and Plaintiff's Original Petitions, including information about the parties involved, the cause of the accident, and the extent of the damages.
Acceptance Criteria:
The Python application can successfully extract the relevant data points from the input documents.
The extracted data points are stored in a structured format, such as a CSV or JSON file.
```
import PyPDF2
import re
import csv

def extract_data_points(file_path):
    pdf_file = open(file_path, 'rb')
    read_pdf = PyPDF2.PdfFileReader(pdf_file)
    number_of_pages = read_pdf.getNumPages()
    data_points = {}

    for page_number in range(number_of_pages):
        page = read_pdf.getPage(page_number)
        page_content = page.extractText()

        # Extract parties involved
        parties_involved = re.search(r'Parties Involved:(.*)', page_content)
        if parties_involved:
            data_points['parties_involved'] = parties_involved.group(1).strip()

        # Extract cause of accident
        cause_of_accident = re.search(r'Cause of Accident:(.*)', page_content)
        if cause_of_accident:
            data_points['cause_of_accident'] = cause_of_accident.group(1).strip()

        # Extract extent of damages
        extent_of_damages = re.search(r'Extent of Damages:(.*)', page_content)
        if extent_of_damages:
            data_points['extent_of_damages'] = extent_of_damages.group(1).strip()

    return data_points

def store_data_points_in_csv(data_points, csv_file_path):
    with open(csv_file_path, 'w', newline='') as file:
        writer = csv.writer(file)
        writer.writerow(["Parties Involved", "Cause of
def extract_data(crash_report, plaintiff_petition):
    # Extract the relevant data points from the documents
    data_points = {}
    data_points['Parties'] = extract_party_data(crash_report, plaintiff_petition)
    data_points['Cause'] = extract_cause_data(crash_report, plaintiff_petition)
    data_points['Damages'] = extract_damage_data(crash_report, plaintiff_petition)
    # Store the data points in a structured format
    store_data_points(data_points)

# Function to extract the party data
def extract_party_data(crash_report, plaintiff_petition):
    party_data = {}
    party_data['Plaintiff'] = extract_plaintiff_data(plaintiff_petition)
    party_data['Defendant'] = extract_defendant_data(crash_report)
    return party_data

# Function to extract the cause data
def extract_cause_data(crash_report, plaintiff_petition):
    cause_data = {}
    cause_data['Negligence'] = extract_negligence_data(crash_report)