Skip to main content

pyds-ai

Data science and LLM work from a notebook, without writing much code.

pip install pyds-ai

The one rule that decides everything: the LLM never produces a number. It writes the query and it writes the words. A deterministic engine (DuckDB) computes the answer. Every result can show you the exact code that produced it via result.code().

Quickstart

import pyds_ai as pyds

pyds.setup()  # one-time key wizard, writes to ~/.pyds_ai/config.toml

d = pyds.load("sales.csv")
d.ask("which region grew fastest last quarter?")
d.chart("revenue by month, split by channel")

m = d.model(target="churn")
m.explain()
m.what_if(tenure=12, plan="premium")

k = pyds.knowledge("policies/")
k.ask("what is our refund window for enterprise?")

a = pyds.agent(uses=[d, k])
a.ask("did churn spike in any region where we changed the refund policy?")

e = pyds.evaluate(a, cases="qa_cases.csv")
e.watch()

Every result is the same shape

Every call returns a Result — never a bare DataFrame, never a dict:

result.explain()   # what was done and why, in sentences
result.code()       # the exact SQL/code that produced it
result.data()       # the underlying DataFrame
result.next()       # up to three suggested follow-up questions
result.why()        # trace: prompt version, model, cost, row counts
result.save(path)   # .html, .csv, .docx, .pptx, .pdf

A failed call returns a Failure (also a Result) instead of a raw traceback: what broke, what it looked like, and the one-line fix to try.

Privacy default

send_data_values = false by default: the model gets column names, types and summary statistics, not your raw rows. Your data does not leave the building unless you explicitly opt in. Set it via:

import pyds_ai as pyds
cfg = pyds.config.load_config()
cfg["privacy"]["send_data_values"] = True
pyds.config.save_config(cfg)

Installing extras

pip install pyds-ai[ml]          # AutoML: scikit-learn (+ joblib, shap)
pip install pyds-ai[rag]         # RAG: pdf/docx/html parsing
pip install pyds-ai[rag-chroma]  # persistent vector store (Chroma)
pip install pyds-ai[rag-faiss]   # in-process ANN vector store (FAISS)
pip install pyds-ai[rag-pgvector]# Postgres + pgvector vector store
pip install pyds-ai[report]      # result.save(): .pptx, .docx, .pdf
pip install pyds-ai[anthropic]   # or [openai], [gemini] — Ollama needs no extra
pip install pyds-ai[all]

Importing a missing extra returns a friendly message with the exact pip command, never a bare ImportError. The default pyds.knowledge() vector store is a zero-dependency in-memory hashing embedder — RAG works the moment pyds-ai[rag] is installed, no embedding API call required.

Plugins

Internal teams can register a company database reader or a private model provider without forking, via entry points:

[project.entry-points."pyds.providers"]
internal = "mycompany.pyds_plugin:InternalLLM"

Anything registered under the pyds.providers group is picked up by pyds.setup(provider="internal") / pyds.config.get_llm_client() the same way the four built-in providers are.

Development

git clone <this repo> && cd pyds-ai
python -m venv .venv && .venv/Scripts/activate   # or source .venv/bin/activate
pip install -e ".[all,test]"
pytest

The test suite runs fully offline: a fake LLM client (tests/support.py) stands in for every provider, so no API key or network access is needed to validate the package.

Publishing (maintainers)

python -m pip install --upgrade build twine
python -m build            # writes dist/*.whl and dist/*.tar.gz
twine check dist/*
twine upload dist/*        # or: twine upload --repository testpypi dist/*

License

Apache-2.0 — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyds_ai-0.1.0.tar.gz (64.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyds_ai-0.1.0-py3-none-any.whl (83.4 kB view details)

Uploaded Python 3

File details

Details for the file pyds_ai-0.1.0.tar.gz.

File metadata

  • Download URL: pyds_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 64.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for pyds_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eb5ebae9a982bfedbd416347726cc48e0ac89cae15b154775e0a349be444d9c1
MD5 4b91f2a65f4eb516b0fda65bb026343f
BLAKE2b-256 b81881f1d7b10f54dcbb03cb3944919816ede519cad2a35589a14eed4e66815a

See more details on using hashes here.

File details

Details for the file pyds_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyds_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 83.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for pyds_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0604465847a747a6861f1710176b7817c22e26503e9166dba322b021d67dd40
MD5 43e73624ac927fe4b66022999885bce7
BLAKE2b-256 7bf53ff154aa315afa36d54511e346820c13ed2a3998a0b0e2d2c5d7abe00987

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page