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-1.3.1.tar.gz (19.6 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-1.3.1-py3-none-any.whl (45.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: garf_io-1.3.1.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for garf_io-1.3.1.tar.gz
Algorithm Hash digest
SHA256 79ff17bd07c81bdceeb0708c9374996c91921ebf8321f3776993b2f7955d6aa1
MD5 af1876dc97b696f3db6dad7c9be1d879
BLAKE2b-256 5c951bb7d050d0e1383f93958dec64cf8e6c7e88d5992e1d52135b69a63db725

See more details on using hashes here.

File details

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

File metadata

  • Download URL: garf_io-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 45.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for garf_io-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d88a1efe47c6ab75d732fe1a1d32f645345228393975784f91baf032323fc50
MD5 68dd1340a79b7d50f5b9d73adc92c440
BLAKE2b-256 deea208f58b634dbcd470281b7e79da3fb08c671fed96bd1b554f3bafe726299

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