Skip to main content

cmem-client

Next generation eccenca Corporate Memory client library.

pypi version python versions license

cmem-client is the Python client library for eccenca Corporate Memory. Corporate Memory exposes its functionality through several services - DataIntegration (build), DataPlatform (explore), Keycloak and the Marketplace. This library hides that split behind a single typed and validated Python object: the client.

Features

  • Validated responses. Every response is parsed into a Pydantic model, so a typo in a server field becomes an error instead of a KeyError three frames later.
  • Proper typing. The whole package is type annotated and checked with mypy, so your editor can complete and check your code.
  • Dict-like collections. Repositories such as client.graphs behave like read-only dictionaries: len(), in, [] and iteration all work, and data is fetched lazily on first access.
  • Structured logging through the standard library, configured with one call on the client, including a TRACE level below DEBUG which logs the arguments and the result of the methods carrying the decorator.
  • Built on httpx, which would also allow asynchronous calls. The exposed client API is synchronous.

Installation

pip install cmem-client

The package requires Python 3.13 or newer.

Getting started

Point the client at your Corporate Memory deployment and give it credentials:

export CMEM_BASE_URI="https://mycmem.example.com/"
export OAUTH_GRANT_TYPE="client_credentials"
export OAUTH_CLIENT_ID="cmem-service-account"
export OAUTH_CLIENT_SECRET="my-secret"

Then create a client and ask the deployment how it is doing:

from cmem_client.client import Client

client = Client.from_env()

print(client.explore.self_information.type)    # GRAPHDB
print(client.deployment.get_status().health)   # UP
print(len(client.graphs))                      # 6

That is the whole setup. Besides Client.from_env() there are Client.from_dict() for settings you hold yourself, Client.from_context() for use inside a Corporate Memory Python plugin, and Client.from_cmempy() to reuse an already configured cmempy environment.

What you can reach

Everything hangs off the client:

client.graphs           # RDF graphs in the store, a read-only mapping
client.projects         # DataIntegration projects
client.explore.sparql   # SPARQL query and update
client.marketplace      # Marketplace packages

Further repositories cover datasets, workflows, queries, files, variables, schedulers, vocabularies, graph imports and insights, validations, access conditions, user and client accounts, Python packages and installed marketplace packages. The documentation lists them all.

Coming from cmem-cmempy

cmem-client succeeds cmem-cmempy, but it is not a drop-in replacement. Where cmempy offers module-level functions returning parsed JSON, this library gives you a client object whose responses are validated models:

# cmem-cmempy
from cmem.cmempy.dp.proxy.graph import get_graphs_list
graphs = get_graphs_list()                # list of dicts

# cmem-client
graphs = list(client.graphs.values())     # list of Graph models

If a cmempy environment is already configured in your process, reuse it directly with Client.from_cmempy().

Documentation

The full API documentation, including the complete configuration reference and the migration notes, lives at documentation.eccenca.com.

Metadata

Release files for cmem-client 1.4.0

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

Source distribution (sdist)

Source distribution for cmem-client 1.4.0
File Size Uploaded Provenance Actions
cmem_client-1.4.0.tar.gz 203.0 kB Without provenance Details for cmem_client-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cmem-client 1.4.0
File Interpreter ABI Platform Actions
cmem_client-1.4.0-py3-none-any.whl Python 3 none any Details for cmem_client-1.4.0-py3-none-any.whl

Total release size: 483.3 kB

Release files / cmem_client-1.4.0.tar.gz

Download URL cmem_client-1.4.0.tar.gz
Size 203.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0f29157fab70700d997f3cc33dff034b431b7a32c12afa6cb48cf06b6aecd5cf
BLAKE2b-256 checksum
How to use checksums
99caa7eed46b957add75fda5c77569b1ee85e6420507f60d58a664515c658b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.4 CPython/3.13.13 Linux/6.1.0-54-amd64

Release files / cmem_client-1.4.0-py3-none-any.whl

Download URL cmem_client-1.4.0-py3-none-any.whl
Size 280.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed3a45cc5d43474a4f1eaed4bd95905f577e062f3db02041bea5170e7902ba8d
BLAKE2b-256 checksum
How to use checksums
ee8ddc6b4b12fa3f91d40ce18b77f6505aa6363b5f26cc07417e8a4d88799950
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.4 CPython/3.13.13 Linux/6.1.0-54-amd64

Security for cmem-client 1.4.0

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.

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