# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['docx_form',
 'docx_form.constants',
 'docx_form.content_controls',
 'docx_form.enums',
 'docx_form.form_fields',
 'docx_form.globals',
 'docx_form.type_aliases']

package_data = \
{'': ['*']}

install_requires = \
['Sphinx>=5.1.1,<6.0.0', 'lxml>=4.9.1,<5.0.0', 'pytest>=7.1.2,<8.0.0']

setup_kwargs = {
    'name': 'docx-form',
    'version': '1.0.0',
    'description': 'A library that allows the editing of content control XML components in .docx files.',
    'long_description': '# docx-form\n\n![API Documentation Status](https://github.com/Southeastern-Louisiana-University/docx-form/actions/workflows/publish_api_documentation.yml/badge.svg) ![PyPi Deployment Status](https://github.com/Southeastern-Louisiana-University/docx-form/actions/workflows/deploy.yml/badge.svg) ![Unit Test Status](https://github.com/Southeastern-Louisiana-University/docx-form/actions/workflows/run_unit_tests.yml/badge.svg)\n\n### [API Documentation](https://southeastern-louisiana-university.github.io/docx-form/ \'API Documentation\') | [PyPi Page](https://pypi.org/project/docx-form/ \'PyPi Page\')\n\n### Description\n\nThis package allows you to easily modify the values of content controls & form fields in `.docx` files with Python.\n\n### Supported Content Controls\n\n- [x] Plain Text\n- [x] Rich Text\n- [x] Drop Down List\n- [x] Combo Box\n- [x] Date Picker\n- [x] Check Box\n\n### Supported Form Fields (To-Do)\n\n- [ ] Text\n- [ ] Drop Down\n- [ ] Check Box\n\n## Installation\n\n1. Install [Python](https://www.python.org/downloads/ \'Python\') (**minimum version: 3.10.6**)\n   1. **Warning: Python 3.11 breaks some dependencies as of 10/28/2022. This warning will be removed when this is no longer the case.**\n2. In a terminal, run: `pip install docx-form`\n\n## Usage\n\nThe file `./docx_form_tests/test.docx` wil be used for the following guide.\n\n1. Create a new python file `example.py`\n2. Import docx-form:\n\n```python\nfrom docx_form import DocxForm\n```\n\n3. Initialize a `DocxForm` instance:\n\n```python\n...\nfull_path = \'path/to/docx/file/test.docx\'\ndocument = DocxForm(full_path)\n```\n\n4. List the content controls:\n\n```python\n...\ndocument.list_all_content_controls_and_form_fields()\n```\n\n5. View the console output & make note of the indexes:\n\n```\n0: RichTextContentControl | id: -1012910137 | text: Rich Text Content Control\n1: RichTextContentControl | id: -1135860421 | text: Another Rich Text Content Control\n2: PlainTextContentControl | id: -132710284 | text: Plain Text Content Control\n3: PlainTextContentControl | id: 28152470 | text: Another Plain Text Content Control\n4: CheckBoxContentControl | id: -1942055255 | text: ☐\n5: CheckBoxContentControl | id: -635946620 | text: ☒\n6: ComboBoxContentControl | id: 199831773 | text: Combo t Option 1\n7: ComboBoxContentControl | id: -1984237200 | text: Choose an item.\n8: DropDownListContentControl | id: -827207619 | text: Drop-Down Content Control\n9: DropDownListContentControl | id: 2026666311 | text: Another Drop-Down Content Control\n10: DatePickerContentControl | id: 645172330 | text: 9/6/2022\n11: DatePickerContentControl | id: 539787165 | text: 9/7/2022\n```\n\n**Note: The Content Controls are listed starting from the top-left of the document going from left to right on each line of the document all the way to the bottom.**\n\n6. Edit the second Rich Text Content Control:\n\n```python\n...\n# Import type for proper intellisense in your editor/IDE\nfrom docx_form.content_controls import RichTextContentControl\n...\nrich_text_control: RichTextContentControl = document.content_control_forms_and_form_fields[1]\nrich_text_control.set_text("The example worked!")\n```\n\n7. Save the file:\n\n```python\n...\n# Note: This will overwrite the original file\ndocument.save()\n```\n\n8. If `document.list_all_content_controls_and_form_fields()` is run again:\n\n```\n...\n1: RichTextContentControl | id: -1135860421 | text: The example worked!\n...\n```\n\n9. Full File:\n\n```python\nfrom docx_form import DocxForm\nfrom docx_form.content_controls import RichTextContentControl\n\n# Create a DocxForm instance\nfull_path = "path/to/docx/file/test.docx"\ndocument = DocxForm(full_path)\n\n# Kept for reference\n# document.list_all_content_controls_and_form_fields()\n\n# Edit the second Rich Text content control\nrich_text_control: RichTextContentControl = (\n    document.content_control_forms_and_form_fields[1]\n)\nrich_text_control.set_text("The example worked!")\n\n# Note: This will overwrite the original file\ndocument.save()\n```\n\n## Examples\n\nThe file `./docx_form_tests/test.docx` wil be used for the following examples.\n\n### Plain Text\n\n```python\nfrom docx_form import DocxForm\nfrom docx_form.content_controls import PlainTextContentControl\n\n# Create a DocxForm instance\nfull_path = "path/to/docx/file/test.docx"\ndocument = DocxForm(full_path)\n\n# Kept for reference\n# document.list_all_content_controls_and_form_fields()\n\n# Edit the content control (remember the console output)\ncontent_control: PlainTextContentControl = (\n    document.content_control_forms_and_form_fields[2]\n)\ncontent_control.set_text("Plain text edit")\n\n# Note: This will overwrite the original file\ndocument.save()\n```\n\n### Check Box\n\n```python\nfrom docx_form import DocxForm\nfrom docx_form.content_controls import CheckBoxContentControl\n\n# Create a DocxForm instance\nfull_path = "path/to/docx/file/test.docx"\ndocument = DocxForm(full_path)\n\n# Kept for reference\n# document.list_all_content_controls_and_form_fields()\n\n# Edit the content control (remember the console output)\ncontent_control: CheckBoxContentControl = (\n    document.content_control_forms_and_form_fields[4]\n)\ncontent_control.set_check_box(True)\n\n# Note: This will overwrite the original file\ndocument.save()\n```\n\n### Combo Box\n\n```python\nfrom docx_form import DocxForm\nfrom docx_form.content_controls import ComboBoxContentControl\n\n# Create a DocxForm instance\nfull_path = "path/to/docx/file/test.docx"\ndocument = DocxForm(full_path)\n\n# Kept for reference\n# document.list_all_content_controls_and_form_fields()\n\n# Edit the content control (remember the console output)\ncontent_control: ComboBoxContentControl = (\n    document.content_control_forms_and_form_fields[6]\n)\ncontent_control.print_options()\n"""\nOutput:\n0: Display Value = "None" || Value = "Choose an item."\n1: Display Value = "Combo Box Option 1" || Value = "Combo Box Option 1"\n2: Display Value = "Combo Box Option 2" || Value = "Combo Box Option 2"\n"""\ncontent_control.set_text(2)\n\n# Note: This will overwrite the original file\ndocument.save()\n```\n\n### Drop Down List\n\n```python\nfrom docx_form import DocxForm\nfrom docx_form.content_controls import DropDownListContentControl\n\n# Create a DocxForm instance\nfull_path = "path/to/docx/file/test.docx"\ndocument = DocxForm(full_path)\n\n# Kept for reference\n# document.list_all_content_controls_and_form_fields()\n\n# Edit the content control (remember the console output)\ncontent_control: DropDownListContentControl = (\n    document.content_control_forms_and_form_fields[8]\n)\ncontent_control.print_options()\n"""\nOutput:\n0: Display Value = "None" || Value = "Choose an item."\n1: Display Value = "Drop-Down Content Control" || Value = "Drop-Down Content Control"\n"""\ncontent_control.set_option(0)\n\n# Note: This will overwrite the original file\ndocument.save()\n```\n\n### Date Picker\n\n```python\nfrom datetime import datetime\nfrom docx_form import DocxForm\nfrom docx_form.content_controls import DatePickerContentControl\n\n# Create a DocxForm instance\nfull_path = "path/to/docx/file/test.docx"\ndocument = DocxForm(full_path)\n\n# Kept for reference\n# document.list_all_content_controls_and_form_fields()\n\n# Edit the content control (remember the console output)\ncontent_control: DatePickerContentControl = (\n    document.content_control_forms_and_form_fields[10]\n)\nprint(content_control.date_format) # Output: "M/d/yyyy"\nnew_date = datetime(1999, 12, 31)\ncontent_control.set_date(new_date)\n\n# Note: This will overwrite the original file\ndocument.save()\n```\n\n## Setup For Contribution\n\n### Requirements:\n\n- [Python](https://www.python.org/downloads/ \'Python\') (**minimum version: 3.10.6**)\n  - **Warning: Python 3.11 breaks some dependencies as of 10/28/2022. This warning will be removed when this is no longer the case.**\n- [Poetry](https://python-poetry.org/docs/)\n  - **DO NOT** forget to add Poetry to your `PATH` (step 3)\n\n#### Environment Setup\n\nThe following will be done in Visual Studio Code on a Windows machine:\n\n1. Open a terminal in the repository\'s root\n2. Run `poetry install`\n3. Run `poetry env info`\n   1. Copy the path listed under `Virtualenv > Executable:`\n4. Change the Python interpreter to the newly created Poetry virtual environment:\n   1. `CTRL + SHIFT + P` to open the command menu\n   2. Type `interpreter` and hit `ENTER`\n   3. Select `+ Enter interpreter path...`\n   4. Paste the path to the virtual environment\n   5. Hit `ENTER`\n5. Open `./docx_form/docx_form.py` (This is the root file, so do any local testing within the `if __name__ == "__main__":` scope)\n6. Click the `Run` button in the top-right of the editor (assuming the [Python Extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) is installed)\n   1. If no errors are thrown, you are ready to execute locally and using poetry!\n7. Open a `Git Bash` terminal in the repository\'s root\n   1. Run `curl -o- https://raw.githubusercontent.com/tapsellorg/conventional-commits-git-hook/master/scripts/install.sh | sh`\n      1. Here is the repository for the git hook: [conventional-commits-git-hook](https://github.com/BrianGilbert/conventional-commits-git-hook)\n   2. Run `git init`\n   3. You now have the git hook installed to ensure proper commit messages\n      1. Follow [these guidelines](https://www.conventionalcommits.org/en/v1.0.0/) for commit messages\n\n#### Code Style Guide\n\n1. Do your best to follow [PEP8 Guidelines](https://pep8.org/ \'PEP8 Guidelines\')\n2. **ALL** code must have [Type Hints](https://peps.python.org/pep-0484/ \'Type Hints\')\n   1. If a variable, parameter, or function return has a type of `Any`, it **WILL NOT** be accepted\n',
    'author': 'Reece Bourgeois',
    'author_email': 'reecebourgeois@gmail.com',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'None',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.10,<4.0',
}


setup(**setup_kwargs)
