bqhus-0.1.9
توضیحات
bqhus: BigQuery helper utils.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | bqhus-0.1.9 |
| نام | bqhus |
| نسخه کتابخانه | 0.1.9 |
| نگهدارنده | ['yokoe'] |
| ایمیل نگهدارنده | ['kreuz45@kreuz45.com'] |
| نویسنده | yokoe |
| ایمیل نویسنده | kreuz45@kreuz45.com |
| آدرس صفحه اصلی | https://github.com/yokoe/bqhus |
| آدرس اینترنتی | https://pypi.org/project/bqhus/ |
| مجوز | MIT |
# bqhus
[](https://codeclimate.com/github/yokoe/bqhus/maintainability)
BigQuery helper utils for Python
## How to use
### Select from table
```
import bqhus
bqhus.select("SELECT * FROM `foo.bar.purchases` LIMIT 20").as_dicts()
bqhus.select("SELECT * FROM `foo.bar.purchases` ORDER BY created_at LIMIT 1", client=bigquery.Client(project="foobar")).first_as_dict()
bqhus.select("SELECT * FROM `foo.bar.purchases` LIMIT 20").to_dataframe()
```
### Create table from query
```
bqhus.select("SELECT * FROM `some.source.table`").to_table("foo.bar.new_table")
```
### Create temp table from query
```
bqhus.select("SELECT * FROM `some.source.table`").to_table("foo.bar.new_table").expires_in(days=7)
```
### Export table to GCS as csv
```
bqhus.export_table("foo.bar.sample").as_csv(gzip=True).to_gcs("my-bucket", "exported-table.csv.gz")
```
### Generate random table name
```
bqhus.random_table_name("prefix-here")
```
## Development
### Run tests
```
docker compose run bqhus
```
نحوه نصب
نصب پکیج whl bqhus-0.1.9:
pip install bqhus-0.1.9.whl
نصب پکیج tar.gz bqhus-0.1.9:
pip install bqhus-0.1.9.tar.gz