Metadata-Version: 2.1
Name: dx
Version: 1.2.0
Summary: Python wrapper for Data Explorer
Home-page: https://app.noteable.io/
License: BSD
Keywords: data,exploration,visualization
Author: Dave Shoup
Author-email: dave.shoup@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Provides-Extra: faker
Provides-Extra: geopandas
Requires-Dist: Faker (>=14.1.0,<15.0.0); extra == "faker"
Requires-Dist: SQLAlchemy (>=1.4.40,<2.0.0)
Requires-Dist: geopandas (>=0.11.1,<0.12.0); extra == "geopandas"
Requires-Dist: ipython (>=7.31.1)
Requires-Dist: pandas (>=1.3.5,<2.0.0)
Requires-Dist: pyarrow (>=8.0.0,<9.0.0)
Requires-Dist: pydantic (>=1.9.1,<2.0.0)
Requires-Dist: structlog (>=22.1.0,<23.0.0)
Project-URL: Repository, https://github.com/noteable-io/dx
Description-Content-Type: text/markdown

A Pythonic Data Explorer.

# Install

For Python 3.8+:
```
pip install dx>=1.0.3
```

# Usage

The `dx` library currently enables DEX media type visualization of pandas `DataFrames` in two ways:
- individual calls to `dx.display()`
- updating the current IPython display formatter for a session

## Importing
```python
import dx
```

## With `dx.display()`
`dx.display()` will display a single dataset using the DEX media type. It currently supports:
- pandas `DataFrame` objects
  ```python
  import pandas as pd
  import random

  df = pd.DataFrame({
      'random_ints': [random.randint(0, 100) for _ in range(500)],
      'random_floats': [random.random() for _ in range(500)],
  })
  dx.display(df)
  ```
  ![](docs/dx_display_sample1.png)

- tabular data as `dict` or `list` types
  ```python
  dx.display([
    [1, 5, 10, 20, 500],
    [1, 2, 3, 4, 5],
    [0, 0, 0, 0, 1]
  ])
  ```
  ![](docs/dx_display_sample2.png)

- `.csv` or `.json` filepaths 

  ![](docs/dx_display_sample3.png)

## With `dx.register()` and `dx.deregister()`
`dx` will update the current `IPython` display formatters to allow DEX media type visualization of pandas `DataFrame` objects for an entire notebook / kernel session instead of the default `DataFrame` display output.
> Note: this **only** affects pandas DataFrames; it does not affect the display of `.csv`/`.json` file data, or `dict`/`list` outputs

- `dx.register()`
  
  ```python
  import pandas as pd

  # enable DEX display outputs from now on
  dx.register()

  df = pd.read_csv("examples/sample_data.csv")
  df
  ```
  ```python
  df2 = pd.DataFrame(
      [
          [1, 5, 10, 20, 500],
          [1, 2, 3, np.nan, 5],
          [0, 0, 0, np.nan, 1]
      ],
      columns=['a', 'b', 'c', 'd', 'e']
  )
  df2
  ```
  ![](docs/dx_register_sample1.png)

- `dx.deregister()`
  
  ```python
  df2 = pd.DataFrame(
      [
          [1, 5, 10, 20, 500],
          [1, 2, 3, np.nan, 5],
          [0, 0, 0, np.nan, 1]
      ],
      columns=['a', 'b', 'c', 'd', 'e']
  )
  df2
  ```
  ```python
  dx.deregister()
  df2
  ```
  ![](docs/dx_deregister_sample1.png)


# Develop

```
git clone https://github.com/noteable-io/dx
cd ./dx
pip install -e .
```


# Code of Conduct

We follow the noteable.io code of conduct.

# LICENSE

See [LICENSE.md](LICENSE.md).
