# Preprocess SDK
_**This is a repository for sdk for preprocess that will be used to interact with the system.**_
## Initialise a connection
>First, you should have an api key to use it, otherwise you'll not be allowed to connect/interact with preprocess system
To get an api key, feel free to send a request to [Support](mailto:support@preprocess.co) asking for an api key.
```
1- preprocess = Preprocess(api_key=YOUR_API_KEY, filepath="path/for/file")
2- preprocess = Preprocess(api_key=YOUR_API_KEY, process_id="id_of_the_process")
3- preprocess = Preprocess(api_key=YOUR_API_KEY, process=ProcessResponse)
```
## Chunk
>Here you have to pass the filepath then call chunk method for chunking and it'll return to you a ProcessResponse object containing all info you'll need.
```
1- response = preprocess.chunk()
```
## Getting the results
>You can directly call one of those methods that'll be listed to get the result after getting a success chunk call, or whenever you want call them after initialise the Preprocess object with either `process_id` or `process` which is a PreprocessResponse object, and the result will be always a PreprocessResponse containing the chunks inside data parameter.
- If you want to wait until it finish use `wait()` method
```
1, 2 and 3- result = preprocess.wait()
- print(result.data['chunks'])
```
- If you don't want to wait consider calling `result()` and check the status if it's not FINISHED or OK, so it's still chunking.
```
1, 2 and 3- result = preprocess.result()
- if result.status in ["FINISHED", "OK"]:
- print(result.data['chunks'])
```
## Other methods
>This part will containing some existing function may help you
- `set_filepath(path)` setting the file path after initialise the object.
- `set_process_id(id)` setting the process_id param by id.
- `set_process(process)` setting the process_id param by PrepreocessResponse object.
- `set_info(dict)` info for handle the chunking based on your needs.
- `to_json()` returning a json str representing the current object.
Raw data
{
"_id": null,
"home_page": "",
"name": "pypreprocess",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,python3,preprocess,chunks,paragraphs,chunk,paragraph,llama,llamaondex,langchain",
"author": "Preprocess",
"author_email": "<support@preprocess.co>",
"download_url": "https://files.pythonhosted.org/packages/54/9f/b2baa6f792bd4579790289011e4dca7c2d21c21a32ca7987d27de3db4e65/pypreprocess-1.1.0.tar.gz",
"platform": null,
"description": "\n# Preprocess SDK\n_**This is a repository for sdk for preprocess that will be used to interact with the system.**_\n\n## Initialise a connection\n>First, you should have an api key to use it, otherwise you'll not be allowed to connect/interact with preprocess system\nTo get an api key, feel free to send a request to [Support](mailto:support@preprocess.co) asking for an api key.\n\n```\n1- preprocess = Preprocess(api_key=YOUR_API_KEY, filepath=\"path/for/file\")\n2- preprocess = Preprocess(api_key=YOUR_API_KEY, process_id=\"id_of_the_process\")\n3- preprocess = Preprocess(api_key=YOUR_API_KEY, process=ProcessResponse)\n```\n\n## Chunk\n>Here you have to pass the filepath then call chunk method for chunking and it'll return to you a ProcessResponse object containing all info you'll need.\n\n```\n1- response = preprocess.chunk()\n```\n\n## Getting the results\n>You can directly call one of those methods that'll be listed to get the result after getting a success chunk call, or whenever you want call them after initialise the Preprocess object with either `process_id` or `process` which is a PreprocessResponse object, and the result will be always a PreprocessResponse containing the chunks inside data parameter.\n\n- If you want to wait until it finish use `wait()` method\n ```\n 1, 2 and 3- result = preprocess.wait()\n - print(result.data['chunks'])\n ```\n- If you don't want to wait consider calling `result()` and check the status if it's not FINISHED or OK, so it's still chunking.\n ```\n 1, 2 and 3- result = preprocess.result()\n - if result.status in [\"FINISHED\", \"OK\"]: \n - print(result.data['chunks'])\n ```\n## Other methods\n>This part will containing some existing function may help you \n\n- `set_filepath(path)` setting the file path after initialise the object.\n- `set_process_id(id)` setting the process_id param by id.\n- `set_process(process)` setting the process_id param by PrepreocessResponse object.\n- `set_info(dict)` info for handle the chunking based on your needs.\n- `to_json()` returning a json str representing the current object.\n",
"bugtrack_url": null,
"license": "",
"summary": "Preprocess SDK",
"version": "1.1.0",
"project_urls": null,
"split_keywords": [
"python",
"python3",
"preprocess",
"chunks",
"paragraphs",
"chunk",
"paragraph",
"llama",
"llamaondex",
"langchain"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1d87f88193035165108b0dc92497c00dfd8cc821b0511626c060af6427f217cb",
"md5": "79ba650a5825ac8f3dc4e6d2a5680d73",
"sha256": "f566dad94048ed543365e9a3d8883458050de2e9495978b1662cd50407eb68bd"
},
"downloads": -1,
"filename": "pypreprocess-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "79ba650a5825ac8f3dc4e6d2a5680d73",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4350,
"upload_time": "2023-12-13T10:49:24",
"upload_time_iso_8601": "2023-12-13T10:49:24.143933Z",
"url": "https://files.pythonhosted.org/packages/1d/87/f88193035165108b0dc92497c00dfd8cc821b0511626c060af6427f217cb/pypreprocess-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "549fb2baa6f792bd4579790289011e4dca7c2d21c21a32ca7987d27de3db4e65",
"md5": "455ecb995b2e01dd9ad7af18a8e11d38",
"sha256": "d84642613115e567435e1029e5852c75fa7b4e1fdf7384cea1472e5db13de1db"
},
"downloads": -1,
"filename": "pypreprocess-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "455ecb995b2e01dd9ad7af18a8e11d38",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3987,
"upload_time": "2023-12-13T10:49:26",
"upload_time_iso_8601": "2023-12-13T10:49:26.466725Z",
"url": "https://files.pythonhosted.org/packages/54/9f/b2baa6f792bd4579790289011e4dca7c2d21c21a32ca7987d27de3db4e65/pypreprocess-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-13 10:49:26",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pypreprocess"
}