lectric-sdk


Namelectric-sdk JSON
Version 0.0.43 PyPI version JSON
download
home_pageNone
SummaryLectric client
upload_time2024-06-14 22:37:05
maintainerNone
docs_urlNone
authorDisa Mhembere
requires_python<3.10,>=3.7
licenseNone
keywords lectric vdb vector database
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://dev.azure.com/msresearch/WatchFor/_git/lectric), 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==0.17.2 --include-deps`

This will create the `openapi-python-client.exe` executable and its dependencies. We require the following versions:

```
- autoflake 2.2.1
- black 24.1.1
- isort 5.13.2
- openapi-python-client 0.17.2
    - httpx.exe
    - openapi-python-client.exe
    - ruff.exe
- poetry 1.7.1
```

### 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](https://www.sphinx-doc.org/en/master/usage/installation.html).
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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "lectric-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.10,>=3.7",
    "maintainer_email": null,
    "keywords": "lectric, vdb, vector database",
    "author": "Disa Mhembere",
    "author_email": "disamhembere@microsoft.com",
    "download_url": "https://files.pythonhosted.org/packages/fb/fc/2b3f6b8da6cb90b5b8d944c33ee585a8bdf9c04470a8daff7aedb4db00de/lectric-sdk-0.0.43.tar.gz",
    "platform": null,
    "description": "# Lectric Software Development Kit (SDK)\r\n\r\nProgrammatic access to the lectric vector database service.\r\n\r\n## Installation\r\n\r\nThe SDK is exposed as a simple python package. There are two main ways it can be installed.\r\n\r\n## Developers\r\n\r\nClone the git repo and install from source:\r\n\r\nFirst clone the repo from [here](https://dev.azure.com/msresearch/WatchFor/_git/lectric), then\r\n```\r\ncd lectric/client\r\npython -m pip install -U -r requirements-dev.txt\r\npython setup.py install\r\n```\r\n\r\n### Generating the client\r\n\r\n`pipx install openapi-python-client==0.17.2 --include-deps`\r\n\r\nThis will create the `openapi-python-client.exe` executable and its dependencies. We require the following versions:\r\n\r\n```\r\n- autoflake 2.2.1\r\n- black 24.1.1\r\n- isort 5.13.2\r\n- openapi-python-client 0.17.2\r\n    - httpx.exe\r\n    - openapi-python-client.exe\r\n    - ruff.exe\r\n- poetry 1.7.1\r\n```\r\n\r\n### Running the tests\r\n\r\nIn order to run the client (SDK) tests a server running on `http://localhost:8000`, with an appropriate `lectric_config.yaml` exported as\r\nan environment variable.\r\n\r\n```\r\ncd tests\r\npython -m pytest -s .\r\n```\r\n\r\n\r\n### Modifying the SDK\r\n\r\nThe main wrapper to the auto-generated client is located within `lectric/lectric_client.py`.\r\nTo refresh/recreate the auto-generated client library. Make sure to run the `uvicorn` fastapi sever from at port `8000`:\r\n```\r\nuvicorn main:app --reload\r\n```\r\n\r\n,then generate the client.\r\n\r\n```\r\n./generate.sh\r\n```\r\n\r\n## General Users\r\n\r\nWe highly recommend installing Lectric within a virtual environment to avoid package\r\nversioning mismatches. For `Python 3.6+`\r\n\r\n### Mac/Linux\r\n\r\n```\r\npython -m venv lectric-env\r\nsource lectric-env/Scripts/activate\r\n```\r\n\r\n### Windows\r\n\r\n```\r\npython -m venv lectric-env\r\n./lectric-env/Scripts/Activate.ps1\r\n```\r\n\r\n\r\nThen install from our WatchFor PyPI registry as follows:\r\n\r\n```\r\npip install --index-url https://pkgs.dev.azure.com/watchfor/WatchForTools/_packaging/w4Tools/pypi/simple/ watchfor-lectric-sdk==<VERSION>\r\n```\r\n\r\nWhere `<VERSION>` is your desired version (at the time of edit `0.0.3`).\r\n\r\n\r\n## Checking Installation\r\n\r\nSimply run:\r\n\r\n```\r\nimport lectric\r\nprint(lectric.version()) # Should return a string with the version you installed\r\n```\r\n\r\n## Documentation\r\n\r\nHTML docs are maintained within `docs/build/html`. To review docs open `index.html` within any browser.\r\n\r\n## Building the docs\r\n\r\nInstall the sphinx on the system as per the instructions [here](https://www.sphinx-doc.org/en/master/usage/installation.html).\r\nA few examples are:\r\n**Windows**: `choco install sphinx`\r\n**Ubuntu**: `apt-get install python3-sphinx`\r\nThis should put `sphinx-build` on the path.\r\n\r\nThen within `docs` run `make html`, for html docs.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Lectric client",
    "version": "0.0.43",
    "project_urls": null,
    "split_keywords": [
        "lectric",
        " vdb",
        " vector database"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fbfc2b3f6b8da6cb90b5b8d944c33ee585a8bdf9c04470a8daff7aedb4db00de",
                "md5": "879fc68353f6f1b7026e8793ba2055d1",
                "sha256": "ced9202d4300ff87bd759dae688c7dbec2d26da876d5eab45afa898fe6c97ca0"
            },
            "downloads": -1,
            "filename": "lectric-sdk-0.0.43.tar.gz",
            "has_sig": false,
            "md5_digest": "879fc68353f6f1b7026e8793ba2055d1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.10,>=3.7",
            "size": 42194,
            "upload_time": "2024-06-14T22:37:05",
            "upload_time_iso_8601": "2024-06-14T22:37:05.843806Z",
            "url": "https://files.pythonhosted.org/packages/fb/fc/2b3f6b8da6cb90b5b8d944c33ee585a8bdf9c04470a8daff7aedb4db00de/lectric-sdk-0.0.43.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-14 22:37:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "lectric-sdk"
}
        
Elapsed time: 0.57895s