Nexus Python Client SDK
Lightweight Python 3.11+ client SDK for Nexus filesystem, designed for LangGraph deployments
Overview
A standalone Python client SDK for Nexus that enables LangGraph agents to interact with Nexus servers. This package is designed for Python 3.11+ compatibility, making it suitable for LangGraph Platform deployments (which support Python 3.11 and 3.12).
Key Features:
- ✅ Python 3.11+ compatible (works with LangGraph Platform)
- ✅ Lightweight - Minimal dependencies, fast installation
- ✅ Complete API - All APIs needed by LangGraph agents
- ✅ LangGraph Ready - Pre-built tool adaptors included
- ✅ 100% API compatible with
nexus-ai-fsremote client
Installation
# Core package
pip install nexus-fs-python
# With LangGraph support
pip install nexus-fs-python[langgraph]
Quick Start
Direct Client Usage
from nexus_client import RemoteNexusFS
# Initialize client
nx = RemoteNexusFS("http://localhost:8080", api_key="sk-your-api-key")
# File operations
content = nx.read("/workspace/file.txt")
nx.write("/workspace/output.txt", b"Hello, World!")
files = nx.list("/workspace")
# File discovery
python_files = nx.glob("*.py", "/workspace")
results = nx.grep("def ", path="/workspace", file_pattern="*.py")
# Cleanup
nx.close()
LangGraph Integration
from nexus_client.langgraph import get_nexus_tools
from langgraph.prebuilt import create_react_agent
from langchain_anthropic import ChatAnthropic
# Get Nexus tools
tools = get_nexus_tools()
# Create agent
llm = ChatAnthropic(model="claude-sonnet-4-5-20250929")
agent = create_react_agent(model=llm, tools=tools)
# Use agent
result = agent.invoke(
{"messages": [{"role": "user", "content": "Find all Python files"}]},
config={
"metadata": {
"x_auth": "Bearer sk-your-api-key",
"nexus_server_url": "http://localhost:8080"
}
}
)
Async Usage
import asyncio
from nexus_client import AsyncRemoteNexusFS
async def main():
async with AsyncRemoteNexusFS("http://localhost:8080", api_key="sk-xxx") as nx:
# Parallel operations
paths = ["/file1.txt", "/file2.txt", "/file3.txt"]
contents = await asyncio.gather(*[nx.read(p) for p in paths])
asyncio.run(main())
LangGraph Tools
The SDK provides 7 ready-to-use LangGraph tools:
grep_files- Search file content with regex patternsglob_files- Find files by glob patternread_file- Read file content (supports cat/less style commands)write_file- Write content to filesystempython- Execute Python code in Nexus-managed sandboxbash- Execute bash commands in sandboxquery_memories- Query and retrieve stored memory records
Core APIs
File Operations
read(),write(),delete(),exists(),stat()list(),glob(),grep()mkdir(),rename()
Sandbox Operations
sandbox_create(),sandbox_run(),sandbox_status()sandbox_pause(),sandbox_resume(),sandbox_stop()
Memory Operations
memory.store(),memory.query(),memory.list()memory.retrieve(),memory.delete()memory.start_trajectory(),memory.log_step(),memory.complete_trajectory()
Skills Operations
skills_list(),skills_info(),skills_search()
Dependencies
Core (Required)
httpx>=0.27.0- HTTP clienttenacity>=8.0.0- Retry logicpydantic>=2.0.0- Data validation
Optional: LangGraph
pip install nexus-client[langgraph]
langchain-core>=0.3.0langgraph>=0.2.0
API Compatibility
This package maintains 100% API compatibility with nexus-ai-fs remote client. Migration is simple:
# Before (nexus-ai-fs)
from nexus.remote import RemoteNexusFS
from nexus.tools.langgraph import get_nexus_tools
# After (nexus-client)
from nexus_client import RemoteNexusFS
from nexus_client.langgraph import get_nexus_tools
No code changes needed beyond imports!
Documentation
- Usage Examples - Comprehensive usage guide with code examples
- API Reference - Complete API documentation
Requirements
- Python 3.11, 3.12, or 3.13
- Nexus server (remote or local)
License
Apache 2.0 - see LICENSE for details.
Contributing
Contributions welcome! Please see the main Nexus repository for contribution guidelines.
Related
- Nexus Repository - Main Nexus filesystem
- GitHub Issue #661 - Original feature request
Metadata
Release files for nexus-fs-python 0.1.4
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 | Actions |
|---|---|---|---|---|
| nexus_fs_python-0.1.4.tar.gz | 73.8 kB | Without provenance | Details for nexus_fs_python-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nexus_fs_python-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for nexus_fs_python-0.1.4-py3-none-any.whl |
Total release size: 144.8 kB
Release files / nexus_fs_python-0.1.4.tar.gz
| Download URL | nexus_fs_python-0.1.4.tar.gz |
|---|---|
| Size | 73.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0975691d8b941cd0457baf10e97d577717e980d0622357b5cd3ca1797d05b9b1
|
|
BLAKE2b-256 checksum How to use checksums |
7597a3664f5c674fd3b63252bc05d8a882eeb51bd7295e296503a590b9b9f6b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / nexus_fs_python-0.1.4-py3-none-any.whl
| Download URL | nexus_fs_python-0.1.4-py3-none-any.whl |
|---|---|
| Size | 70.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
670bec76a8c0cb784e6714138f3cebcdb315e6d0c3831e2f4d826b9062bdbad8
|
|
BLAKE2b-256 checksum How to use checksums |
1aafcdd3f7d92aaed7132a544bc0bccb4e7f96c5cb6a2fc04bcfe5e10f746353
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for nexus-fs-python 0.1.4
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.