Handles reading queries and writing GarfReport from garf-core package
Project description
garf-io - Writing GarfReport to anywhere
garf-io handles reading queries and writing GarfReport to various local/remote storages.
Currently it supports writing data to the following destination:
| identifier | Writer | Options |
|---|---|---|
console |
ConsoleWriter | page-size=10,format=table|json|jsonl |
csv |
CsvWriter | destination-folder |
json |
JsonWriter | destination-folder,format=json|jsonl |
bq |
BigQueryWriter | project, dataset, location, write-disposition |
sqldb |
SqlAlchemyWriter | connection-string, if-exists=fail|replace|append |
sheets |
SheetsWriter | share-with, credentials-file, spreadsheet-url, is_append=True|False |
Each of writer also support two options for dealing with arrays:
WRITER.array-handling- arrays handling method: "strings" (default) - store arrays as strings (items combined via a separator, e.g. "item1|item2"), "arrays" - store arrays as arrays.WRITER.array-separator- a separator symbol for joining arrays as strings, by default '|'.
Installation
pip install garf-io
By default garf-io has only support for console, csv and json writers.
To install all writers use the following command pip install garf-io[all].
To install specific writers use:
pip install garf-io[bq]for BigQuery supportpip install garf-io[sheets]for Google spreadsheets supportpip install garf-io[sqlalchemy]for SqlAlchemy support
Usage
import garf_core import report
from garf_io import writer
# Create example report
sample_report = report.GarfReport(results=[[1]], column_names=['one'])
# Initialize CSV writer
concrete_writer = writer.create_writer('csv', destination_folder='/tmp/')
# Write data to /tmp/sample.csv
concrete_writer.write(sample_report, 'sample')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file garf_io-0.0.7.tar.gz.
File metadata
- Download URL: garf_io-0.0.7.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98981d6fa97c1973b6855afc02190ba39c6e02219d38930229dc281ca7bddff4
|
|
| MD5 |
ba1268eb8c2764c0e0f9fe786fd11966
|
|
| BLAKE2b-256 |
08a56de729b385512242b015eecc77e4eabaa73da0e5b73e177a5df4db3ca00f
|
File details
Details for the file garf_io-0.0.7-py3-none-any.whl.
File metadata
- Download URL: garf_io-0.0.7-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3eb5de30c6cc0803299682dd61f20a59fd34677c4ebda56ba1e0676406bb16be
|
|
| MD5 |
9d73da5947a9668e99fd4d68681f79bf
|
|
| BLAKE2b-256 |
df506b3112047463e841c7ea08511809717fe6b0b2d76674447b726e0f8637ef
|