Skip to main content

Handles reading queries and writing GarfReport from garf-core package

Project description

garf-io - Writing GarfReport to anywhere

PyPI Downloads PyPI

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 support
  • pip install garf-io[sheets] for Google spreadsheets support
  • pip 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

garf_io-0.0.15.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

garf_io-0.0.15-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file garf_io-0.0.15.tar.gz.

File metadata

  • Download URL: garf_io-0.0.15.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.5

File hashes

Hashes for garf_io-0.0.15.tar.gz
Algorithm Hash digest
SHA256 40531d9d3f10a100f4f90ade05aad46ead4a1aafd2514f1fbb0cd0651dc3f34a
MD5 f753a50ea8f4410d340006b125244e1f
BLAKE2b-256 fe877a21f839616daa282b9c2c8410b9538fe894c6727451accb34f26f3a0a57

See more details on using hashes here.

File details

Details for the file garf_io-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: garf_io-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.5

File hashes

Hashes for garf_io-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 40732c28ed48e7f65344f0255fe894fab4bde0a807881928c00eef39ae00c658
MD5 5a6462f426afbdf18d9c0b27037dc3a5
BLAKE2b-256 fe07ef2b6de68e9ebeeac713ada2eb82d1454d1e2a3d800f0e0db9499b56528a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page