bq-loader-0.1.7
توضیحات
Interactive Command Line Interface for Google BigQuery
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | bq-loader-0.1.7 |
| نام | bq-loader |
| نسخه کتابخانه | 0.1.7 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Nick Haupka |
| ایمیل نویسنده | nick.haupka@gmail.com |
| آدرس صفحه اصلی | https://github.com/naustica/bq_loader |
| آدرس اینترنتی | https://pypi.org/project/bq-loader/ |
| مجوز | MIT |
# bq_loader - Interactive Command Line Interface for Google BigQuery
[](https://pypi.org/project/bq_loader/)
[](https://github.com/naustica/bq_loader/blob/master/LICENSE.txt)
[](https://pypi.org/project/bq_loader/)
[](https://pypi.org/project/bq_loader/)
## Install
```bash
pip install bq_loader
```
## Authentication
This package is built on top of Google libraries. To use this package you need to authenticate with your google account. For more information see: https://cloud.google.com/storage/docs/authentication.
You can use the package [gcloud](https://pypi.org/project/gcloud/) to authenticate yourself.
```bash
gcloud auth
```
## Usage
### Command Line Interface
```bash
bqloader
```

### API
#### Create a table from a local file or directory
```python
from bq_loader import create_table_from_local
create_table_from_local(table_id='snapshot',
project_id='subugoe-collaborative',
dataset_id='resources',
file_path='test_data/*',
schema_file_path='test_schema/schema_crossref.json',
source_format='jsonl',
write_disposition='WRITE_APPEND',
table_description='Test Table generated by bq_loader',
ignore_unknown_values=True)
```
#### Create a table from a Google Bucket
```python
from bq_loader import create_table_from_bucket
create_table_from_bucket(uri='gs://bigschol/tests/*',
table_id='bq_loader_test',
project_id='subugoe-collaborative',
dataset_id='resources',
schema_file_path='test_schema/schema_crossref.json',
source_format='jsonl',
write_disposition='WRITE_EMPTY',
table_description='Test Table generated by bq_loader',
ignore_unknown_values=True)
```
#### Upload local files to a Google Bucket
```python
from bq_loader import upload_files_to_bucket
upload_files_to_bucket(bucket_name='bigschol',
file_path='test_data/*',
gcb_dir='tests')
```
نحوه نصب
نصب پکیج whl bq-loader-0.1.7:
pip install bq-loader-0.1.7.whl
نصب پکیج tar.gz bq-loader-0.1.7:
pip install bq-loader-0.1.7.tar.gz