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.store.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.store.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.3.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 cmem-client 1.3.1
File Size Uploaded Provenance Actions
cmem_client-1.3.1.tar.gz 151.0 kB Without provenance Details for cmem_client-1.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 358.9 kB

Release files / cmem_client-1.3.1.tar.gz

Download URL cmem_client-1.3.1.tar.gz
Size 151.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c6c40cd2ad2f43d6032c2cc9aa25425a85917a16ee7e383f024110f95a782c7c
BLAKE2b-256 checksum
How to use checksums
377548dd33b1ebc0be3bc74abba62c0f3739d02b88d03943ac65f2af00228fb2
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-53-amd64

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

Download URL cmem_client-1.3.1-py3-none-any.whl
Size 207.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5bf7a09a60851bf60c29dde846f8504f77222226a89beb0ae47b0041a06ff2b
BLAKE2b-256 checksum
How to use checksums
e15a654d2adc88472f8dfe64423c687fc7812a4f90ced5ac7581cd716aac269c
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-53-amd64

Security for cmem-client 1.3.1

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