AcodisApiHandler


NameAcodisApiHandler JSON
Version 0.3.7 PyPI version JSON
download
home_page
SummaryA simple API handler for Python
upload_time2024-01-18 16:49:49
maintainer
docs_urlNone
author
requires_python>=3.8.12
licenseMIT License
keywords api handler python acodis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Acodis API Handler
This package provides easy to use python classes and functions to communicate with Acodis API (https://acodis.io).
Acodis is an IDP solution that focuses on extracting and structuring complex documents (PDFs, Images)

## Installation
```bash
pip install AcodisApiHandler
```

## Usage
This package is particularly useful for programmatic access, since ACODIS' API structure requires a different 
**user** and **password** for every export step. Hence, if you have to manage multiple exports 
(e.g. multiple workflows), you just need to update the main class `user` and `password` attribute,
and call the `authenticate()` method.
```python
from AcodisApiHandler import AcodisApiHandler

# Set up your credentials
ACODIS_BASE_URL = "https://<YOUR-ACOIDS-INSTANCE-URL>/workbench/api/transaction"
ACODIS_USER = "<YOUR-EXPORT-USERNAME>"
ACODIS_PASSWORD = "<YOUR-EXPORT-PASSWORD>"

# Create an instance of the AcodisApiHandler class
handler = AcodisApiHandler(ACODIS_BASE_URL)

# Set the credentials
handler.user = ACODIS_USER
handler.password = ACODIS_PASSWORD

# Authenticate with the API
handler.authenticate()

handler.workflow(pdf_path="<PATH-TO-PDF-FILE>")

# The extraction result is an ElementTree XML object stored in the handler.result variable
# You can check it by:
print(handler.result)
```

## Utils
This package also provides some utils to help you with the extraction process.

### Extracting tagged data points
Tags are used to identify the data points that you want to extract from the document.
This function will create a dictionary with the tags as keys and the extracted data as values.
```python
from AcodisApiHandler import extract_tags

tags_list = ["example_tag_1", "example_tag_1", "example_tag_1"]

# Using the precviously created handler instance
tagged_data = extract_tags(handler, tags_list)
```

If we print the `tagged_data` variable we will get:
```python
{
    "example_tag_1": "Example data 1",
    "example_tag_2": "Example data 2",
    "example_tag_3": "Example data 3"
}
```

## License
[MIT](https://choosealicense.com/licenses/mit/)

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## Roadmap
- [ ] Additional utils: parsing tables, extracting images, etc.
- [ ] Add unit tests
- [ ] Add batch processing and parallelization

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "AcodisApiHandler",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8.12",
    "maintainer_email": "",
    "keywords": "api,handler,python,acodis",
    "author": "",
    "author_email": "\"Ricardo F. dos Santos\" <ricardofilipecdsantos@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/88/f4/c22f321e5bbe455aa3a95b41cdabb91d25164ed44318fc13e5d6ec71d9fe/AcodisApiHandler-0.3.7.tar.gz",
    "platform": null,
    "description": "# Acodis API Handler\nThis package provides easy to use python classes and functions to communicate with Acodis API (https://acodis.io).\nAcodis is an IDP solution that focuses on extracting and structuring complex documents (PDFs, Images)\n\n## Installation\n```bash\npip install AcodisApiHandler\n```\n\n## Usage\nThis package is particularly useful for programmatic access, since ACODIS' API structure requires a different \n**user** and **password** for every export step. Hence, if you have to manage multiple exports \n(e.g. multiple workflows), you just need to update the main class `user` and `password` attribute,\nand call the `authenticate()` method.\n```python\nfrom AcodisApiHandler import AcodisApiHandler\n\n# Set up your credentials\nACODIS_BASE_URL = \"https://<YOUR-ACOIDS-INSTANCE-URL>/workbench/api/transaction\"\nACODIS_USER = \"<YOUR-EXPORT-USERNAME>\"\nACODIS_PASSWORD = \"<YOUR-EXPORT-PASSWORD>\"\n\n# Create an instance of the AcodisApiHandler class\nhandler = AcodisApiHandler(ACODIS_BASE_URL)\n\n# Set the credentials\nhandler.user = ACODIS_USER\nhandler.password = ACODIS_PASSWORD\n\n# Authenticate with the API\nhandler.authenticate()\n\nhandler.workflow(pdf_path=\"<PATH-TO-PDF-FILE>\")\n\n# The extraction result is an ElementTree XML object stored in the handler.result variable\n# You can check it by:\nprint(handler.result)\n```\n\n## Utils\nThis package also provides some utils to help you with the extraction process.\n\n### Extracting tagged data points\nTags are used to identify the data points that you want to extract from the document.\nThis function will create a dictionary with the tags as keys and the extracted data as values.\n```python\nfrom AcodisApiHandler import extract_tags\n\ntags_list = [\"example_tag_1\", \"example_tag_1\", \"example_tag_1\"]\n\n# Using the precviously created handler instance\ntagged_data = extract_tags(handler, tags_list)\n```\n\nIf we print the `tagged_data` variable we will get:\n```python\n{\n    \"example_tag_1\": \"Example data 1\",\n    \"example_tag_2\": \"Example data 2\",\n    \"example_tag_3\": \"Example data 3\"\n}\n```\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## Roadmap\n- [ ] Additional utils: parsing tables, extracting images, etc.\n- [ ] Add unit tests\n- [ ] Add batch processing and parallelization\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A simple API handler for Python",
    "version": "0.3.7",
    "project_urls": null,
    "split_keywords": [
        "api",
        "handler",
        "python",
        "acodis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "09722f2840bf8274895a48b149859e68378dfc4da7521fc61220ba3bfeedebd0",
                "md5": "cf4d59caa3b105b89a589d13111ea9f2",
                "sha256": "aff4246b8ebd7217c041027c0b4350fdcba040b1715232e5d6a78c2cb48001b6"
            },
            "downloads": -1,
            "filename": "AcodisApiHandler-0.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cf4d59caa3b105b89a589d13111ea9f2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.12",
            "size": 9469,
            "upload_time": "2024-01-18T16:49:47",
            "upload_time_iso_8601": "2024-01-18T16:49:47.902018Z",
            "url": "https://files.pythonhosted.org/packages/09/72/2f2840bf8274895a48b149859e68378dfc4da7521fc61220ba3bfeedebd0/AcodisApiHandler-0.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "88f4c22f321e5bbe455aa3a95b41cdabb91d25164ed44318fc13e5d6ec71d9fe",
                "md5": "9f89d22e8a56f7ea0e6c41fa06a459be",
                "sha256": "f2fea8bbbc7ffdabc7d73994c35bc43788e4491efff59ce060778097f992b95f"
            },
            "downloads": -1,
            "filename": "AcodisApiHandler-0.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "9f89d22e8a56f7ea0e6c41fa06a459be",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.12",
            "size": 9027,
            "upload_time": "2024-01-18T16:49:49",
            "upload_time_iso_8601": "2024-01-18T16:49:49.048739Z",
            "url": "https://files.pythonhosted.org/packages/88/f4/c22f321e5bbe455aa3a95b41cdabb91d25164ed44318fc13e5d6ec71d9fe/AcodisApiHandler-0.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-18 16:49:49",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "acodisapihandler"
}
        
Elapsed time: 0.23210s