Skip to main content

Python client for the Vectorize API

Project description

from dataclasses import field

Vectorize Client

Python Api Client for Vectorize For more information, please visit https://vectorize.io

Requirements.

Python 3.8+

Installation & Usage

pip install vectorize-client

Then import the package:

import vectorize_client

Getting Started

Please follow the installation procedure and then run the following:

import vectorize_client as v

TOKEN = '<your-token>'
ORG = '<your-org-id>'

with v.ApiClient(v.Configuration(access_token=TOKEN)) as api:
    pipelines = v.PipelinesApi(api)
    response = pipelines.get_pipelines(ORG)
    print("Found" + str(len(response.data)) + " pipelines")

Documentation for API Endpoints

All URIs are relative to https://api.vectorize.io/v1

See the full reference for more information.

Usage

First, export your token and org id as environment variables:

export VECTORIZE_TOKEN=<your-token>
export VECTORIZE_ORG=<your-org-id>

Then, initialize the client with your token and org id:

import os
TOKEN = os.environ['VECTORIZE_TOKEN']
ORG = os.environ['VECTORIZE_ORG']

Extraction

Set the file you want to extract data from:

export FILE=<path-to-file>

Then, run the following code:

import os
import vectorize_client as v
import time, logging

TOKEN = os.environ['VECTORIZE_TOKEN']
ORG = os.environ['VECTORIZE_ORG']
FILE = os.environ['FILE']

with v.ApiClient(v.Configuration(access_token=TOKEN)) as api:
    with open(FILE, 'rb') as file:
        data = file.read()
        extraction_id = v.ExtractionApi(api).start_extraction(ORG, data).extraction_id
        print(f"Extraction started with id {extraction_id}")
        while True:
            extraction = v.ExtractionApi(api).get_extraction_result(ORG, extraction_id)
            if extraction.ready:
                extracted_data = extraction.data
                if extracted_data.success:
                    print(extracted_data)
                    break
                else:
                    raise Exception(extracted_data.error)
            print("Waiting for extraction to complete...")
            time.sleep(1)

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

vectorize_client-0.1.3.tar.gz (46.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vectorize_client-0.1.3-py3-none-any.whl (144.7 kB view details)

Uploaded Python 3

File details

Details for the file vectorize_client-0.1.3.tar.gz.

File metadata

  • Download URL: vectorize_client-0.1.3.tar.gz
  • Upload date:
  • Size: 46.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for vectorize_client-0.1.3.tar.gz
Algorithm Hash digest
SHA256 20b91f7b25d79f0c3f0890ad932e9d4abac94f57ed616bb83c176ceebbf6ed04
MD5 621e4fec2bcb42e4702eb0f500848e51
BLAKE2b-256 8b16de5a7590f27efb6d38ca6cf0b128a5cbd7f4d72d8919823e4e27feee6c6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vectorize_client-0.1.3.tar.gz:

Publisher: release-python.yml on vectorize-io/vectorize-clients

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vectorize_client-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for vectorize_client-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e30a0148ed9d1a9ba2d1ce6221524b094a04d38310b4e5e2f1a22e8ee40b83f8
MD5 c2b25312983d2776b0a22c7d9e41da71
BLAKE2b-256 48b0595a7c78a8c7860135fb09ad24f0b032fa11f1615b6f7337f704e1ed23ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for vectorize_client-0.1.3-py3-none-any.whl:

Publisher: release-python.yml on vectorize-io/vectorize-clients

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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