Metadata-Version: 2.4
Name: polydata-client
Version: 0.1.0
Summary: Official Python client for Polydata API
Author-email: Polydata <support@polydata.co>
Maintainer-email: Polydata <support@polydata.co>
License-Expression: Apache-2.0
Project-URL: Homepage, https://polydata.co
Project-URL: Documentation, https://docs.polydata.co/
Keywords: polydata,api,client,data,data-apps,data-viz
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: requests>=2.31.0
Requires-Dist: pandas>=1.5.0
Dynamic: license-file

# Polydata Python Client

Official Python client for the [Polydata](https://polydata.co) API.

## Installation

```bash
pip install polydata-client
```

## Quick Start

```python
from polydata import PolydataClient

# Initialize client with your API key
client = PolydataClient(api_key="pd_sk_your_api_key_here")

# Test connection
client.test_connection()

# Get data from a view
df = client.get_data_view(
    hub_schema="my_hub",
    view_name="my_view"
)
```

## Authentication

Get your API key from your Polydata dashboard. You can pass it directly or set it as an environment variable:

```bash
export POLYDATA_API_KEY="pd_sk_your_api_key_here"
```

```python
import os
from polydata import PolydataClient

client = PolydataClient(api_key=os.getenv("POLYDATA_API_KEY"))
```

## Core Features

### Get Data

Retrieve data from a view as a pandas DataFrame:

```python
df = client.get_data_view(
    hub_schema="my_hub",
    view_name="my_view"
)
```

### Upload Data

Upload CSV data to create or update tables:

```python
client.upload_data_source(
    file_path="data.csv",
    hub_schema="my_hub",
    table_name="my_table",
    schema_path="schema.json",
    type="create"  # or "replace" or "append"
)
```

### Manage Views

```python
# List all views
views = client.list_data_views(hub_schema="my_hub")
```

## Additional Features

The client also supports:

- Data apps, pages, components, and widgets
- Tickers for real-time displays
- Custom API endpoints
- Batch uploads for large files

## Requirements

- Python >= 3.8
- requests >= 2.31.0
- pandas >= 1.5.0

## Links

- [Homepage](https://polydata.co)
- [Documentation](https://docs.polydata.co)

## License

Apache License 2.0
