unstract-sdk


Nameunstract-sdk JSON
Version 0.76.1 PyPI version JSON
download
home_pageNone
SummaryA framework for writing Unstract Tools/Apps
upload_time2025-07-15 14:52:32
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>=3.9
licenseAGPL v3
keywords unstract tools-development-kit apps development-kit sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
<img src="https://raw.githubusercontent.com/Zipstack/unstract-sdk/main/docs/assets/unstract_u_logo.png" style="height: 60px">

# Unstract

## No-code LLM Platform to launch APIs and ETL Pipelines to structure unstructured documents

</div>

# Unstract SDK

The `unstract-sdk` package helps with developing tools that are meant to be run on the Unstract platform. This includes
modules to help with tool development and execution, caching, making calls to LLMs / vectorDBs / embeddings .etc.
They also contain helper methods/classes to aid with other tasks such as indexing and auditing the LLM calls.

## Installation

- The below libraries need to be installed to run the SDK
  - Linux

    ```bash
    sudo apt install build-essential pkg-config libmagic-dev
    ```

  - Mac

    ```bash
    brew install pkg-config libmagic pandoc tesseract-ocr
    ```

## Tools

### Create a scaffolding for a new tool

Example

```bash
unstract-tool-gen --command NEW --tool-name <name of tool> \
 --location ~/path_to_repository/unstract-tools/ --overwrite false
```

Supported commands:

- `NEW` - Create a new tool

### Environment variables required for all Tools

| Variable                   | Description                                                           |
| -------------------------- | --------------------------------------------------------------------- |
| `PLATFORM_SERVICE_HOST`    | The host in which the platform service is running                     |
| `PLATFORM_SERVICE_PORT`    | The port in which the service is listening                            |
| `PLATFORM_SERVICE_API_KEY` | The API key for the platform                                          |
| `TOOL_DATA_DIR`            | The directory in the filesystem which has contents for tool execution |

### Llama Index support

Unstract SDK 0.3.2 uses the following version of Llama
Index Version **0.9.28** as on January 14th, 2024

### Developing with the SDK

Ensure that you have all the required dependencies and pre-commit hooks installed

```shell
uv sync
pre-commit install
```

Once the changes have been made, it can be tested with [Unstract](https://github.com/Zipstack/unstract) through the following means.

#### With UV

Specify the SDK as a dependency to a project using a tool like `uv` by adding the following to your `pyproject.toml`

```toml
dependencies = [
    "unstract-sdk"
]

[dependency-groups]
dev = [
"unstract-sdk"
]

[tool.uv.sources]
unstract-sdk = { path = "${UNSTRACT_SDK_PATH", editable = true  }
```

#### With pip

- If the project is using `pip` it might be possible to add it as a dependency in `requirements.txt`

```shell
-e /path/to/unstract-sdk
```

NOTE: Building locally might require the below section to be replaced in the `unstract-sdk`'s build system configuration

```toml
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
```

- Another option is to provide a git URL in `requirements.txt`, this can come in handy while building tool
docker images. Don't forget to run `apt install git` within the `Dockerfile` for this

```toml
[tool.uv.sources]
unstract-sdk = { git = "git+https://github.com/Zipstack/unstract-sdk@feature-branch" }
```

- Or try installing a [local PyPI server](https://pypi.org/project/pypiserver/) and upload / download your package from this server

#### Additonal dependencies for tool

Tools may need to be backed up by a file storage. `unstract.sdk.file_storage` contains the required interfaces for the
same. `fsspec` is being used underneath to implement these interfaces. Hence, one can choose to use a file system
supported by fsspec for this. However, the required dependencies need to be added in the tool dependency manager.
Eg. If the tool is using Minio as the underlying file storage, then `s3fs` can be added to support it.
Similarly, for Google Cloud Storage, `gcsfs` needs to be added.
The following versions are tested in the SDK using unit test cases for the above package.

```toml
  gcsfs==2024.10.0
  s3fs==2024.10.0
```

### Documentation generation

Follow [this README.md](https://github.com/Zipstack/unstract-sdk/blob/main/docs/README.md) for generating documentation.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "unstract-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.9",
    "maintainer_email": null,
    "keywords": "unstract tools-development-kit apps development-kit sdk",
    "author": null,
    "author_email": "Zipstack Inc <devsupport@zipstack.com>",
    "download_url": "https://files.pythonhosted.org/packages/91/ea/038da8c278e811ec9a5263c856d157a8a4ce57a10052c507edfb192afc60/unstract_sdk-0.76.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n<img src=\"https://raw.githubusercontent.com/Zipstack/unstract-sdk/main/docs/assets/unstract_u_logo.png\" style=\"height: 60px\">\n\n# Unstract\n\n## No-code LLM Platform to launch APIs and ETL Pipelines to structure unstructured documents\n\n</div>\n\n# Unstract SDK\n\nThe `unstract-sdk` package helps with developing tools that are meant to be run on the Unstract platform. This includes\nmodules to help with tool development and execution, caching, making calls to LLMs / vectorDBs / embeddings .etc.\nThey also contain helper methods/classes to aid with other tasks such as indexing and auditing the LLM calls.\n\n## Installation\n\n- The below libraries need to be installed to run the SDK\n  - Linux\n\n    ```bash\n    sudo apt install build-essential pkg-config libmagic-dev\n    ```\n\n  - Mac\n\n    ```bash\n    brew install pkg-config libmagic pandoc tesseract-ocr\n    ```\n\n## Tools\n\n### Create a scaffolding for a new tool\n\nExample\n\n```bash\nunstract-tool-gen --command NEW --tool-name <name of tool> \\\n --location ~/path_to_repository/unstract-tools/ --overwrite false\n```\n\nSupported commands:\n\n- `NEW` - Create a new tool\n\n### Environment variables required for all Tools\n\n| Variable                   | Description                                                           |\n| -------------------------- | --------------------------------------------------------------------- |\n| `PLATFORM_SERVICE_HOST`    | The host in which the platform service is running                     |\n| `PLATFORM_SERVICE_PORT`    | The port in which the service is listening                            |\n| `PLATFORM_SERVICE_API_KEY` | The API key for the platform                                          |\n| `TOOL_DATA_DIR`            | The directory in the filesystem which has contents for tool execution |\n\n### Llama Index support\n\nUnstract SDK 0.3.2 uses the following version of Llama\nIndex Version **0.9.28** as on January 14th, 2024\n\n### Developing with the SDK\n\nEnsure that you have all the required dependencies and pre-commit hooks installed\n\n```shell\nuv sync\npre-commit install\n```\n\nOnce the changes have been made, it can be tested with [Unstract](https://github.com/Zipstack/unstract) through the following means.\n\n#### With UV\n\nSpecify the SDK as a dependency to a project using a tool like `uv` by adding the following to your `pyproject.toml`\n\n```toml\ndependencies = [\n    \"unstract-sdk\"\n]\n\n[dependency-groups]\ndev = [\n\"unstract-sdk\"\n]\n\n[tool.uv.sources]\nunstract-sdk = { path = \"${UNSTRACT_SDK_PATH\", editable = true  }\n```\n\n#### With pip\n\n- If the project is using `pip` it might be possible to add it as a dependency in `requirements.txt`\n\n```shell\n-e /path/to/unstract-sdk\n```\n\nNOTE: Building locally might require the below section to be replaced in the `unstract-sdk`'s build system configuration\n\n```toml\n[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n```\n\n- Another option is to provide a git URL in `requirements.txt`, this can come in handy while building tool\ndocker images. Don't forget to run `apt install git` within the `Dockerfile` for this\n\n```toml\n[tool.uv.sources]\nunstract-sdk = { git = \"git+https://github.com/Zipstack/unstract-sdk@feature-branch\" }\n```\n\n- Or try installing a [local PyPI server](https://pypi.org/project/pypiserver/) and upload / download your package from this server\n\n#### Additonal dependencies for tool\n\nTools may need to be backed up by a file storage. `unstract.sdk.file_storage` contains the required interfaces for the\nsame. `fsspec` is being used underneath to implement these interfaces. Hence, one can choose to use a file system\nsupported by fsspec for this. However, the required dependencies need to be added in the tool dependency manager.\nEg. If the tool is using Minio as the underlying file storage, then `s3fs` can be added to support it.\nSimilarly, for Google Cloud Storage, `gcsfs` needs to be added.\nThe following versions are tested in the SDK using unit test cases for the above package.\n\n```toml\n  gcsfs==2024.10.0\n  s3fs==2024.10.0\n```\n\n### Documentation generation\n\nFollow [this README.md](https://github.com/Zipstack/unstract-sdk/blob/main/docs/README.md) for generating documentation.\n",
    "bugtrack_url": null,
    "license": "AGPL v3",
    "summary": "A framework for writing Unstract Tools/Apps",
    "version": "0.76.1",
    "project_urls": {
        "Homepage": "https://unstract.com",
        "Release notes": "https://github.com/Zipstack/unstract-sdk/releases",
        "Source": "https://github.com/Zipstack/unstract-sdk"
    },
    "split_keywords": [
        "unstract",
        "tools-development-kit",
        "apps",
        "development-kit",
        "sdk"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fadcb39d10ae577d61820546977064231cf4ae454b189fef2a25328fe873b1c6",
                "md5": "43919e6f729e31e0f15f16039b43356e",
                "sha256": "3ddbacc1d5705a06c368225b5884797d0b406e31f5ae5a08e01c80873f6787d1"
            },
            "downloads": -1,
            "filename": "unstract_sdk-0.76.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "43919e6f729e31e0f15f16039b43356e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.9",
            "size": 266606,
            "upload_time": "2025-07-15T14:52:30",
            "upload_time_iso_8601": "2025-07-15T14:52:30.808222Z",
            "url": "https://files.pythonhosted.org/packages/fa/dc/b39d10ae577d61820546977064231cf4ae454b189fef2a25328fe873b1c6/unstract_sdk-0.76.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "91ea038da8c278e811ec9a5263c856d157a8a4ce57a10052c507edfb192afc60",
                "md5": "e0ab2935452c766cab182f6dd9c5624b",
                "sha256": "05ecdf1a1b4cdfaa2414a0a31f42bb8ba9c895980b4ff891dceca25a5b4e0407"
            },
            "downloads": -1,
            "filename": "unstract_sdk-0.76.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e0ab2935452c766cab182f6dd9c5624b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.9",
            "size": 2376403,
            "upload_time": "2025-07-15T14:52:32",
            "upload_time_iso_8601": "2025-07-15T14:52:32.069241Z",
            "url": "https://files.pythonhosted.org/packages/91/ea/038da8c278e811ec9a5263c856d157a8a4ce57a10052c507edfb192afc60/unstract_sdk-0.76.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-15 14:52:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Zipstack",
    "github_project": "unstract-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "unstract-sdk"
}
        
Elapsed time: 0.66707s