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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vectorize_client-0.1.1.tar.gz.
File metadata
- Download URL: vectorize_client-0.1.1.tar.gz
- Upload date:
- Size: 37.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c2d05a6536b310f702d2824d06580a4d27ab27651dbc97d9cd0e6766b8f406f
|
|
| MD5 |
65bae1ed4f017ae416f60bbf73802edc
|
|
| BLAKE2b-256 |
b9633fbe37ce2d7c2c68edd29670c755a7d922b543e7586e4e4d9a9bb650dc93
|
Provenance
The following attestation bundles were made for vectorize_client-0.1.1.tar.gz:
Publisher:
release-python.yml on vectorize-io/vectorize-clients
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vectorize_client-0.1.1.tar.gz -
Subject digest:
5c2d05a6536b310f702d2824d06580a4d27ab27651dbc97d9cd0e6766b8f406f - Sigstore transparency entry: 176356824
- Sigstore integration time:
-
Permalink:
vectorize-io/vectorize-clients@13b625de8197cdfd5208529ff97c9b4b6ff41366 -
Branch / Tag:
refs/tags/python-0.1.1 - Owner: https://github.com/vectorize-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@13b625de8197cdfd5208529ff97c9b4b6ff41366 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vectorize_client-0.1.1-py3-none-any.whl.
File metadata
- Download URL: vectorize_client-0.1.1-py3-none-any.whl
- Upload date:
- Size: 104.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68d087a8c4390e71d410043bf7dfc073bd85fd7f1de25c17ff90f90a723d676c
|
|
| MD5 |
96e5eb80e1e764b9588f896f1a9569ac
|
|
| BLAKE2b-256 |
aabb1fa8642154904ba289cdc8c268a800f39175bd97f95cd93b4c68d0468fae
|
Provenance
The following attestation bundles were made for vectorize_client-0.1.1-py3-none-any.whl:
Publisher:
release-python.yml on vectorize-io/vectorize-clients
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vectorize_client-0.1.1-py3-none-any.whl -
Subject digest:
68d087a8c4390e71d410043bf7dfc073bd85fd7f1de25c17ff90f90a723d676c - Sigstore transparency entry: 176356826
- Sigstore integration time:
-
Permalink:
vectorize-io/vectorize-clients@13b625de8197cdfd5208529ff97c9b4b6ff41366 -
Branch / Tag:
refs/tags/python-0.1.1 - Owner: https://github.com/vectorize-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@13b625de8197cdfd5208529ff97c9b4b6ff41366 -
Trigger Event:
push
-
Statement type: