Skip to main content

License Version Python Read the Docs
Build Code Coverage

ML Client

Read the full documentation at Read the Docs.


ML Client is a python library providing a python API to manage a MarkLogic instance.

Low-level MLClient:

>>> 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:

>>> 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 :

>>> 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

pip install mlclient

Metadata

Release files for mlclient 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlclient 0.4.1
File Size Uploaded
mlclient-0.4.1.tar.gz 59.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mlclient 0.4.1
File Interpreter ABI Platform
mlclient-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 147.1 kB

Release files / mlclient-0.4.1.tar.gz

Download URL mlclient-0.4.1.tar.gz
Size 59.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f8976a24e35478638db11a854c6f52f98de7f921cc5b9e99b696c537f8063556
BLAKE2b-256 checksum
How to use checksums
69b947372fa23ef77dfadad7d22085059ad4c8f40f5619a4a0ca8aba2fed48e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.1 CPython/3.8.10 Linux/5.15.0-97-generic

Release files / mlclient-0.4.1-py3-none-any.whl

Download URL mlclient-0.4.1-py3-none-any.whl
Size 87.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc092370ca73882148c147625db15bc55793bc09dc984afb5396fe9bf96d1d01
BLAKE2b-256 checksum
How to use checksums
f78e3e929417fcd6c2a8bb51aa7a77251f62ea17cb1028048eb94625ef93a826
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.1 CPython/3.8.10 Linux/5.15.0-97-generic

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page