Skip to main content

Vectice Python library

Project description

Python library for Vectice project.

Developer’s Setup

1. Installation

It is recommended to install this library in a virtualenv using pip.

Supported Python Versions

Python >= 3.6

Mac/Linux

pip install virtualenv
virtualenv venv
source venv/bin/activate
venv/bin/pip install -e .[dev]

if using Zsh, add backslash (\) to escape square brackets:

venv/bin/pip install -e .\[dev\]

Windows

pip install virtualenv
virtualenv venv
venv\Scripts\activate
venv\Scripts\pip.exe install -e .[dev]

2. Start Backend Server

The backend server and database need to be running to receive requests from the Python library. See the backend repository for more details.

Make sure there exist at least one workspace and one project.

3. Prepare an ApiKey

Go to the GraphQL Playground: http://localhost:4000/graphql

Note that an authentication header is required to perform the following mutations.

Generate an ApiKey

mutation {
  generateApiKey(workspaceId: 1, apiKey: {name: "Key1"}) {key}
}

Be sure to save the key somewhere, for it will only show once.

Deploy the ApiKey

mutation {
  updateApiKey(workspaceId: 1, apiKeyId: 1, apiKey: {status: DEPLOYED}) {name, status}
}

4. Example Usage

Now, try to run some code in a Python console:

python -i
from vectice import Vectice
vectice = Vectice(project_token="xcvbn")
vectice.list_jobs()

5. Linting

Two linters are used cooperatively in this project, namely black and flake8. They will be run upon commits (pre-commit hooks) and pull requests (CI).

Commands to run them:

black .
flake8

It is recommended to run black first, then flake8.

6. Build

A build step is included in CI. To locally build:

pip install build
python -m build

Project details


Release history Release notifications | RSS feed

This version

0.0.6

Download files

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

Source Distribution

vectice-0.0.6.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

vectice-0.0.6-py2.py3-none-any.whl (49.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file vectice-0.0.6.tar.gz.

File metadata

  • Download URL: vectice-0.0.6.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.8

File hashes

Hashes for vectice-0.0.6.tar.gz
Algorithm Hash digest
SHA256 1227efbf404f72f13eb1771993ba769cb127921a86884d27f14dd051c90a8972
MD5 2caba5b37e9f04b9dd21e019eaf6fb1b
BLAKE2b-256 3b12a0e8b4d9df9b87cb930be4a1c4d30902046ebec0d701e1fa19e820799de9

See more details on using hashes here.

File details

Details for the file vectice-0.0.6-py2.py3-none-any.whl.

File metadata

  • Download URL: vectice-0.0.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 49.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.8

File hashes

Hashes for vectice-0.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2312f3792b116f6210376cb87960a320107f3a5c81420ad260434a59034c1a12
MD5 8ad92838e7f4add4900a19307bf7a6d5
BLAKE2b-256 9fa5280ac19b8c9271c2518edd320d6c3e65bec62ed07aa76dbbc050f3212a03

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