> For the complete documentation index, see [llms.txt](https://docs.redivis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redivis.com/api/client-libraries/redivis-python/reference/redivis.md).

# redivis

## *module* <mark style="color:purple;">Redivis</mark>

The redivis module, available via `import redivis`. Through this module and its methods, you can create, update, delete, query, and read from various resources on Redivis.

## Attributes

| **`__version__`** | The current version of this library |
| ----------------- | ----------------------------------- |

## Methods

<table data-header-hidden><thead><tr><th width="441"></th><th></th></tr></thead><tbody><tr><td><a href="/pages/cp2i7VzuMRQA9w6fM8JU"><strong><code>redivis.current_notebook</code></strong></a>()</td><td>Construct a reference to the current notebook. Can only be called within a Redivis notebook.</td></tr><tr><td><a href="/pages/HIckckTXLxTiQzPmfWDH"><strong><code>redivis.current_user</code></strong></a>()</td><td>Construct a reference to the currently authenticated user.</td></tr><tr><td><a href="/pages/cp2i7VzuMRQA9w6fM8JU"><strong><code>redivis.current_workflow</code></strong></a>()</td><td>Construct a reference to the current workflow. Can only be called within a Redivis notebook, or if a <a href="/pages/-Ma_x8sDD20E-u1Y_WVz#environment-variables">default workflow is set</a>.</td></tr><tr><td><a href="/pages/cp2i7VzuMRQA9w6fM8JU"><strong><code>redivis.datasource</code></strong></a>(source)</td><td>Construct a new <a href="/pages/Siz0WZyaUCSGe8Dh6GaI">Datasource</a> instance. Can only be called if a <a href="/pages/-Ma_x8sDD20E-u1Y_WVz#environment-variables">default workflow is set</a>. Otherwise, use the <a href="/pages/bcpCwD9uRgWqMXcMQbR7">workflow.datasource()</a> constructor.</td></tr><tr><td><a href="/pages/RUZ19P1jqZNr6fi9fJjG"><strong><code>redivis.make_api_request</code></strong></a>(*, [method, path, ...])</td><td>Call the Redivis API directly (for advanced use cases).</td></tr><tr><td><a href="/pages/ymmdCHOkJE3I849oNpLZ"><strong><code>redivis.notebook</code></strong></a>(name)</td><td>Construct a new <a href="/pages/ay3X6NBL4G2H5erdYcBw">Notebook</a> instance.</td></tr><tr><td><a href="/pages/oWNWOjcYUWbpU6l2Z4HX"><strong><code>redivis.organization</code></strong></a>(name)</td><td>Construct a new <a href="/pages/xeRmFVDPv0KZXTZKjxxt">Organization</a> instance.</td></tr><tr><td><a href="/pages/au1rEr3KTONitS4LA2yN"><strong><code>redivis.parameter</code></strong></a>(name)</td><td>Construct a new <a href="/pages/h4bb6BP3i2utmUgZNPYA">Parameter</a> instance</td></tr><tr><td><a href="/pages/mV3ou8rQ0tNBYphLkvhj"><strong><code>redivis.query</code></strong></a>(query)</td><td>Execute a SQL query, returning a <a href="/pages/TtmygEgZRWYA0BwuyxIp">Query</a> instance.</td></tr><tr><td><a href="/pages/oYiRk7mmoiqHoC8WySTB"><strong><code>redivis.table</code></strong></a>(name)</td><td>Construct a new <a href="/pages/RTo6J5q5TcwH3Rn34708">Table</a> instance.</td></tr><tr><td><a href="/pages/8BSQWMX4fZsCljkVcP4X"><strong><code>redivis.transform</code></strong></a>(name)</td><td>Construct a new <a href="/pages/0wzM5YSDxSOxyubqQa72">Transform</a> instance.</td></tr><tr><td><a href="/pages/4vx3ED8fsfyXe9vRl8Cg"><strong><code>redivis.user</code></strong></a>(name)</td><td>Construct a new <a href="/pages/RGVYjXN1BoNUnNOG5CFJ">User</a> instance.</td></tr></tbody></table>

## Exceptions

All exceptions raised by Redivis will be of class `redivis.exceptions.RedivisError` . Subclasses of RedivisError can be used to handle errors around specific events. See [redivis.exceptions](/api/client-libraries/redivis-python/reference/redivis/redivis.exceptions.md) for full details.

## Examples

```python
import redivis

organization = redivis.organization("Demo")
# organization.list_datasets(), organization.dataset("Iris species"), etc...

dataset = organization.dataset("iris_species")
table = dataset.table("iris")  
# table.to_pandas_dataframe(), etc...
# In a notebook, can do redivis.table("_source_") to reference the source table

query = redivis.query("""
    SELECT * 
    FROM demo.iris_species.iris 
    WHERE SepalLengthCm > 5
""")
# query.to_pandas_dataframe(), etc...
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.redivis.com/api/client-libraries/redivis-python/reference/redivis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
