Skip to main content

Preprocess SDK

Project description

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 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypreprocess-1.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

pypreprocess-1.0.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file pypreprocess-1.0.1.tar.gz.

File metadata

  • Download URL: pypreprocess-1.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pypreprocess-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9822bb704910c0d624844fefb4c7c6bd77edcb17643034cd438b2267e24098b1
MD5 6dbb657dd9f91debb15b716697f712b2
BLAKE2b-256 58be9ba34db1d31675292ea4cf5ab46b43e3dc4b6e5e31550c93ccb22dae7660

See more details on using hashes here.

File details

Details for the file pypreprocess-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pypreprocess-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 52830b4f63fd172effd274ae65f51af28865010784076270a006f8dfc9ec3185
MD5 2eba1676e5eb494b410c4db2621778cf
BLAKE2b-256 5b4fdd51265ee61d9ca502d9fc8226cff8135b4fb64394f0fbd271c3b12ef3fc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page