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
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
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
File details
Details for the file vectice-0.0.8.tar.gz
.
File metadata
- Download URL: vectice-0.0.8.tar.gz
- Upload date:
- Size: 33.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddc3c192e00c02e8d896d3f59550a0d535d92c1bdbf59117e24e71b915ce6efa |
|
MD5 | 214f43c71683d814eec14b6f1f6ddedc |
|
BLAKE2b-256 | a09eecb9165982df4a8670bd2a482d244c0f1e5a2e059ece76229d8ee8d68570 |
File details
Details for the file vectice-0.0.8-py2.py3-none-any.whl
.
File metadata
- Download URL: vectice-0.0.8-py2.py3-none-any.whl
- Upload date:
- Size: 53.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 166ac4b2939a33ed51cb110d74cd2e7a32ced37fd84c34ea0111f400d87c6294 |
|
MD5 | b271a892a798a0817ffdd77a4327e12e |
|
BLAKE2b-256 | 88a8c3fbef3238eaa11e6afea3455d06d12fb2c99c55ccbe6fe3e96dbaf63f27 |