LatentSense Python SDK
Overview
The LatentSense Python SDK provides a convenient and developer-friendly client for accessing the LatentSense Interactive APIs. Designed for enterprise environments, it streamlines authentication, file handling, and API interactions, enabling organizations to transform unbounded corpora of unstructured language-as-data into reasoning-ready semantic structures (through rxMaps) and privacy-preserving data assets (through DeiD).
Through capabilities such as semantic spaces mapping, saliency detection, relationship discovery, and data de-identification, the SDK helps convert language data into interoperable semantic infrastructure that can power analytics, agentic automation, knowledge systems, business workflows, and decision-making at enterprise scale. No RAG. No re-platforming. No ETL required.
Installation
pip install latentsense-sdk
Configuration
The client can be configured by passing parameters to its constructor or by using environment variables.
Constructor Arguments
You can initialize the client directly with your credentials:
from latentsense_sdk import LatentSenseClient
client = LatentSenseClient(
project_id="your-project-id",
api_key="your-api-key",
)
Environment Variables
If constructor arguments are not provided, the client will fall back to reading from environment variables:
LST_PROJECT_ID: Your LatentSense project ID.LST_API_KEY: Your LatentSense API key.
For example, in your shell:
export LST_PROJECT_ID="your-project-id"
export LST_API_KEY="your-api-key"
Usage
See https://docs.latentsense.com
Here's a basic example of how to initialize the client and use it to redact Personally Identifiable Information (PII) from a document.
import asyncio
from latentsense_sdk import LatentSenseClient
# The client is configured via environment variables.
# Ensure they are set before running, for example:
# os.environ["LST_PROJECT_ID"] = "your-project-id"
# os.environ["LST_API_KEY"] = "your-api-key"
async def rx_map_example():
in_memory_file = ("report.txt", "This is a report about Jane Smith.")
rx_map_results = await client.runs.create_rx_map(files=[in_memory_file])
for result in rx_map_results:
print(f"--- Results for {result.file.name} ---")
print(f"Nodes in graph: {result.graph.nodes}")
async def redaction_example():
in_memory_file = ("report.txt", "This is a report about Jane Smith.")
redacted_results = await client.runs.redact_pii(files=[in_memory_file])
for result in redacted_results:
print(f"--- Results for {result.file.name} ---")
print(f"Redacted text: {result.redacted}")
if __name__ == '__main__':
client = LatentSenseClient()
asyncio.run(rx_map_example())
asyncio.run(redaction_example())
Metadata
Release files for latentsense-sdk 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| latentsense_sdk-1.1.0.tar.gz | 13.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| latentsense_sdk-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.1 kB
Release files / latentsense_sdk-1.1.0.tar.gz
| Download URL | latentsense_sdk-1.1.0.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
213ce1ce8cd68e29552994c2da1b38f50fbc546d63a5e7f7b115f9d8fc62a656
|
|
BLAKE2b-256 checksum How to use checksums |
8339fc68a4b7d04441eae63ef5748a31ce0f8ed6bc96a2439d3de982a56380ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.0
|
Release files / latentsense_sdk-1.1.0-py3-none-any.whl
| Download URL | latentsense_sdk-1.1.0-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
873003532598d778f42694ecd654660fa6a841559d0fa0390bf5dac6f4c2bc28
|
|
BLAKE2b-256 checksum How to use checksums |
25dc2889ca02cdf4f37374ceff62f8b81610f90cd988d18dedb1f103e1b2bf9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.0
|
Security for latentsense-sdk 1.1.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.