Module: Sheetah

Defined in:
lib/sheetah.rb,
lib/sheetah/sheet.rb,
lib/sheetah/column.rb,
lib/sheetah/headers.rb,
lib/sheetah/backends.rb,
lib/sheetah/template.rb,
lib/sheetah/attribute.rb,
lib/sheetah/messaging.rb,
lib/sheetah/types/cast.rb,
lib/sheetah/types/type.rb,
lib/sheetah/backends/csv.rb,
lib/sheetah/errors/error.rb,
lib/sheetah/backends/xlsx.rb,
lib/sheetah/row_processor.rb,
lib/sheetah/specification.rb,
lib/sheetah/attribute_types.rb,
lib/sheetah/sheet_processor.rb,
lib/sheetah/template_config.rb,
lib/sheetah/types/container.rb,
lib/sheetah/backends/wrapper.rb,
lib/sheetah/messaging/config.rb,
lib/sheetah/types/cast_chain.rb,
lib/sheetah/errors/spec_error.rb,
lib/sheetah/errors/type_error.rb,
lib/sheetah/messaging/message.rb,
lib/sheetah/row_value_builder.rb,
lib/sheetah/messaging/constants.rb,
lib/sheetah/messaging/messenger.rb,
lib/sheetah/sheet/col_converter.rb,
lib/sheetah/types/scalars/email.rb,
lib/sheetah/row_processor_result.rb,
lib/sheetah/types/scalars/boolsy.rb,
lib/sheetah/types/scalars/scalar.rb,
lib/sheetah/types/scalars/string.rb,
lib/sheetah/utils/monadic_result.rb,
lib/sheetah/attribute_types/value.rb,
lib/sheetah/messaging/validations.rb,
lib/sheetah/attribute_types/scalar.rb,
lib/sheetah/sheet_processor_result.rb,
lib/sheetah/types/composites/array.rb,
lib/sheetah/types/scalars/email_cast.rb,
lib/sheetah/attribute_types/composite.rb,
lib/sheetah/messaging/message_variant.rb,
lib/sheetah/messaging/validations/dsl.rb,
lib/sheetah/types/scalars/boolsy_cast.rb,
lib/sheetah/types/scalars/date_string.rb,
lib/sheetah/types/scalars/scalar_cast.rb,
lib/sheetah/utils/cell_string_cleaner.rb,
lib/sheetah/types/composites/composite.rb,
lib/sheetah/messaging/validations/mixins.rb,
lib/sheetah/messaging/messages/must_exist.rb,
lib/sheetah/messaging/messages/sheet_error.rb,
lib/sheetah/types/composites/array_compact.rb,
lib/sheetah/types/scalars/date_string_cast.rb,
lib/sheetah/messaging/messages/must_be_date.rb,
lib/sheetah/messaging/messages/must_be_array.rb,
lib/sheetah/messaging/messages/must_be_email.rb,
lib/sheetah/messaging/messages/cleaned_string.rb,
lib/sheetah/messaging/messages/invalid_header.rb,
lib/sheetah/messaging/messages/missing_column.rb,
lib/sheetah/messaging/messages/must_be_boolsy.rb,
lib/sheetah/messaging/messages/must_be_string.rb,
lib/sheetah/messaging/messages/duplicated_header.rb,
lib/sheetah/messaging/validations/base_validator.rb,
lib/sheetah/messaging/validations/invalid_message.rb

Overview

Sheetah is a library designed to process tabular data according to a developer-defined structure. It will turn each row into a object whose keys and types are specified by the structure.

It can work with tabular data presented in different formats by delegating the parsing of documents to specialized backends (Backends::Xlsx, Backends::Csv, etc…).

Given a tabular document and a specification of the document structure, Sheetah may process the document by handling the following tasks:

  • validation of the document’s actual structure

  • arbitrary complex typecasting of each row into a validated object, according to the document specification

  • fine-grained error handling (at the sheet/row/col/cell level)

  • all of the above done so that internationalization of messages is easy

Sheetah is designed with memory efficiency in mind by processing documents one row at a time, thus not requiring parsing and loading the whole document in memory upfront (depending on the backend). The memory consumption of the library should therefore theoretically stay stable during the processing of a document, disregarding how many rows it may have.

Defined Under Namespace

Modules: AttributeType, AttributeTypes, Backends, Errors, Messaging, Sheet, Types, Utils Classes: Attribute, Column, Headers, RowProcessor, RowProcessorResult, RowValueBuilder, SheetProcessor, SheetProcessorResult, Specification, Template, TemplateConfig