Name | pystarburst JSON |
Version |
0.6.3
JSON |
| download |
home_page | https://starburst.io |
Summary | PyStarburst DataFrame API allows you to query and transform data in Starburst products in a data pipeline without having to download the data locally. |
upload_time | 2023-11-09 15:38:41 |
maintainer | |
docs_url | None |
author | Starburst Data |
requires_python | >=3.9,<4.0 |
license | Apache-2.0 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# PyStarburst DataFrame API
PyStarburst DataFrame API allows you to query and transform data in Starburst products in a data pipeline without having to download the data locally.
## Documentation
See the PyStarburst API [documentation](https://pystarburst.eng.starburstdata.net/) and the examples [repository](https://github.com/starburstdata/pystarburst-examples).
## Getting started
Install pystarburst
```bash
pip install pystarburst
```
### Connect to a Starburst server
The parameters are the same connect parameters as in Trino Python Client.
```python
from pystarburst import Session
connection_parameters = {
"host": "localhost",
"port": 8080,
"user": "admin",
"catalog": "tpch",
"schema": "tiny"
}
session = Session.builder.configs(connection_parameters).create()
```
### Using SQL
```python
from pystarburst import Session
session = Session.builder.configs({ ... }).create()
session.sql("SELECT 1 as a").show()
```
### Querying a table
```python
from pystarburst import Session
session = Session.builder.configs({ ... }).create()
df = session.table("nation")
print(df.schema)
df.show()
```
### Filtering a data frame
```python
from pystarburst import Session
session = Session.builder.configs({ ... }).create()
df = session.table("nation")
df.filter(df.col("regionkey") == 0).show()
```
### Joining data frames
```python
from pystarburst import Session
session = Session.builder.configs({ ... }).create()
df = session.table("nation")
df.filter(df.col("regionkey") == 0).show()
```
### Aggregation
```python
from pystarburst import Session
from pystarburst.functions import col
session = Session.builder.configs({ ... }).create()
df = session.table("nation")
df.agg((col("regionkey"), "max"), (col("regionkey"), "avg")).show()
```
Raw data
{
"_id": null,
"home_page": "https://starburst.io",
"name": "pystarburst",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Starburst Data",
"author_email": "info@starburstdata.com",
"download_url": "",
"platform": null,
"description": "# PyStarburst DataFrame API\n\nPyStarburst DataFrame API allows you to query and transform data in Starburst products in a data pipeline without having to download the data locally.\n\n## Documentation\n\nSee the PyStarburst API [documentation](https://pystarburst.eng.starburstdata.net/) and the examples [repository](https://github.com/starburstdata/pystarburst-examples).\n\n## Getting started\n\nInstall pystarburst\n\n```bash\npip install pystarburst\n```\n\n### Connect to a Starburst server\n\nThe parameters are the same connect parameters as in Trino Python Client.\n\n```python\nfrom pystarburst import Session\n\nconnection_parameters = {\n \"host\": \"localhost\",\n \"port\": 8080,\n \"user\": \"admin\",\n \"catalog\": \"tpch\",\n \"schema\": \"tiny\"\n}\n\nsession = Session.builder.configs(connection_parameters).create()\n```\n\n### Using SQL\n\n```python\nfrom pystarburst import Session\n\nsession = Session.builder.configs({ ... }).create()\n\nsession.sql(\"SELECT 1 as a\").show()\n```\n\n### Querying a table\n\n```python\nfrom pystarburst import Session\n\nsession = Session.builder.configs({ ... }).create()\n\ndf = session.table(\"nation\")\nprint(df.schema)\ndf.show()\n\n```\n\n### Filtering a data frame\n\n```python\nfrom pystarburst import Session\n\nsession = Session.builder.configs({ ... }).create()\n\ndf = session.table(\"nation\")\ndf.filter(df.col(\"regionkey\") == 0).show()\n```\n\n### Joining data frames\n\n```python\nfrom pystarburst import Session\n\nsession = Session.builder.configs({ ... }).create()\n\ndf = session.table(\"nation\")\ndf.filter(df.col(\"regionkey\") == 0).show()\n```\n\n### Aggregation\n\n```python\nfrom pystarburst import Session\nfrom pystarburst.functions import col\n\nsession = Session.builder.configs({ ... }).create()\ndf = session.table(\"nation\")\ndf.agg((col(\"regionkey\"), \"max\"), (col(\"regionkey\"), \"avg\")).show()\n```\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "PyStarburst DataFrame API allows you to query and transform data in Starburst products in a data pipeline without having to download the data locally.",
"version": "0.6.3",
"project_urls": {
"Homepage": "https://starburst.io",
"Repository": "https://github.com/starburstdata/pystarburst-examples"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "90b91e662dc72307ffa9ad1895c9e3b97b89438198aabde82eedfefabb833914",
"md5": "30dc3141004308b6f164caad50e144c6",
"sha256": "10636fb2cb03ad2ceb2dcfd1399cb581e8f6e4202fb8539b737e75836450c9df"
},
"downloads": -1,
"filename": "pystarburst-0.6.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "30dc3141004308b6f164caad50e144c6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 126419,
"upload_time": "2023-11-09T15:38:41",
"upload_time_iso_8601": "2023-11-09T15:38:41.643982Z",
"url": "https://files.pythonhosted.org/packages/90/b9/1e662dc72307ffa9ad1895c9e3b97b89438198aabde82eedfefabb833914/pystarburst-0.6.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-09 15:38:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "starburstdata",
"github_project": "pystarburst-examples",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pystarburst"
}