diff --git a/docs/databases.md b/docs/databases.md index bb2c8db6..6924d34c 100644 --- a/docs/databases.md +++ b/docs/databases.md @@ -22,6 +22,12 @@ vn.run_sql = run_sql_postgres ## **Snowflake** +We have a built-in function for Snowflake, so you don't need to write your own. + +```python +vn.connect_to_snowflake(account='my-account', username='my-username', password='my-password', database='my-database') +``` + ```python import pandas as pd from snowflake.connector.pandas_tools import pd_read_sql diff --git a/docs/intro-to-vanna.md b/docs/intro-to-vanna.md index ded1c0cb..b31124b7 100644 --- a/docs/intro-to-vanna.md +++ b/docs/intro-to-vanna.md @@ -1,6 +1,6 @@ # Intro to Vanna: A Python-based AI SQL co-pilot -**TLDR**: We help data people that know Python write SQL faster using AI. [See our starter notebook here](https://github.com/vanna-ai/vanna-py/blob/main/notebooks/vn-starter.ipynb). +**TLDR**: We help data people that know Python write SQL faster using AI. [See our starter notebook here](notebooks/vn-starter.md). ## The deluge of data diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index bc4b866f..c8268444 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -22,9 +22,9 @@ marp-pre { border-radius: 30px; } -.md-nav__link { +/* .md-nav__link { font-size: 0.9rem; -} +} */ h2.doc-heading { border-top: 1px solid rgb(217, 217, 217); diff --git a/mkdocs.yml b/mkdocs.yml index 76bb3249..0cd02030 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,17 +1,21 @@ site_name: Vanna.AI Documentation nav: - - What is Vanna.AI?: index.md - - Intro to Vanna: intro-to-vanna.md - - Use with Streamlit: streamlit.md + - Intro: + - What is Vanna.AI?: index.md + - Intro to Vanna: intro-to-vanna.md + - How Vanna Works: + - Onboarding: onboarding.md + - Adding Vanna to your Workflow: workflow.md - Use in Notebooks: - Getting Started: notebooks/vn-starter.md - Training Vanna: notebooks/vn-training.md - Full Functionality: notebooks/vn-full.md - - Use with your Database: databases.md - - Onboarding: onboarding.md - - Code to Get Started: notebooks/vn-starter.md - - Adding Vanna to your Workflow: workflow.md - - Code Reference: reference.md + - Other Ways to Use Vanna: + - Use with Streamlit: streamlit.md + - Databases: + - Use with your Database: databases.md + - Advanced: + - Code Reference: reference.md - Support: support.md repo_url: https://github.com/vanna-ai/vanna-py theme: @@ -22,6 +26,8 @@ theme: name: material palette: scheme: slate + features: + - navigation.sections extra_css: - stylesheets/extra.css extra: diff --git a/src/vanna/__init__.py b/src/vanna/__init__.py index e9b30b18..9c4e9881 100644 --- a/src/vanna/__init__.py +++ b/src/vanna/__init__.py @@ -1,6 +1,24 @@ r''' -# What is Vanna.AI? -Vanna.AI is a platform that allows you to ask questions about your data in plain English. It is an AI-powered data analyst that can answer questions about your data, generate SQL, and create visualizations. +# Basic Usage + +## Getting an API key +```python +import vanna as vn +api_key = vn.get_api_key('my-email@example.com') +vn.set_api_key(api_key) +``` + +## Setting the dataset +```python +vn.set_dataset('demo-tpc-h') +``` + +## Asking a question +```python +sql, df, fig = vn.ask(question='What are the top 10 customers by sales?') +``` + +For a more comprehensive starting guide see the [Starter Notebook](/notebooks/vn-starter/). # Nomenclature @@ -8,11 +26,11 @@ | --- | --- | --- | | `vn.set_` | Sets the variable for the current session | [`vn.set_dataset(...)`][vanna.set_dataset]
[`vn.set_api_key(...)`][vanna.set_api_key] | | `vn.get_` | Performs a read-only operation | [`vn.get_dataset()`][vanna.get_datasets] | -| `vn.add_` | Adds something to the dataset | | +| `vn.add_` | Adds something to the dataset | [`vn.add_sql(...)`][vanna.add_sql]
[`vn.add_ddl(...)`][vanna.add_ddl] | | `vn.generate_` | Generates something using AI based on the information in the dataset | [`vn.generate_sql(...)`][vanna.generate_sql]
[`vn.generate_explanation()`][vanna.generate_explanation] | | `vn.run_` | Runs code (SQL or Plotly) | [`vn.run_sql`][vanna.run_sql] | -| `vn.remove_` | Removes something from the dataset | | -| `vn.update_` | Updates something in the dataset | | +| `vn.remove_` | Removes something from the dataset | [`vn.remove_sql`][vanna.remove_sql] | +| `vn.update_` | Updates something in the dataset | [`vn.update_dataset_visibility(...)`][vanna.update_dataset_visibility] | | `vn.connect_` | Connects to a database | [`vn.connect_to_snowflake(...)`][vanna.connect_to_snowflake] | # API Reference @@ -256,11 +274,11 @@ def add_user_to_dataset(dataset: str, email: str, is_admin: bool) -> bool: return status.success -def set_dataset_visibility(public: bool) -> bool: +def update_dataset_visibility(public: bool) -> bool: """ **Example:** ```python - vn.set_dataset_visibility(public=True) + vn.update_dataset_visibility(public=True) ``` Set the visibility of the current dataset. If a dataset is visible, anyone can see it. If it is not visible, only members of the dataset can see it.