NeuronOS Capabilities Library
A collection of provider-agnostic backend capabilities for Python applications, following hexagonal architecture principles.
Each capability exposes well-defined ports and adapters, making implementations swappable without changing your application code.
Installation
pip install neuronos-capabilities-lib
The import name is neuronos_capabilities (from neuronos_capabilities import ...).
Moved from
neuronos-capabilities. Versions up to 0.0.1.5 were published asneuronos-capabilities; from 0.0.2 on the package isneuronos-capabilities-lib. The code and imports are the same. Before switching a local environment, runpip uninstall neuronos-capabilities(both names install the sameneuronos_capabilities/folder).
What is a Capability?
A capability is a self-contained backend module that follows hexagonal architecture (ports and adapters pattern):
Capability/
├── ports/ # Abstract interfaces — defines WHAT operations exist
├── adapters/ # Provider implementations — defines HOW they work
├── config/ # Configuration management
├── exceptions/ # Custom exception hierarchy
└── [name]_manager.py # Public API — single entrypoint for consumers
You interact only with the Manager. The port defines the contract, and adapters implement it for specific providers. Switching from PostgreSQL to MySQL, or from Clerk to Auth0, is just a config change.
Available Capabilities
| Capability | Description | Providers | Docs |
|---|---|---|---|
| SQLManager | Database management with ORM, migrations, connection pooling | PostgreSQL | docs/sql-manager.md |
| AuthManager | JWT authentication and role-based authorization for FastAPI | Clerk | docs/auth-manager.md |
| S3Manager | Object storage with CRUD, listing, multipart uploads, presigned URLs | AWS S3 | docs/s3-manager.md |
SQLManager — Quick Look
from neuronos_capabilities import SQLManager
config = {"host": "localhost", "database": "myapp", "user": "postgres", "password": "secret"}
with SQLManager(config) as db:
db.create_tables([User])
user = db.insert(User, {"name": "Alice", "email": "alice@example.com"})
users = db.query(User, {"name": "Alice"})
AuthManager — Quick Look
from neuronos_capabilities import AuthManager
from fastapi import FastAPI, Depends
auth = AuthManager() # reads NEURONOS_AUTH_JWKS_URL from env
app = FastAPI()
@app.get("/api/protected")
async def protected(user: dict = Depends(auth.require_auth())):
return {"user_id": user["sub"]}
@app.get("/api/admin")
async def admin(user: dict = Depends(auth.require_roles(["org:admin"]))):
return {"message": "Admin access granted"}
S3Manager — Quick Look
from neuronos_capabilities import S3Manager
s3 = S3Manager({"region": "us-east-1"})
# Upload and download
s3.put_object("my-bucket", "hello.txt", b"Hello World")
s3.download_file("my-bucket", "hello.txt", "/tmp/hello.txt")
# Generate a temporary download link
url = s3.generate_presigned_download_url("my-bucket", "hello.txt", expiration=900)
# Recursive listing
for obj in s3.walk("my-bucket", "data/"):
print(f"{obj['Key']} {obj['Size']} bytes")
# Multipart upload for large files
upload_id = s3.create_multipart_upload("my-bucket", "large-file.bin")
part = s3.upload_part("my-bucket", "large-file.bin", 1, upload_id, chunk)
s3.complete_multipart_upload("my-bucket", "large-file.bin", upload_id, [part])
Development
git clone https://github.com/neuronos/neuronos_python_capabilities_library
cd neuronos_python_capabilities_library
pip install -e ".[dev]"
pytest -v
pytest --cov=neuronos_capabilities --cov-report=html
Contributing
- Follow hexagonal architecture: port → adapter → manager
- Implement both sync and async methods
- Include tests and documentation
- Update this README with the new capability
License
MIT — see LICENSE
Metadata
Release files for neuronos-capabilities-lib 0.0.3
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 | |
|---|---|---|---|---|
| neuronos_capabilities_lib-0.0.3.tar.gz | 79.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| neuronos_capabilities_lib-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 180.1 kB
Release files / neuronos_capabilities_lib-0.0.3.tar.gz
| Download URL | neuronos_capabilities_lib-0.0.3.tar.gz |
|---|---|
| Size | 79.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9472d1702b30425fea021a92b1ef54709cd433dadf6aa3292b6f216efc5f20f2
|
|
BLAKE2b-256 checksum How to use checksums |
f756e627aedbb234957d2019d75743fe7b5827096c8a8fb7fc27319e3ba92256
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / neuronos_capabilities_lib-0.0.3-py3-none-any.whl
| Download URL | neuronos_capabilities_lib-0.0.3-py3-none-any.whl |
|---|---|
| Size | 100.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ac5efb42cd53fb81e59dd3560afebd528b872cae2839abf4cbf82c8d1eb2ad9
|
|
BLAKE2b-256 checksum How to use checksums |
17da306eeb42b0dca05397b3198d3d8a1126d65be3f010bc22921b6984cdeaef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for neuronos-capabilities-lib 0.0.3
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.