Lectric Software Development Kit (SDK)
Programmatic access to the lectric vector database service.
Installation
The SDK is exposed as a simple python package. There are two main ways it can be installed.
Developers
Clone the git repo and install from source:
First clone the repo from here, then
cd lectric/client
python -m pip install -U -r requirements-dev.txt
python setup.py install
Generating the client
pipx install openapi-python-client --include-deps
This will create the openapi-python-client.exe executable and its dependencies.
Running the tests
In order to run the client (SDK) tests a server running on http://localhost:8000, with an appropriate lectric_config.yaml exported as
an environment variable.
cd tests
python -m pytest -s .
Modifying the SDK
The main wrapper to the auto-generated client is located within lectric/lectric_client.py.
To refresh/recreate the auto-generated client library. Make sure to run the uvicorn fastapi sever from at port 8000:
uvicorn main:app --reload
,then generate the client.
./generate.sh
General Users
We highly recommend installing Lectric within a virtual environment to avoid package
versioning mismatches. For Python 3.6+
Mac/Linux
python -m venv lectric-env
source lectric-env/Scripts/activate
Windows
python -m venv lectric-env
./lectric-env/Scripts/Activate.ps1
Then install from our WatchFor PyPI registry as follows:
pip install --index-url https://pkgs.dev.azure.com/watchfor/WatchForTools/_packaging/w4Tools/pypi/simple/ watchfor-lectric-sdk==<VERSION>
Where <VERSION> is your desired version (at the time of edit 0.0.3).
Checking Installation
Simply run:
import lectric
print(lectric.version()) # Should return a string with the version you installed
Documentation
HTML docs are maintained within docs/build/html. To review docs open index.html within any browser.
Building the docs
Install the sphinx on the system as per the instructions here.
A few examples are:
Windows: choco install sphinx
Ubuntu: apt-get install python3-sphinx
This should put sphinx-build on the path.
Then within docs run make html, for html docs.
Uploading the new version
Go to https://dev.azure.com/watchfor/WatchForTools/_artifacts/feed/w4Tools/connect and go to the twine section. Copy and paste the .pypirc into ~/.pypirc and make sure to follow the 'Get the tools' instruction (aka downloading twine and key ring)
Metadata
Release files for lectric-sdk 0.0.47
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lectric_sdk-0.0.47.tar.gz | 44.1 kB | Without provenance | Details for lectric_sdk-0.0.47.tar.gz |
Release files / lectric_sdk-0.0.47.tar.gz
| Download URL | lectric_sdk-0.0.47.tar.gz |
|---|---|
| Size | 44.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7dfc0a215bac131f3f93a591d3f58a3f74c8ccd1c45954aa9c64441d95245261
|
|
BLAKE2b-256 checksum How to use checksums |
fafcd423693bf0e02fecae2ba592217b8097076496333690178b6827be59e2c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.19
|
Security for lectric-sdk 0.0.47
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.