Skip to main content

nl2sql-sdk

The interfaces an extension for the nl2sql engine implements: database adapters, secret providers, stores and policy checks. The import package is nl2sql_sdk. Its core depends on pydantic and the standard library only, so an extension built against it inherits nothing else.

  • DatasourceAdapter: capabilities(), test_connection(), fetch_schema_snapshot(scope), execute(request) and get_dialect(), which returns a sqlglot dialect name such as postgres or tsql. An adapter class also declares interface_version = 2, a connection_model, the driver_modules it needs and an install_hint for when one is missing.
  • nl2sql_sdk.sqlalchemy (pip install "nl2sql-sdk[sqlalchemy]"): SQLAlchemyAdapter, the base the built-in adapters are built on, and SQLAlchemyConnection. The one part of the SDK that imports SQLAlchemy.
  • nl2sql_sdk.testing (pip install "nl2sql-sdk[testing]"): AdapterConformance, the conformance kit, a pytest test class an adapter's tests subclass. It imports pytest and sqlglot.
  • AdapterRequest, ResultFrame and ResultError: what the engine sends an adapter and what it gets back.
  • SchemaSnapshot and the table, column and foreign-key contracts an adapter describes its schema with.
  • SecretProvider: interface_version = 1, a strict config_model for its block in the secrets config, from_config(cfg) and get_secret(key).
  • nl2sql_sdk.stores: the index, state, trace and results store interfaces.
  • nl2sql_sdk.policy: PolicyCheck (interface_version = 1, a strict config_model, from_config(cfg) and grant(user, datasource_id)), with UserContext and Grant.

An adapter is published as an nl2sql.adapters entry point, and the engine finds it there; it never imports an adapter by name.

pip install nl2sql-sdk

Writing an adapter: Adapter development. Try the engine without installing anything: https://nl2sql.codewithnk.com.

Metadata

Release files for nl2sql-sdk 0.10.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 nl2sql-sdk 0.10.0
File Size Uploaded Provenance Actions
nl2sql_sdk-0.10.0.tar.gz 40.0 kB Without provenance Details for nl2sql_sdk-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nl2sql-sdk 0.10.0
File Interpreter ABI Platform Actions
nl2sql_sdk-0.10.0-py3-none-any.whl Python 3 none any Details for nl2sql_sdk-0.10.0-py3-none-any.whl

Total release size: 86.0 kB

Release files / nl2sql_sdk-0.10.0.tar.gz

Download URL nl2sql_sdk-0.10.0.tar.gz
Size 40.0 kB
Tags Source
SHA-256 checksum
How to use checksums
984d15735685c10d8ca73b538f36fdd019a43ea9cff5c58b8ffa5f4374155a96
BLAKE2b-256 checksum
How to use checksums
1c97a658e948b869decc574bbb156a574483c28c5c815fdf5fceeefbbf7d563d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / nl2sql_sdk-0.10.0-py3-none-any.whl

Download URL nl2sql_sdk-0.10.0-py3-none-any.whl
Size 45.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb37ceaaa62f88cdae9879b4b2dd5d2a4bb6f508c4826a0bc56ad6d0a899ebee
BLAKE2b-256 checksum
How to use checksums
8eb1d38a1d00290fe49365ca422347a962c4deb359ac2c848e0a220f250c4079
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Security for nl2sql-sdk 0.10.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