[![License](https://img.shields.io/github/license/monasticus/mlclient?label=License&style=plastic)](https://github.com/monasticus/mlclient/blob/main/LICENSE)
[![Version](https://img.shields.io/pypi/v/mlclient?color=blue&label=PyPI&style=plastic)](https://pypi.org/project/mlclient/)
[![Python](https://img.shields.io/pypi/pyversions/mlclient?label=Python&style=plastic)](https://www.python.org/)
[![Build](https://img.shields.io/github/actions/workflow/status/monasticus/mlclient/test.yml?label=Test%20MLClient&style=plastic)](https://github.com/monasticus/mlclient/actions/workflows/test.yml?query=branch%3Amain)
[![Code Coverage](https://img.shields.io/badge/Code%20Coverage-100%25-brightgreen?style=plastic)](https://github.com/monasticus/mlclient/actions/workflows/coverage_badge.yml?query=branch%3Amain)
# ML Client
___
ML Client is a python library providing a python API to manage a MarkLogic instance.
Low-level **MLClient**:
```python
>>> from mlclient import MLClient
>>> config = {
... "host": "localhost",
... "port": 8002,
... "username": "admin",
... "password": "admin",
... }
>>> with MLClient(**config) as client:
... resp = client.post(endpoint="/v1/eval",
... body={"xquery": "xdmp:database() => xdmp:database-name()"})
... print(resp.text)
...
--6a5df7d535c71968
Content-Type: text/plain
X-Primitive: string
App-Services
--6a5df7d535c71968--
```
Medium-level **MLResourcesClient**:
```python
>>> from mlclient import MLResourcesClient
>>> config = {
... "host": "localhost",
... "port": 8002,
... "username": "admin",
... "password": "admin",
... }
>>> with MLResourcesClient(**config) as client:
... resp = client.eval(xquery="xdmp:database() => xdmp:database-name()")
... print(resp.text)
...
--6a5df7d535c71968
Content-Type: text/plain
X-Primitive: string
App-Services
--6a5df7d535c71968--
```
Parsed response :
```python
>>> from mlclient import MLResourcesClient, MLResponseParser
>>> config = {
... "host": "localhost",
... "port": 8002,
... "username": "admin",
... "password": "admin",
... }
>>> with MLResourcesClient(**config) as client:
... resp = client.eval(xquery="xdmp:database() => xdmp:database-name()")
... parsed_resp = MLResponseParser.parse(resp)
... print(parsed_resp)
...
App-Services
```
## Installation
Install MLClient with pip
```sh
pip install mlclient
```
Raw data
{
"_id": null,
"home_page": "https://github.com/monasticus/mlclient",
"name": "mlclient",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "MarkLogic,marklogic,database,client,data,xml,json,NoSQL,nosql",
"author": "Tomasz Anio\u0142owski",
"author_email": "tomasz.maciej.aniolowski@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e4/e9/5f5440c23fb21dc3be1a0f33549252371200ca70485b716137e5dcfe74b7/mlclient-0.4.0.tar.gz",
"platform": null,
"description": "[![License](https://img.shields.io/github/license/monasticus/mlclient?label=License&style=plastic)](https://github.com/monasticus/mlclient/blob/main/LICENSE)\n[![Version](https://img.shields.io/pypi/v/mlclient?color=blue&label=PyPI&style=plastic)](https://pypi.org/project/mlclient/)\n[![Python](https://img.shields.io/pypi/pyversions/mlclient?label=Python&style=plastic)](https://www.python.org/) \n[![Build](https://img.shields.io/github/actions/workflow/status/monasticus/mlclient/test.yml?label=Test%20MLClient&style=plastic)](https://github.com/monasticus/mlclient/actions/workflows/test.yml?query=branch%3Amain)\n[![Code Coverage](https://img.shields.io/badge/Code%20Coverage-100%25-brightgreen?style=plastic)](https://github.com/monasticus/mlclient/actions/workflows/coverage_badge.yml?query=branch%3Amain)\n\n# ML Client\n___\n\nML Client is a python library providing a python API to manage a MarkLogic instance.\n\nLow-level **MLClient**:\n```python\n>>> from mlclient import MLClient\n>>> config = {\n... \"host\": \"localhost\",\n... \"port\": 8002,\n... \"username\": \"admin\",\n... \"password\": \"admin\",\n... }\n>>> with MLClient(**config) as client:\n... resp = client.post(endpoint=\"/v1/eval\",\n... body={\"xquery\": \"xdmp:database() => xdmp:database-name()\"})\n... print(resp.text)\n...\n--6a5df7d535c71968\nContent-Type: text/plain\nX-Primitive: string\n\nApp-Services\n--6a5df7d535c71968--\n```\n\nMedium-level **MLResourcesClient**:\n```python\n>>> from mlclient import MLResourcesClient\n>>> config = {\n... \"host\": \"localhost\",\n... \"port\": 8002,\n... \"username\": \"admin\",\n... \"password\": \"admin\",\n... }\n>>> with MLResourcesClient(**config) as client:\n... resp = client.eval(xquery=\"xdmp:database() => xdmp:database-name()\")\n... print(resp.text)\n...\n--6a5df7d535c71968\nContent-Type: text/plain\nX-Primitive: string\n\nApp-Services\n--6a5df7d535c71968--\n```\n\nParsed response :\n```python\n>>> from mlclient import MLResourcesClient, MLResponseParser\n>>> config = {\n... \"host\": \"localhost\",\n... \"port\": 8002,\n... \"username\": \"admin\",\n... \"password\": \"admin\",\n... }\n>>> with MLResourcesClient(**config) as client:\n... resp = client.eval(xquery=\"xdmp:database() => xdmp:database-name()\")\n... parsed_resp = MLResponseParser.parse(resp)\n... print(parsed_resp)\n...\nApp-Services\n```\n\n## Installation\n\nInstall MLClient with pip\n\n```sh\npip install mlclient\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A python client managing your MarkLogic instance",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/monasticus/mlclient",
"Repository": "https://github.com/monasticus/mlclient"
},
"split_keywords": [
"marklogic",
"marklogic",
"database",
"client",
"data",
"xml",
"json",
"nosql",
"nosql"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ff4bfd1fed7eb15ff5203afd7161d9ece0bce817d2e3636dad4b14b20d36c8dc",
"md5": "978124eead03576debdb62e2a3b564c0",
"sha256": "ca18ec8fdc25ffecf22e026f9d1f7a0ff891c3e965f90a976b087748c36c7571"
},
"downloads": -1,
"filename": "mlclient-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "978124eead03576debdb62e2a3b564c0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 79741,
"upload_time": "2023-11-18T20:03:29",
"upload_time_iso_8601": "2023-11-18T20:03:29.869246Z",
"url": "https://files.pythonhosted.org/packages/ff/4b/fd1fed7eb15ff5203afd7161d9ece0bce817d2e3636dad4b14b20d36c8dc/mlclient-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e4e95f5440c23fb21dc3be1a0f33549252371200ca70485b716137e5dcfe74b7",
"md5": "a5731db71807a144c47fd1bc7fbe6c8c",
"sha256": "ab1cfed227c11006949b4cc3331a337a39b2aaebef77c65b6b66456d61bd5c9c"
},
"downloads": -1,
"filename": "mlclient-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "a5731db71807a144c47fd1bc7fbe6c8c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 53038,
"upload_time": "2023-11-18T20:03:31",
"upload_time_iso_8601": "2023-11-18T20:03:31.937612Z",
"url": "https://files.pythonhosted.org/packages/e4/e9/5f5440c23fb21dc3be1a0f33549252371200ca70485b716137e5dcfe74b7/mlclient-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-18 20:03:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "monasticus",
"github_project": "mlclient",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mlclient"
}