API Reference
#
ApiServerAPI server implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.server import ApiParser |
#
BigqueryDialectBigquery dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.bigquery import BigqueryDialect |
Arguments:
descriptor?
str|dict - descriptorproject
str - projectdataset?
str - datasettable?
str - table
Raises:
FrictionlessException
- raise any error that occurs during the process
#
BigqueryParserBigquery parser implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.bigquery import BigqueryParser |
#
BigqueryPluginPlugin for BigQuery
API | Usage |
---|---|
Public | from frictionless.plugins.bigquery import BigqueryPlugin |
#
BigqueryStorageBigQuery storage implementation
API | Usage |
---|---|
Public | from frictionless.plugins.bigquery import BigqueryStorage |
Arguments:
service
object - BigQueryService
objectproject
str - BigQuery project namedataset
str - BigQuery dataset nameprefix?
str - prefix for all names
#
BufferControlBuffer control representation
API | Usage |
---|---|
Public | from frictionless.plugins.buffer import BufferControl |
Arguments:
descriptor?
str|dict - descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
BufferLoaderBuffer loader implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.buffer import BufferLoader |
#
BufferPluginPlugin for Buffer Data
API | Usage |
---|---|
Public | from frictionless.plugins.local import BufferPlugin |
#
CheckCheck representation.
API | Usage |
---|---|
Public | from frictionless import Checks |
It's an interface for writing Frictionless checks.
Arguments:
descriptor?
str|dict - schema descriptor
Raises:
FrictionlessException
- raise if metadata is invalid
#
check.resourceReturns:
Resource?
- resource object available after thecheck.connect
call
#
check.connectConnect to the given resource
Arguments:
resource
Resource - data resource
#
check.validate_startCalled to validate the resource after opening
Yields:
Error
- found errors
#
check.validate_rowCalled to validate the given row (on every row)
Arguments:
row
Row - table row
Yields:
Error
- found errors
#
check.validate_endCalled to validate the resource before closing
Yields:
Error
- found errors
#
CkanDialectCkan dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.ckan import CkanDialect |
Arguments:
descriptor?
str|dict - descriptorresource?
str - resourcedataset?
str - datasetapikey?
str - apikeyfields?
array - limit ckan query to certain fieldslimit?
int - limit number of returned entriessort?
str - sort returned entries, e.g. by date descending:date desc
filters?
dict - filter data, e.g. field with value:{ "key": "value" }
Raises:
FrictionlessException
- raise any error that occurs during the process
#
CkanParserCkan parser implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.ckan import CkanParser |
#
CkanPluginPlugin for CKAN
API | Usage |
---|---|
Public | from frictionless.plugins.ckan import CkanPlugin |
#
CkanStorageCkan storage implementation
Arguments:
url
string - CKAN instance url e.g. "https://demo.ckan.org"dataset
string - dataset id in CKAN e.g. "my-dataset"apikey?
str - API key for CKAN e.g. "51912f57-a657-4caa-b2a7-0a1c16821f4b"API Usage Public from frictionless.plugins.ckan import CkanStorage
#
ControlControl representation
API | Usage |
---|---|
Public | from frictionless import Control |
Arguments:
descriptor?
str|dict - descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
CsvDialectCsv dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.csv import CsvDialect |
Arguments:
descriptor?
str|dict - descriptordelimiter?
str - csv delimiterline_terminator?
str - csv line terminatorquote_char?
str - csv quote chardouble_quote?
bool - csv double quoteescape_char?
str - csv escape charnull_sequence?
str - csv null sequenceskip_initial_space?
bool - csv skip initial spacecomment_char?
str - csv comment char
Raises:
FrictionlessException
- raise any error that occurs during the process
#
csvDialect.delimiterReturns:
str
- delimiter
#
csvDialect.line_terminatorReturns:
str
- line terminator
#
csvDialect.quote_charReturns:
str
- quote char
#
csvDialect.double_quoteReturns:
bool
- double quote
#
csvDialect.escape_charReturns:
str?
- escape char
#
csvDialect.null_sequenceReturns:
str?
- null sequence
#
csvDialect.skip_initial_spaceReturns:
bool
- if skipping initial space
#
csvDialect.comment_charReturns:
str?
- comment char
#
csvDialect.expandExpand metadata
#
csvDialect.to_pythonConver to Python's csv.Dialect
#
CsvParserCSV parser implementation.
API | Usage |
---|---|
Public | `from frictionless.plugins.csv import CsvPlugins |
#
CsvPluginPlugin for Pandas
API | Usage |
---|---|
Public | from frictionless.plugins.csv import CsvPlugin |
#
DetectorDetector representation
API | Usage |
---|---|
Public | from frictionless import Detector |
Arguments:
buffer_size?
int - The amount of bytes to be extracted as a buffer. It defaults to 10000sample_size?
int - The amount of rows to be extracted as a sample. It defaults to 100encoding_function?
func - A custom encoding function for the file.encoding_confidence?
float - Confidence value for encoding function.field_type?
str - Enforce all the inferred types to be this type. For more information, please check "Describing Data" guide.field_names?
str[] - Enforce all the inferred fields to have provided names. For more information, please check "Describing Data" guide.field_confidence?
float - A number from 0 to 1 setting the infer confidence. If 1 the data is guaranteed to be valid against the inferred schema. For more information, please check "Describing Data" guide. It defaults to 0.9field_float_numbers?
bool - Flag to indicate desired number type. By default numbers will beDecimal
; ifTrue
-float
. For more information, please check "Describing Data" guide. It defaults toFalse
field_missing_values?
str[] - String to be considered as missing values. For more information, please check "Describing Data" guide. It defaults to['']
schema_sync?
bool - Whether to sync the schema. If it sets toTrue
the provided schema will be mapped to the inferred schema. It means that, for example, you can provide a subset of fileds to be applied on top of the inferred fields or the provided schema can have different order of fields.schema_patch?
dict - A dictionary to be used as an inferred schema patch. The form of this dictionary should follow the Schema descriptor form except for thefields
property which should be a mapping with the key named after a field name and the values being a field patch. For more information, please check "Extracting Data" guide.
#
detector.buffer_sizeReturns buffer size of the detector. Default value is 10000.
Returns:
int
- detector buffer size
#
detector.buffer_sizeSets buffer size for detector.
Arguments:
value
int - detector buffer size
#
detector.sample_sizeReturns sample size of the detector. Default value is 100.
Returns:
int
- detector sample size
#
detector.sample_sizeSets sample size for detector.
Arguments:
value
int - detector sample size
#
detector.encoding_functionReturns detector custom encoding function
Returns:
any
- detector custom encoding function
#
detector.encoding_functionSets detector custom encoding function for the resource to be read.
Arguments:
value
any - detector custom encoding function
#
detector.encoding_confidenceReturns confidence value for detector encoding function.
Returns:
float
- detector encoding function confidence
#
detector.encoding_confidenceSets confidence value for detector encoding function. Default value is None.
Arguments:
value
float - detector encoding function confidence
#
detector.field_typeReturns field type of the detector. Default value is None.
Returns:
str
- detector inferred field types
#
detector.field_typeSets field type for all inferred fields by the detector.
Arguments:
value
str - detector inferred field types
#
detector.field_namesReturns inferred field names list.
Returns:
str[]
- detector inferred field names
#
detector.field_namesSets field names for all inferred fields by the detector.
Arguments:
value
str[] - detector inferred field names
#
detector.field_confidenceReturns detector inference confidence value. Default value is 0.9.
Returns:
float
- detector inference confidence value
#
detector.field_confidenceSets inference confidence value for detector. Default value is 0.9.
Arguments:
value
float - detector inference confidence value
#
detector.field_float_numbersReturns detector convert decimal to float flag value.
Returns:
bool
- detector convert decimal to float flag
#
detector.field_float_numbersSets detector convert decimal to float flag.
Arguments:
value
bool - detector convert decimal to float flag
#
detector.field_missing_valuesReturns detector fields missing values list.
Returns:
str[]
- detector fields missing values list
#
detector.field_missing_valuesSets detector fields missing values list.
Arguments:
value
str[] - detector fields missing values list
#
detector.schema_syncReturns detector schema_sync flag value.
Returns:
bool
- detector schema_sync flag value
#
detector.schema_syncSets detector schema_sync flag value. If set to true, it syncs provided schema's field order based on the header's field order.
Arguments:
value
bool - detector schema_sync flag value
#
detector.schema_patchReturns detector resource fields to change.
Returns:
Dict
- detector resource fields to change
#
detector.schema_patchSets detector resource fields to change.
Arguments:
value
Dict - detector resource fields to change
#
detector.detect_encodingDetect encoding from buffer
Arguments:
buffer
byte - byte buffer
Returns:
str
- encoding
#
detector.detect_layoutDetect layout from sample
Arguments:
sample
any[][] - data samplelayout?
Layout - data layout
Returns:
Layout
- layout
#
detector.detect_schemaDetect schema from fragment
Arguments:
fragment
any[][] - data fragmentlabels?
str[] - data labelsschema?
Schema - data schema
Returns:
Schema
- schema
#
DialectDialect representation
API | Usage |
---|---|
Public | from frictionless import Dialect |
Arguments:
descriptor?
str|dict - descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
ErrorError representation
API | Usage |
---|---|
Public | from frictionless import errors |
Arguments:
descriptor?
str|dict - error descriptornote
str - an error note
Raises:
FrictionlessException
- raise any error that occurs during the process
#
error.noteReturns:
str
- note
#
error.messageReturns:
str
- message
#
ExcelDialectExcel dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.excel import ExcelDialect |
Arguments:
descriptor?
str|dict - descriptorsheet?
int|str - number from 1 or name of an excel sheetworkbook_cache?
dict - workbook cachefill_merged_cells?
bool - whether to fill merged cellspreserve_formatting?
bool - whither to preserve formattingadjust_floating_point_error?
bool - whether to adjust floating point error
Raises:
FrictionlessException
- raise any error that occurs during the process
#
excelDialect.sheetReturns:
str|int
- sheet
#
excelDialect.workbook_cacheReturns:
dict
- workbook cache
#
excelDialect.fill_merged_cellsReturns:
bool
- fill merged cells
#
excelDialect.preserve_formattingReturns:
bool
- preserve formatting
#
excelDialect.adjust_floating_point_errorReturns:
bool
- adjust floating point error
#
excelDialect.expandExpand metadata
#
ExcelPluginPlugin for Excel
API | Usage |
---|---|
Public | from frictionless.plugins.excel import ExcelPlugin |
#
FieldField representation
API | Usage |
---|---|
Public | from frictionless import Field |
Arguments:
descriptor?
str|dict - field descriptorname?
str - field name (for machines)title?
str - field title (for humans)description?
str - field descriptiontype?
str - field type e.g.string
format?
str - field format e.g.default
missing_values?
str[] - missing valuesconstraints?
dict - constraintsrdf_type?
str - RDF typeschema?
Schema - parent schema object
Raises:
FrictionlessException
- raise any error that occurs during the process
#
field.nameReturns:
str
- name
#
field.titleReturns:
str
- title
#
field.descriptionReturns:
str
- description
#
field.description_htmlReturns:
str
- field description
#
field.description_textReturns:
str
- field description
#
field.typeReturns:
str
- type
#
field.formatReturns:
str
- format
#
field.missing_valuesReturns:
str[]
- missing values
#
field.constraintsReturns:
dict
- constraints
#
field.rdf_typeReturns:
str
- RDF Type
#
field.requiredReturns:
bool
- if field is requried
#
field.builtinReturns:
bool
- returns True is the type is not custom
#
field.schemaReturns:
Schema?
- parent schema
#
field.array_itemReturns:
dict
- field descriptor
#
field.array_item_fieldReturns:
dict
- field descriptor
#
field.true_valuesReturns:
str[]
- true values
#
field.false_valuesReturns:
str[]
- false values
#
field.bare_numberReturns:
bool
- if a bare number
#
field.float_numberReturns:
bool
- whether it's a floating point number
#
field.decimal_charReturns:
str
- decimal char
#
field.group_charReturns:
str
- group char
#
field.exampleReturns:
any
- example value
#
field.expandExpand metadata
#
field.read_cellRead cell
Arguments:
cell
any - cell
Returns:
(any, OrderedDict): processed cell and dict of notes
#
field.read_cell_convertRead cell (convert only)
Arguments:
cell
any - cell
Returns:
any/None
- processed cell or None if an error
#
field.read_cell_checksRead cell (checks only)
Returns:
OrderedDict
- dictionlary of check function by a constraint name
#
field.write_cellWrite cell
Arguments:
cell
any - cell to convertignore_missing?
bool - don't convert None values
Returns:
(any, OrderedDict): processed cell and dict of notes
#
field.write_cell_convertWrite cell (convert only)
Arguments:
cell
any - cell
Returns:
any/None
- processed cell or None if an error
#
field.write_cell_missing_valueWrite cell (missing value only)
Returns:
str
- a value to replace None cells
#
FileFile representation
#
FrictionlessExceptionMain Frictionless exception
API | Usage |
---|---|
Public | from frictionless import FrictionlessException |
Arguments:
error
Error - an underlaying error
#
frictionlessException.errorReturns:
Error
- error
#
GsheetsDialectGsheets dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.gsheets import GsheetsDialect |
Arguments:
descriptor?
str|dict - descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
gsheetsDialect.credentialsReturns:
str
- credentials
#
GsheetsParserGoogle Sheets parser implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.gsheets import GsheetsParser |
#
GsheetsPluginPlugin for Google Sheets
API | Usage |
---|---|
Public | from frictionless.plugins.gsheets import GsheetsPlugin |
#
HeaderHeader representation
API | Usage |
---|---|
Public | from frictionless import Header |
Constructor of this object is not Public API
Arguments:
labels
any[] - header row labelsfields
Field[] - table fieldsfield_positions
int[] - field positionsrow_positions
int[] - row positionsignore_case
bool - ignore case
#
header.labelsReturns:
Schema
- table labels
#
header.fieldsReturns:
Schema
- table fields
#
header.field_namesReturns:
str[]
- table field names
#
header.field_positionsReturns:
int[]
- table field positions
#
header.row_positionsReturns:
int[]
- table row positions
#
header.missingReturns:
bool
- if there is not header
#
header.errorsReturns:
Error[]
- header errors
#
header.validReturns:
bool
- if header valid
#
header.to_strReturns:
str
- a row as a CSV string
#
header.to_listConvert to a list
#
HtmlDialectHtml dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.html import HtmlDialect |
Arguments:
descriptor?
str|dict - descriptorselector?
str - HTML selector
Raises:
FrictionlessException
- raise any error that occurs during the process
#
htmlDialect.selectorReturns:
str
- selector
#
htmlDialect.expandExpand metadata
#
HtmlParserHTML parser implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.html import HtmlParser |
#
HtmlPluginPlugin for HTML
API | Usage |
---|---|
Public | from frictionless.plugins.html import HtmlPlugin |
#
InlineDialectInline dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.inline import InlineDialect |
Arguments:
descriptor?
str|dict - descriptorkeys?
str[] - a list of strings to use as data keyskeyed?
bool - whether data rows are keyed
Raises:
FrictionlessException
- raise any error that occurs during the process
#
inlineDialect.data_keysReturns:
str[]?
- keys
#
inlineDialect.keyedReturns:
bool
- keyed
#
inlineDialect.expandExpand metadata
#
InlineParserInline parser implementation.
API | Usage |
---|---|
Public | `from frictionless.plugins.inline import InlineParser |
#
InlinePluginPlugin for Inline
API | Usage |
---|---|
Public | from frictionless.plugins.inline import InlinePlugin |
#
InquiryInquiry representation.
Arguments:
descriptor?
str|dict - descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
inquiry.tasksReturns:
dict[]
- tasks
#
InquiryTaskInquiry task representation.
Arguments:
descriptor?
str|dict - descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
inquiryTask.sourceReturns:
any
- source
#
inquiryTask.typeReturns:
string?
- type
#
JsonDialectJson dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.json import JsonDialect |
Arguments:
descriptor?
str|dict - descriptorkeys?
str[] - a list of strings to use as data keyskeyed?
bool - whether data rows are keyedproperty?
str - a path within JSON to the data
Raises:
FrictionlessException
- raise any error that occurs during the process
#
jsonDialect.keysReturns:
str[]?
- keys
#
jsonDialect.keyedReturns:
bool
- keyed
#
jsonDialect.propertyReturns:
str?
- property
#
jsonDialect.expandExpand metadata
#
JsonParserJSON parser implementation.
API | Usage |
---|---|
Public | `from frictionless.plugins.json import JsonParser |
#
JsonPluginPlugin for Json
API | Usage |
---|---|
Public | from frictionless.plugins.json import JsonPlugin |
#
JsonlParserJSONL parser implementation.
API | Usage |
---|---|
Public | `from frictionless.plugins.json import JsonlParser |
#
LayoutLayout representation
API | Usage |
---|---|
Public | from frictionless import Layout |
Arguments:
descriptor?
str|dict - layout descriptorheader_rows?
int[] - row numbers to form header (list all of them not only from/to)header_join?
str - a string to be used as a joiner for multiline headerheader_case?
bool - whether to respect header case (default: True) pick_fields? ((str|int)[]): what fields to pick skip_fields? ((str|int)[]): what fields to skiplimit_fields?
int - amount of fieldsoffset_fields?
int - from what field to start pick_rows? ((str|int)[]): what rows to pick skip_rows? ((str|int)[]): what rows to skiplimit_rows?
int - amount of rowsoffset_rows?
int - from what row to start
#
layout.headerReturns:
bool
- if there is a header row
#
layout.header_rowsReturns:
int[]
- header rows
#
layout.header_joinReturns:
str
- header joiner
#
layout.header_caseReturns:
str
- header case sensitive
#
layout.pick_fieldsReturns:
(str|int)[]?
- pick fields
#
layout.skip_fieldsReturns:
(str|int)[]?
- skip fields
#
layout.limit_fieldsReturns:
int?
- limit fields
#
layout.offset_fieldsReturns:
int?
- offset fields
#
layout.pick_rowsReturns:
(str|int)[]?
- pick rows
#
layout.skip_rowsReturns:
(str|int)[]?
- skip rows
#
layout.limit_rowsReturns:
int?
- limit rows
#
layout.offset_rowsReturns:
int?
- offset rows
#
layout.is_field_filteringReturns:
bool
- whether there is a field filtering
#
layout.pick_fields_compiledReturns:
re?
- compiled pick fields
#
layout.skip_fields_compiledReturns:
re?
- compiled skip fields
#
layout.pick_rows_compiledReturns:
re?
- compiled pick rows
#
layout.skip_rows_compiledReturns:
re?
- compiled skip fields
#
layout.expandExpand metadata
#
LoaderLoader representation
API | Usage |
---|---|
Public | from frictionless import Loader |
Arguments:
resource
Resource - resource
#
loader.resourceReturns:
resource
Resource - resource
#
loader.bufferReturns:
Loader
- buffer
#
loader.byte_streamResource byte stream
The stream is available after opening the loader
Returns:
io.ByteStream
- resource byte stream
#
loader.text_streamResource text stream
The stream is available after opening the loader
Returns:
io.TextStream
- resource text stream
#
loader.openOpen the loader as "io.open" does
#
loader.closeClose the loader as "filelike.close" does
#
loader.closedWhether the loader is closed
Returns:
bool
- if closed
#
loader.read_byte_streamRead bytes stream
Returns:
io.ByteStream
- resource byte stream
#
loader.read_byte_stream_createCreate bytes stream
Returns:
io.ByteStream
- resource byte stream
#
loader.read_byte_stream_processProcess byte stream
Arguments:
byte_stream
io.ByteStream - resource byte stream
Returns:
io.ByteStream
- resource byte stream
#
loader.read_byte_stream_decompressDecompress byte stream
Arguments:
byte_stream
io.ByteStream - resource byte stream
Returns:
io.ByteStream
- resource byte stream
#
loader.read_byte_stream_bufferBuffer byte stream
Arguments:
byte_stream
io.ByteStream - resource byte stream
Returns:
bytes
- buffer
#
loader.read_byte_stream_analyzeDetect metadta using sample
Arguments:
buffer
bytes - byte buffer
#
loader.read_text_streamRead text stream
Returns:
io.TextStream
- resource text stream
#
loader.write_byte_streamWrite from a temporary file
Arguments:
path
str - path to a temporary file
Returns:
any
- result of writing e.g. resulting path
#
loader.write_byte_stream_createCreate byte stream for writing
Arguments:
path
str - path to a temporary file
Returns:
io.ByteStream
- byte stream
#
loader.write_byte_stream_saveStore byte stream
#
LocalControlLocal control representation
API | Usage |
---|---|
Public | from frictionless.plugins.local import LocalControl |
Arguments:
descriptor?
str|dict - descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
LocalLoaderLocal loader implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.local import LocalLoader |
#
LocalPluginPlugin for Local Data
API | Usage |
---|---|
Public | from frictionless.plugins.local import LocalPlugin |
#
MetadataMetadata representation
API | Usage |
---|---|
Public | from frictionless import Metadata |
Arguments:
descriptor?
str|dict - metadata descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
metadata.setinitialSet an initial item in a subclass' constructor
Arguments:
key
str - keyvalue
any - value
#
metadata.__repr__Returns string representation for metadata.
#
metadata.to_copyCreate a copy of the metadata
Returns:
Metadata
- a copy of the metadata
#
metadata.to_dictConvert metadata to a plain dict
Returns:
dict
- metadata as a plain dict
#
metadata.to_jsonSave metadata as a json
Arguments:
path
str - target path
Raises:
FrictionlessException
- on any error
#
metadata.to_yamlSave metadata as a yaml
Arguments:
path
str - target path
Raises:
FrictionlessException
- on any error
#
metadata.to_markdownConvert metadata as a markdown
This feature has been contributed to the framwork by Ethan Welty (@ezwelty):
Arguments:
path
str - target pathtable
bool - if true converts markdown to tabular format
Raises:
FrictionlessException
- on any error
#
metadata.metadata_validReturns:
bool
- whether the metadata is valid
#
metadata.metadata_errorsReturns:
Errors[]
- a list of the metadata errors
#
metadata.metadata_attachHelper method for attaching a value to the metadata
Arguments:
name
str - namevalue
any - value
#
metadata.metadata_extractHelper method called during the metadata extraction
Arguments:
descriptor
any - descriptor
#
metadata.metadata_processHelper method called on any metadata change
#
metadata.metadata_validateHelper method called on any metadata change
Arguments:
profile
dict - a profile to validate against of
#
metadata.propertyCreate a metadata property
Arguments:
func
func - methodcache?
bool - cachereset?
bool - resetwrite?
func - write
#
MultipartControlMultipart control representation
API | Usage |
---|---|
Public | from frictionless.plugins.multipart import MultipartControl |
Arguments:
descriptor?
str|dict - descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
multipartControl.expandExpand metadata
#
MultipartLoaderMultipart loader implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.multipart import MultipartLoader |
#
MultipartPluginPlugin for Multipart Data
API | Usage |
---|---|
Public | from frictionless.plugins.multipart import MultipartPlugin |
#
OdsDialectOds dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.ods import OdsDialect |
Arguments:
descriptor?
str|dict - descriptorsheet?
str - sheet
Raises:
FrictionlessException
- raise any error that occurs during the process
#
odsDialect.sheetReturns:
int|str
- sheet
#
odsDialect.expandExpand metadata
#
OdsParserODS parser implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.ods import OdsParser |
#
OdsPluginPlugin for ODS
API | Usage |
---|---|
Public | from frictionless.plugins.ods import OdsPlugin |
#
PackagePackage representation
API | Usage |
---|---|
Public | from frictionless import Package |
This class is one of the cornerstones of of Frictionless framework. It manages underlaying resource and provides an ability to describe a package.
Arguments:
source
any - Source of the package; can be in various forms. Usually, it's a package descriptor in a form of dict or path Also, it can be a glob pattern or a resource pathdescriptor
dict|str - A resource descriptor provided explicitly. Keyword arguments will patch this descriptor if provided.resources?
dict|Resource[] - A list of resource descriptors. It can be dicts or Resource instances.id?
str - A property reserved for globally unique identifiers. Examples of identifiers that are unique include UUIDs and DOIs.name?
str - A short url-usable (and preferably human-readable) name. This MUST be lower-case and contain only alphanumeric characters along with “.”, “_” or “-” characters.title?
str - A Package title according to the specs It should a human-oriented title of the resource.description?
str - A Package description according to the specs It should a human-oriented description of the resource.licenses?
dict[] - The license(s) under which the package is provided. If omitted it's considered the same as the package's licenses.sources?
dict[] - The raw sources for this data package. It MUST be an array of Source objects. Each Source object MUST have a title and MAY have path and/or email properties.profile?
str - A string identifying the profile of this descriptor. For example,fiscal-data-package
.homepage?
str - A URL for the home on the web that is related to this package. For example, github repository or ckan dataset address.version?
str - A version string identifying the version of the package. It should conform to the Semantic Versioning requirements and should follow the Data Package Version pattern.contributors?
dict[] - The people or organizations who contributed to this package. It MUST be an array. Each entry is a Contributor and MUST be an object. A Contributor MUST have a title property and MAY contain path, email, role and organization properties.keywords?
str[] - An Array of string keywords to assist users searching. For example, ['data', 'fiscal']image?
str - An image to use for this data package. For example, when showing the package in a listing.created?
str - The datetime on which this was created. The datetime must conform to the string formats for RFC3339 datetime,innerpath?
str - A ZIP datapackage descriptor inner path. Path to the package descriptor inside the ZIP datapackage.Example
- some/folder/datapackage.yamlDefault
- datapackage.jsonbasepath?
str - A basepath of the resource The fullpath of the resource is joinedbasepath
and /path`detector?
Detector - File/table detector. For more information, please check the Detector documentation.onerror?
ignore|warn|raise - Behaviour if there is an error. It defaults to 'ignore'. The default mode will ignore all errors on resource level and they should be handled by the user being available in Header and Row objects.trusted?
bool - Don't raise an exception on unsafe paths. A path provided as a part of the descriptor considered unsafe if there are path traversing or the path is absolute. A path provided assource
orpath
is alway trusted.hashing?
str - a hashing algorithm for resources It defaults to 'md5'.
Raises:
FrictionlessException
- raise any error that occurs during the process
#
package.nameReturns:
str
- package name
#
package.idReturns:
str
- package id
#
package.licensesReturns:
dict[]
- package licenses
#
package.profileReturns:
str
- package profile
#
package.titleReturns:
str
- package title
#
package.descriptionReturns:
str
- package description
#
package.description_htmlReturns:
str
- package description
#
package.description_textReturns:
str
- package description
#
package.homepageReturns:
str
- package homepage
#
package.versionReturns:
str
- package version
#
package.sourcesReturns:
dict[]
- package sources
#
package.contributorsReturns:
dict[]
- package contributors
#
package.keywordsReturns:
str[]
- package keywords
#
package.imageReturns:
str
- package image
#
package.createdReturns:
str
- package created
#
package.hashingReturns:
str
- package hashing
#
package.basepathReturns:
str
- package basepath
#
package.onerrorReturns:
ignore|warn|raise
- on error bahaviour
#
package.trustedReturns:
str
- package trusted
#
package.resourcesReturns:
Resources[]
- package resource
#
package.resource_namesReturns:
str[]
- package resource names
#
package.add_resourceAdd new resource to the package.
Arguments:
source
dict|str - a data source**options
dict - options of the Resource class
Returns:
Resource/None
- addedResource
instance orNone
if not added
#
package.get_resourceGet resource by name.
Arguments:
name
str - resource name
Raises:
FrictionlessException
- if resource is not found
Returns:
Resource/None
-Resource
instance orNone
if not found
#
package.has_resourceCheck if a resource is present
Arguments:
name
str - schema resource name
Returns:
bool
- whether there is the resource
#
package.remove_resourceRemove resource by name.
Arguments:
name
str - resource name
Raises:
FrictionlessException
- if resource is not found
Returns:
Resource/None
- removedResource
instances orNone
if not found
#
package.expandExpand metadata
It will add default values to the package.
#
package.inferInfer package's attributes
Arguments:
stats?
bool - stream files completely and infer stats
#
package.to_copyCreate a copy of the package
#
package.from_bigqueryImport package from Bigquery
Arguments:
source
string - BigQueryService
objectdialect
dict - BigQuery dialect
Returns:
Package
- package
#
package.to_bigqueryExport package to Bigquery
Arguments:
target
string - BigQueryService
objectdialect
dict - BigQuery dialect
Returns:
BigqueryStorage
- storage
#
package.from_ckanImport package from CKAN
Arguments:
source
string - CKAN instance url e.g. "https://demo.ckan.org"dialect
dict - CKAN dialect
Returns:
Package
- package
#
package.to_ckanExport package to CKAN
Arguments:
target
string - CKAN instance url e.g. "https://demo.ckan.org"dialect
dict - CKAN dialect
Returns:
CkanStorage
- storage
#
package.from_sqlImport package from SQL
Arguments:
source
any - SQL connection string of enginedialect
dict - SQL dialect
Returns:
Package
- package
#
package.to_sqlExport package to SQL
Arguments:
target
any - SQL connection string of enginedialect
dict - SQL dialect
Returns:
SqlStorage
- storage
#
package.from_zipCreate a package from ZIP
Arguments:
path(str)
- file path**options(dict)
- resouce options
#
package.to_zipSave package to a zip
Arguments:
path
str - target pathencoder_class
object - json encoder class
Raises:
FrictionlessException
- on any error
#
PandasDialectPandas dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.pandas import PandasDialect |
Arguments:
descriptor?
str|dict - descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
PandasParserPandas parser implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.pandas import PandasParser |
#
PandasPluginPlugin for Pandas
API | Usage |
---|---|
Public | from frictionless.plugins.pandas import PandasPlugin |
#
ParserParser representation
API | Usage |
---|---|
Public | from frictionless import Parser |
Arguments:
resource
Resource - resource
#
parser.resourceReturns:
Resource
- resource
#
parser.loaderReturns:
Loader
- loader
#
parser.sampleReturns:
Loader
- sample
#
parser.list_streamYields:
any[][]
- list stream
#
parser.openOpen the parser as "io.open" does
#
parser.closeClose the parser as "filelike.close" does
#
parser.closedWhether the parser is closed
Returns:
bool
- if closed
#
parser.read_loaderCreate and open loader
Returns:
Loader
- loader
#
parser.read_list_streamRead list stream
Returns:
gen<any[][]>
- list stream
#
parser.read_list_stream_createCreate list stream from loader
Arguments:
loader
Loader - loader
Returns:
gen<any[][]>
- list stream
#
parser.read_list_stream_handle_errorsWrap list stream into error handler
Arguments:
gen<any[][]>
- list stream
Returns:
gen<any[][]>
- list stream
#
parser.write_row_streamWrite row stream from the source resource
Arguments:
source
Resource - source resource
#
PipelinePipeline representation.
Arguments:
descriptor?
str|dict - pipeline descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
pipeline.tasksReturns:
dict[]
- tasks
#
pipeline.runRun the pipeline
#
PipelineTaskPipeline task representation.
Arguments:
descriptor?
str|dict - pipeline task descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
pipelineTask.runRun the task
#
PluginPlugin representation
API | Usage |
---|---|
Public | from frictionless import Plugin |
It's an interface for writing Frictionless plugins. You can implement one or more methods to hook into Frictionless system.
#
plugin.create_candidatesCreate candidates
Returns:
dict[]
- an ordered by priority list of type descriptors for type detection
#
plugin.create_checkCreate check
Arguments:
name
str - check namedescriptor
dict - check descriptor
Returns:
Check
- check
#
plugin.create_controlCreate control
Arguments:
file
File - control filedescriptor
dict - control descriptor
Returns:
Control
- control
#
plugin.create_dialectCreate dialect
Arguments:
file
File - dialect filedescriptor
dict - dialect descriptor
Returns:
Dialect
- dialect
#
plugin.create_errorCreate error
Arguments:
descriptor
dict - error descriptor
Returns:
Error
- error
#
plugin.create_fileCreate file
Arguments:
source
any - file sourceoptions
dict - file options
Returns:
File
- file
#
plugin.create_loaderCreate loader
Arguments:
file
File - loader file
Returns:
Loader
- loader
#
plugin.create_parserCreate parser
Arguments:
file
File - parser file
Returns:
Parser
- parser
#
plugin.create_serverCreate server
Arguments:
name
str - server name
Returns:
Server
- server
#
plugin.create_stepCreate step
Arguments:
descriptor
dict - step descriptor
Returns:
Step
- step
#
plugin.create_storageCreate storage
Arguments:
name
str - storage nameoptions
str - storage options
Returns:
Storage
- storage
#
plugin.create_typeCreate type
Arguments:
field
Field - corresponding field
Returns:
Type
- type
#
RemoteControlRemote control representation
API | Usage |
---|---|
Public | from frictionless.plugins.remote import RemoteControl |
Arguments:
descriptor?
str|dict - descriptorhttp_session?
requests.Session - user defined HTTP sessionhttp_preload?
bool - don't use HTTP streaming and preload all the datahttp_timeout?
int - user defined HTTP timeout in minutes
Raises:
FrictionlessException
- raise any error that occurs during the process
#
remoteControl.http_sessionReturns:
requests.Session
- HTTP session
#
remoteControl.http_preloadReturns:
bool
- if not streaming
#
remoteControl.http_timeoutReturns:
int
- HTTP timeout in minutes
#
remoteControl.expandExpand metadata
#
RemoteLoaderRemote loader implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.remote import RemoteLoader |
#
RemotePluginPlugin for Remote Data
API | Usage |
---|---|
Public | from frictionless.plugins.remote import RemotePlugin |
#
ReportReport representation.
API | Usage |
---|---|
Public | from frictionless import Report |
Arguments:
descriptor?
str|dict - report descriptortime
float - validation timeerrors
Error[] - validation errorstasks
ReportTask[] - validation tasks
Raises:
FrictionlessException
- raise any error that occurs during the process
#
report.versionReturns:
str
- frictionless version
#
report.timeReturns:
float
- validation time
#
report.validReturns:
bool
- validation result
#
report.statsReturns:
dict
- validation stats
#
report.errorsReturns:
Error[]
- validation errors
#
report.tasksReturns:
ReportTask[]
- validation tasks
#
report.taskReturns:
ReportTask
- validation task (if there is only one)
Raises:
FrictionlessException
- if there are more that 1 task
#
report.expandExpand metadata
#
report.flattenFlatten the report
Parameters spec (any[]): flatten specification
Returns:
any[]
- flatten report
#
report.from_validateValidate function wrapper
Arguments:
validate
func - validate
Returns:
func
- wrapped validate
#
ReportTaskReport task representation.
API | Usage |
---|---|
Public | from frictionless import ReportTask |
Arguments:
descriptor?
str|dict - schema descriptortime
float - validation timescope
str[] - validation scopepartial
bool - wehter validation was partialerrors
Error[] - validation errorstask
Task - validation task#
RaisesFrictionlessException
- raise any error that occurs during the process
#
reportTask.resourceReturns:
Resource
- resource
#
reportTask.timeReturns:
float
- validation time
#
reportTask.validReturns:
bool
- validation result
#
reportTask.scopeReturns:
str[]
- validation scope
#
reportTask.partialReturns:
bool
- if validation partial
#
reportTask.statsReturns:
dict
- validation stats
#
reportTask.errorsReturns:
Error[]
- validation errors
#
reportTask.errorReturns:
Error
- validation error if there is only one
Raises:
FrictionlessException
- if more than one errors
#
reportTask.expandExpand metadata
#
reportTask.flattenFlatten the report
Parameters spec (any[]): flatten specification
Returns:
any[]
- flatten task report
#
ResourceResource representation.
API | Usage |
---|---|
Public | from frictionless import Resource |
This class is one of the cornerstones of of Frictionless framework. It loads a data source, and allows you to stream its parsed contents. At the same time, it's a metadata class data description.
Arguments:
source
any - Source of the resource; can be in various forms. Usually, it's a string as<scheme>://path/to/file.<format>
. It also can be, for example, an array of data arrays/dictionaries. Or it can be a resource descriptor dict or path.descriptor
dict|str - A resource descriptor provided explicitly. Keyword arguments will patch this descriptor if provided.name?
str - A Resource name according to the specs. It should be a slugified name of the resource.title?
str - A Resource title according to the specs It should a human-oriented title of the resource.description?
str - A Resource description according to the specs It should a human-oriented description of the resource.mediatype?
str - A mediatype/mimetype of the resource e.g. “text/csv”, or “application/vnd.ms-excel”. Mediatypes are maintained by the Internet Assigned Numbers Authority (IANA) in a media type registry.licenses?
dict[] - The license(s) under which the resource is provided. If omitted it's considered the same as the package's licenses.sources?
dict[] - The raw sources for this data resource. It MUST be an array of Source objects. Each Source object MUST have a title and MAY have path and/or email properties.profile?
str - A string identifying the profile of this descriptor. For example,tabular-data-resource
.scheme?
str - Scheme for loading the file (file, http, ...). If not set, it'll be inferred fromsource
.format?
str - File source's format (csv, xls, ...). If not set, it'll be inferred fromsource
.hashing?
str - An algorithm to hash data. It defaults to 'md5'.encoding?
str - Source encoding. If not set, it'll be inferred fromsource
.innerpath?
str - A path within the compressed file. It defaults to the first file in the archive.compression?
str - Source file compression (zip, ...). If not set, it'll be inferred fromsource
.control?
dict|Control - File control. For more information, please check the Control documentation.dialect?
dict|Dialect - Table dialect. For more information, please check the Dialect documentation.layout?
dict|Layout - Table layout. For more information, please check the Layout documentation.schema?
dict|Schema - Table schema. For more information, please check the Schema documentation.stats?
dict - File/table stats. A dict with the following possible properties: hash, bytes, fields, rows.basepath?
str - A basepath of the resource The fullpath of the resource is joinedbasepath
and /path`detector?
Detector - File/table detector. For more information, please check the Detector documentation.onerror?
ignore|warn|raise - Behaviour if there is an error. It defaults to 'ignore'. The default mode will ignore all errors on resource level and they should be handled by the user being available in Header and Row objects.trusted?
bool - Don't raise an exception on unsafe paths. A path provided as a part of the descriptor considered unsafe if there are path traversing or the path is absolute. A path provided assource
orpath
is alway trusted.package?
Package - A owning this resource package. It's actual if the resource is part of some data package.
Raises:
FrictionlessException
- raise any error that occurs during the process
#
resource.nameReturns str: resource name
#
resource.titleReturns str: resource title
#
resource.descriptionReturns str: resource description
#
resource.description_htmlReturns:
str?
- resource description
#
resource.description_textReturns:
str
- resource description
#
resource.mediatypeReturns str: resource mediatype
#
resource.licensesReturns dict[]: resource licenses
#
resource.sourcesReturns dict[]: resource sources
#
resource.profileReturns str: resource profile
#
resource.pathReturns str: resource path
#
resource.dataReturns any[][]?: resource data
#
resource.schemeReturns str: resource scheme
#
resource.formatReturns str: resource format
#
resource.hashingReturns str: resource hashing
#
resource.encodingReturns str: resource encoding
#
resource.innerpathReturns str: resource compression path
#
resource.compressionReturns str: resource compression
#
resource.controlReturns Control: resource control
#
resource.dialectReturns Dialect: resource dialect
#
resource.layoutReturns:
Layout
- table layout
#
resource.schemaReturns Schema: resource schema
#
resource.statsReturns dict: resource stats
#
resource.bufferFile's bytes used as a sample
These buffer bytes are used to infer characteristics of the source file (e.g. encoding, ...).
Returns:
bytes?
- file buffer
#
resource.sampleTable's lists used as sample.
These sample rows are used to infer characteristics of the source file (e.g. schema, ...).
Returns:
list[]?
- table sample
#
resource.labelsReturns:
str[]?
- table labels
#
resource.fragmentTable's lists used as fragment.
These fragment rows are used internally to infer characteristics of the source file (e.g. schema, ...).
Returns:
list[]?
- table fragment
#
resource.headerReturns:
str[]?
- table header
#
resource.basepathReturns str: resource basepath
#
resource.fullpathReturns str: resource fullpath
#
resource.detectorReturns str: resource detector
#
resource.onerrorReturns:
ignore|warn|raise
- on error bahaviour
#
resource.trustedReturns:
bool
- don't raise an exception on unsafe paths
#
resource.packageReturns:
Package?
- parent package
#
resource.tabularReturns bool: if resource is tabular
#
resource.byte_streamByte stream in form of a generator
Yields:
gen<bytes>?
- byte stream
#
resource.text_streamText stream in form of a generator
Yields:
gen<str[]>?
- text stream
#
resource.list_streamList stream in form of a generator
Yields:
gen<any[][]>?
- list stream
#
resource.row_streamRow stream in form of a generator of Row objects
Yields:
gen<Row[]>?
- row stream
#
resource.expandExpand metadata
#
resource.inferInfer metadata
Arguments:
stats?
bool - stream file completely and infer stats
#
resource.openOpen the resource as "io.open" does
Raises:
FrictionlessException
- any exception that occurs
#
resource.closeClose the table as "filelike.close" does
#
resource.closedWhether the table is closed
Returns:
bool
- if closed
#
resource.read_bytesRead bytes into memory
Returns:
any[][]
- resource bytes
#
resource.read_textRead text into memory
Returns:
str
- resource text
#
resource.read_dataRead data into memory
Returns:
any
- resource data
#
resource.read_listsRead lists into memory
Returns:
any[][]
- table lists
#
resource.read_rowsRead rows into memory
Returns:
Row[]
- table rows
#
resource.writeWrite this resource to the target resource
Arguments:
target
any|Resource - target or target resource instance**options
dict - Resource constructor options
#
resource.to_dictCreate a dict from the resource
Returns dict: dict representation
#
resource.to_copyCreate a copy from the resource
Returns Resource: resource copy
#
resource.to_viewCreate a view from the resource
See PETL's docs for more information: https://petl.readthedocs.io/en/stable/util.html#visualising-tables
Arguments:
type
look|lookall|see|display|displayall - view's type**options
dict - options to be passed to PETLReturns
str
- resource's view
#
resource.to_snapCreate a snapshot from the resource
Arguments:
json
bool - make data types compatible with JSON formatReturns
list
- resource's data
#
resource.to_inlineHelper to export resource as an inline data
#
resource.to_pandasHelper to export resource as an Pandas dataframe
#
resource.from_petlCreate a resource from PETL view
#
resource.to_petlExport resource as a PETL table
#
RowRow representation
API | Usage |
---|---|
Public | from frictionless import Row |
Constructor of this object is not Public API
This object is returned by extract
, resource.read_rows
, and other functions.
Arguments:
cells
any[] - array of cellsfield_info
dict - special field info structurerow_position
int - row position from 1row_number
int - row number from 1
#
row.cellsReturns:
Field[]
- table schema fields
#
row.fieldsReturns:
Field[]
- table schema fields
#
row.field_namesReturns:
Schema
- table schema
#
row.field_positionsReturns:
int[]
- table field positions
#
row.row_positionReturns:
int
- row position from 1
#
row.row_numberReturns:
int
- row number from 1
#
row.blank_cellsA mapping indexed by a field name with blank cells before parsing
Returns:
dict
- row blank cells
#
row.error_cellsA mapping indexed by a field name with error cells before parsing
Returns:
dict
- row error cells
#
row.errorsReturns:
Error[]
- row errors
#
row.validReturns:
bool
- if row valid
#
row.to_strReturns:
str
- a row as a CSV string
#
row.to_listArguments:
json
bool - make data types compatible with JSON formattypes
str[] - list of supported types
Returns:
dict
- a row as a list
#
row.to_dictArguments:
json
bool - make data types compatible with JSON format
Returns:
dict
- a row as a dictionary
#
S3ControlS3 control representation
API | Usage |
---|---|
Public | from frictionless.plugins.s3 import S3Control |
Arguments:
descriptor?
str|dict - descriptorendpoint_url?
string - endpoint url
Raises:
FrictionlessException
- raise any error that occurs during the process
#
s3Control.expandExpand metadata
#
S3LoaderS3 loader implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.s3 import S3Loader |
#
S3PluginPlugin for S3
API | Usage |
---|---|
Public | from frictionless.plugins.s3 import S3Plugin |
#
SchemaSchema representation
API | Usage |
---|---|
Public | from frictionless import Schema |
This class is one of the cornerstones of of Frictionless framework. It allow to work with Table Schema and its fields.
Arguments:
descriptor?
str|dict - schema descriptorfields?
dict[] - list of field descriptorsmissing_values?
str[] - missing valuesprimary_key?
str[] - primary keyforeign_keys?
dict[] - foreign keys
Raises:
FrictionlessException
- raise any error that occurs during the process
#
schema.missing_valuesReturns:
str[]
- missing values
#
schema.primary_keyReturns:
str[]
- primary key field names
#
schema.foreign_keysReturns:
dict[]
- foreign keys
#
schema.fieldsReturns:
Field[]
- an array of field instances
#
schema.field_namesReturns:
str[]
- an array of field names
#
schema.add_fieldAdd new field to the package.
Arguments:
source
dict|str - a field source**options
dict - options of the Field class
Returns:
Resource/None
- addedResource
instance orNone
if not added
#
schema.get_fieldGet schema's field by name.
Arguments:
name
str - schema field name
Raises:
FrictionlessException
- if field is not found
Returns:
Field
-Field
instance orNone
if not found
#
schema.has_fieldCheck if a field is present
Arguments:
name
str - schema field name
Returns:
bool
- whether there is the field
#
schema.remove_fieldRemove field by name.
The schema descriptor will be validated after field descriptor removal.
Arguments:
name
str - schema field name
Raises:
FrictionlessException
- if field is not found
Returns:
Field/None
- removedField
instances orNone
if not found
#
schema.expandExpand the schema
#
schema.read_cellsRead a list of cells (normalize/cast)
Arguments:
cells
any[] - list of cells
Returns:
any[]
- list of processed cells
#
schema.write_cellsWrite a list of cells (normalize/uncast)
Arguments:
cells
any[] - list of cells
Returns:
any[]
- list of processed cells
#
schema.from_jsonschemaCreate a Schema from JSONSchema profile
Arguments:
profile
str|dict - path or dict with JSONSchema profile
Returns:
Schema
- schema instance
#
schema.to_excel_templateExport schema as an excel template
Arguments:
path
- path of excel file to create with ".xlsx" extension
Returns:
any
- excel template
#
ServerServer representation
API | Usage |
---|---|
Public | from frictionless import Schema |
#
server.startStart the server
Arguments:
port
int - HTTP port
#
server.stopStop the server
#
ServerPluginPlugin for Server
API | Usage |
---|---|
Public | from frictionless.plugins.server import ServerPlugin |
#
SpssDialectSpss dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.spss import SpssDialect |
Arguments:
descriptor?
str|dict - descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
SpssParserSpss parser implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.spss import SpssParser |
#
SpssPluginPlugin for SPSS
API | Usage |
---|---|
Public | from frictionless.plugins.spss import SpssPlugin |
#
SqlDialectSQL dialect representation
API | Usage |
---|---|
Public | from frictionless.plugins.sql import SqlDialect |
Arguments:
descriptor?
str|dict - descriptortable
str - table nameprefix
str - prefix for all table namesorder_by?
str - order_by statement passed to SQLwhere?
str - where statement passed to SQLnamespace?
str - SQL schemabasepath?
str - a basepath, for example, for SQLite path
Raises:
FrictionlessException
- raise any error that occurs during the process
#
SqlParserSQL parser implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.sql import SqlParser |
#
SqlPluginPlugin for SQL
API | Usage |
---|---|
Public | from frictionless.plugins.sql import SqlPlugin |
#
SqlStorageSQL storage implementation
API | Usage |
---|---|
Public | from frictionless.plugins.sql import SqlStorage |
Arguments:
url?
string - SQL connection stringengine?
object -sqlalchemy
engineprefix?
str - prefix for all tablesnamespace?
str - SQL scheme
#
StatusStatus representation.
Arguments:
descriptor?
str|dict - schema descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
status.versionReturns:
str
- frictionless version
#
status.timeReturns:
float
- transformation time
#
status.validReturns:
bool
- transformation result
#
status.statsReturns:
dict
- transformation stats
#
status.errorsReturns:
Error[]
- transformation errors
#
status.tasksReturns:
ReportTable[]
- transformation tasks
#
status.taskReturns:
ReportTable
- transformation task (if there is only one)
Raises:
FrictionlessException
- if there are more that 1 task
#
StatusTaskStatus Task representation
#
statusTask.timeReturns:
dict
- transformation time
#
statusTask.validReturns:
bool
- transformation result
#
statusTask.statsReturns:
dict
- transformation stats
#
statusTask.errorsReturns:
Error[]
- transformation errors
#
statusTask.targetReturns:
any
- transformation target
#
statusTask.typeReturns:
any
- transformation target
#
StepStep representation
#
step.transform_resourceTransform resource
Arguments:
resource
Resource - resource
Returns:
resource
Resource - resource
#
step.transform_packageTransform package
Arguments:
package
Package - package
Returns:
package
Package - package
#
StreamControlStream control representation
API | Usage |
---|---|
Public | from frictionless.plugins.stream import StreamControl |
Arguments:
descriptor?
str|dict - descriptor
Raises:
FrictionlessException
- raise any error that occurs during the process
#
StreamLoaderStream loader implementation.
API | Usage |
---|---|
Public | from frictionless.plugins.stream import StreamLoader |
#
StreamPluginPlugin for Local Data
API | Usage |
---|---|
Public | from frictionless.plugins.stream import StreamPlugin |
#
SystemSystem representation
API | Usage |
---|---|
Public | from frictionless import system |
This class provides an ability to make system Frictionless calls.
It's available as frictionless.system
singletone.
#
system.registerRegister a plugin
Arguments:
name
str - plugin nameplugin
Plugin - plugin to register
#
system.deregisterDeregister a plugin
Arguments:
name
str - plugin name
#
system.create_candidatesCreate candidates
Returns:
dict[]
- an ordered by priority list of type descriptors for type detection
#
system.create_checkCreate check
Arguments:
descriptor
dict - check descriptor
Returns:
Check
- check
#
system.create_controlCreate control
Arguments:
resource
Resource - control resourcedescriptor
dict - control descriptor
Returns:
Control
- control
#
system.create_dialectCreate dialect
Arguments:
resource
Resource - dialect resourcedescriptor
dict - dialect descriptor
Returns:
Dialect
- dialect
#
system.create_errorCreate error
Arguments:
descriptor
dict - error descriptor
Returns:
Error
- error
#
system.create_fileCreate file
Arguments:
source
any - file sourceoptions
dict - file options
Returns:
File
- file
#
system.create_loaderCreate loader
Arguments:
resource
Resource - loader resource
Returns:
Loader
- loader
#
system.create_parserCreate parser
Arguments:
resource
Resource - parser resource
Returns:
Parser
- parser
#
system.create_serverCreate server
Arguments:
name
str - server nameoptions
str - server options
Returns:
Server
- server
#
system.create_stepCreate step
Arguments:
descriptor
dict - step descriptor
Returns:
Step
- step
#
system.create_storageCreate storage
Arguments:
name
str - storage nameoptions
str - storage options
Returns:
Storage
- storage
#
system.create_typeCreate type
Arguments:
field
Field - corresponding field
Returns:
Type
- type
#
system.get_http_sessionReturn a HTTP session
This method will return a new session or the session
from system.use_http_session
context manager
Returns:
requests.Session
- a HTTP session
#
system.use_http_sessionHTTP session context manager
Arguments:
http_session?
requests.Session - a session; will create a new if omitted
#
TypeData type representation
API | Usage |
---|---|
Public | from frictionless import Type |
This class is for subclassing.
Arguments:
field
Field - field
#
type.constraintsReturns:
str[]
- a list of supported constraints
#
type.fieldReturns:
Field
- field
#
type.read_cellConvert cell (read direction)
Arguments:
cell
any - cell to covert
Returns:
any
- converted cell
#
type.write_cellConvert cell (write direction)
Arguments:
cell
any - cell to covert
Returns:
any
- converted cell
#
XlsParserXLS parser implementation.
API | Usage |
---|---|
Public | `from frictionless.plugins.excel import XlsParser |
#
XlsxParserXLSX parser implementation.
API | Usage |
---|---|
Public | `from frictionless.plugins.excel import XlsxParser |
#
checks.baselineCheck a table for basic errors
API | Usage |
---|---|
Public | from frictionless import checks |
Implicit | validate(...) |
Ths check is enabled by default for any validate
function run.
#
checks.deviated_valueCheck for deviated values in a field
API | Usage |
---|---|
Public | from frictionless import checks |
Implicit | validate(checks=([{"code": "deviated-value", **descriptor}]) |
This check can be enabled using the checks
parameter
for the validate
function.
Arguments:
descriptor
dict - check's descriptorfield_name
str - a field name to checkaverage?
str - one of "mean", "median" or "mode" (default: "mean")interval?
str - statistical interval (default: 3)
#
checks.duplicate_rowCheck for duplicate rows
API | Usage |
---|---|
Public | from frictionless import checks |
Implicit | validate(checks=[{"code": "duplicate-row"}]) |
This check can be enabled using the checks
parameter
for the validate
function.
#
checks.forbidden_valueCheck for forbidden values in a field
API | Usage |
---|---|
Public | from frictionless import checks |
Implicit | validate(checks=[{"code": "backlisted-value", **descriptor}]) |
This check can be enabled using the checks
parameter
for the validate
function.
Arguments:
descriptor
dict - check's descriptorfield_name
str - a field name to look intoforbidden
any[] - a list of forbidden values
#
checks.row_constraintCheck that every row satisfies a provided Python expression
API | Usage |
---|---|
Public | from frictionless import checks |
Implicit | validate(checks=([{"code": "row-constraint", **descriptor}]) |
This check can be enabled using the checks
parameter
for the validate
function. The syntax for the row constraint
check can be found here - https://github.com/danthedeckie/simpleeval
Arguments:
descriptor
dict - check's descriptorformula
str - a python expression to evaluate against a row
#
checks.sequential_valueCheck that a column having sequential values
API | Usage |
---|---|
Public | from frictionless import checks |
Implicit | validate(checks=[{"code": "sequential-value", **descriptor}]) |
This check can be enabled using the checks
parameter
for the validate
function.
Arguments:
descriptor
dict - check's descriptorfield_name
str - a field name to check
#
checks.table_dimensionsCheck for minimum and maximum table dimensions
API | Usage |
---|---|
Public | from frictionless import checks |
Implicit | validate(checks=[{"code": "table-dimensions", numRows, minRows, maxRows, numFields, minFields, maxFields}]) |
Arguments:
descriptor
dict - check's descriptor
#
checks.truncated_valueCheck for possible truncated values
API | Usage |
---|---|
Public | from frictionless import checks |
Implicit | validate(checks=([{"code": "truncated-value"}]) |
This check can be enabled using the checks
parameter
for the validate
function.
#
describeDescribe the data source
API | Usage |
---|---|
Public | from frictionless import describe |
Arguments:
source
any - data sourcetype
str - source type -schema
,resource
orpackage
(default: infer)**options
dict - options for the underlaying describe function
Returns:
Package|Resource|Schema
- metadata
#
describe_dialectDescribe the given source as a dialect
API | Usage |
---|---|
Public | from frictionless import describe_dialect |
Arguments:
source
any - data source**options
dict - describe resource options
Returns:
Dialect
- file dialect
#
describe_packageDescribe the given source as a package
API | Usage |
---|---|
Public | from frictionless import describe_package |
Arguments:
source
any - data sourceexpand?
bool - ifTrue
it will expand the metadatastats?
bool - ifTrue
infer resource's stats**options
dict - Package constructor options
Returns:
Package
- data package
#
describe_resourceDescribe the given source as a resource
API | Usage |
---|---|
Public | from frictionless import describe_resource |
Arguments:
source
any - data sourceexpand?
bool - ifTrue
it will expand the metadatastats?
bool - ifTrue
infer resource's stats**options
dict - Resource constructor options
Returns:
Resource
- data resource
#
describe_schemaDescribe the given source as a schema
API | Usage |
---|---|
Public | from frictionless import describe_schema |
Arguments:
source
any - data source**options
dict - describe resource options
Returns:
Schema
- table schema
#
dicts_to_markdown_tableTabulate dictionaries and render as a Markdown table
#
errors.CellErrorCell error representation
Arguments:
descriptor?
str|dict - error descriptornote
str - an error notecells
str[] - row cellsrow_number
int - row numberrow_position
int - row positioncell
str - errored cellfield_name
str - field namefield_number
int - field numberfield_position
int - field positionRaises
FrictionlessException
- raise any error that occurs during the process
#
errors.CellError.from_rowCreate and error from a cell
Arguments:
row
Row - rownote
str - notefield_name
str - field name
Returns:
CellError
- error
#
errors.HeaderErrorHeader error representation
Arguments:
descriptor?
str|dict - error descriptornote
str - an error notelabels
str[] - header labelslabel
str - an errored labelfield_name
str - field namefield_number
int - field numberfield_position
int - field position
Raises:
FrictionlessException
- raise any error that occurs during the process
#
errors.LabelErrorLabel error representation
Arguments:
descriptor?
str|dict - error descriptornote
str - an error notelabels
str[] - header labelslabel
str - an errored labelfield_name
str - field namefield_number
int - field numberfield_position
int - field position
Raises:
FrictionlessException
- raise any error that occurs during the process
#
errors.RowErrorRow error representation
Arguments:
descriptor?
str|dict - error descriptornote
str - an error noterow_number
int - row numberrow_position
int - row position
Raises:
FrictionlessException
- raise any error that occurs during the process
#
errors.RowError.from_rowCreate an error from a row
Arguments:
row
Row - rownote
str - note
Returns:
RowError
- error
#
extractExtract resource rows
API | Usage |
---|---|
Public | from frictionless import extract |
Arguments:
source
dict|str - data sourcetype
str - source type - package of resource (default: infer)process?
func - a row processor functionstream?
bool - return a row stream(s) instead of loading into memory**options
dict - options for the underlaying function
Returns:
Row[]|{path
- Row[]}: rows in a form depending on the source type
#
extract_packageExtract package rows
API | Usage |
---|---|
Public | from frictionless import extract_package |
Arguments:
source
dict|str - data resource descriptorprocess?
func - a row processor functionstream?
bool - return a row streams instead of loading into memory**options
dict - Package constructor options
Returns:
{path
- Row[]}: a dictionary of arrays/streams of rows
#
extract_resourceExtract resource rows
API | Usage |
---|---|
Public | from frictionless import extract_resource |
Arguments:
source
any|Resource - data resourceprocess?
func - a row processor function**options
dict - Resource constructor options
Returns:
Row[]
- an array/stream of rows
#
filter_dictFilter and order dictionary by key names
#
json_to_markdownRender any JSON-like object as Markdown, using nested bulleted lists
#
render_markdownRender any JSON-like object as Markdown, using jinja2 template
#
steps.cell_convertConvert cell
#
steps.cell_fillFill cell
#
steps.cell_formatFormat cell
#
steps.cell_interpolateInterpolate cell
#
steps.cell_replaceReplace cell
#
steps.cell_setSet cell
#
steps.field_addAdd field
#
steps.field_filterFilter fields
#
steps.field_moveMove field
#
steps.field_removeRemove field
#
steps.field_splitSplit field
#
steps.field_unpackUnpack field
#
steps.field_updateUpdate field
#
steps.resource_addAdd resource
#
steps.resource_removeRemove resource
#
steps.resource_transformTransform resource
#
steps.resource_updateUpdate resource
#
steps.row_filterFilter rows
#
steps.row_searchSearch rows
#
steps.row_sliceSlice rows
#
steps.row_sortSort rows
#
steps.row_splitSplit rows
#
steps.row_subsetSubset rows
#
steps.row_ungroupUngroup rows
#
steps.table_aggregateAggregate table
#
steps.table_attachAttach table
#
steps.table_debugDebug table
#
steps.table_diffDiff tables
#
steps.table_intersectIntersect tables
#
steps.table_joinJoin tables
#
steps.table_meltMelt tables
#
steps.table_mergeMerge tables
#
steps.table_normalizeNormalize table
#
steps.table_pivotPivot table
#
steps.table_printPrint table
#
steps.table_recastRecast table
#
steps.table_transposeTranspose table
#
steps.table_validateValidate table
#
steps.table_writeWrite table
#
transformTransform resource
API | Usage |
---|---|
Public | from frictionless import transform |
Arguments:
source
any - data sourcetype
str - source type - package, resource or pipeline (default: infer)**options
dict - options for the underlaying function
Returns:
any
- the transform result
#
transform_packageTransform package
API | Usage |
---|---|
Public | from frictionless import transform_package |
Arguments:
source
any - data sourcesteps
Step[] - transform steps**options
dict - Package constructor options
Returns:
Package
- the transform result
#
transform_pipelineTransform package
API | Usage |
---|---|
Public | from frictionless import transform_package |
Arguments:
source
any - a pipeline descriptor**options
dict - Pipeline constructor options
Returns:
any
- the pipeline output
#
transform_resourceTransform resource
API | Usage |
---|---|
Public | from frictionless import transform_resource |
Arguments:
source
any - data sourcesteps
Step[] - transform steps**options
dict - Package constructor options
Returns:
Resource
- the transform result
#
types.AnyTypeAny type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.ArrayTypeArray type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.BooleanTypeBoolean type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.DateTypeDate type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.DatetimeTypeDatetime type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.DurationTypeDuration type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.GeojsonTypeGeojson type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.GeopointTypeGeopoint type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.IntegerTypeInteger type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.NumberTypeNumber type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.ObjectTypeObject type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.StringTypeString type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.TimeTypeTime type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.YearTypeYear type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
types.YearmonthTypeYearmonth type implementation.
API | Usage |
---|---|
Public | from frictionless import types |
#
validateValidate resource
API | Usage |
---|---|
Public | from frictionless import validate |
Arguments:
source
dict|str - a data sourcetype
str - source type - inquiry, package, resource, schema or table**options
dict - options for the underlaying function
Returns:
Report
- validation report
#
validate_inquiryValidate inquiry
API | Usage |
---|---|
Public | from frictionless import validate_inquiry |
Arguments:
source
dict|str - an inquiry descriptorparallel?
bool - enable multiprocessing
Returns:
Report
- validation report
#
validate_packageValidate package
API | Usage |
---|---|
Public | from frictionless import validate_package |
Arguments:
source
dict|str - a package descriptorbasepath?
str - package basepathtrusted?
bool - don't raise an exception on unsafe pathsoriginal?
bool - validate metadata as it is (without inferring)parallel?
bool - enable multiprocessing**options
dict - Package constructor options
Returns:
Report
- validation report
#
validate_resourceValidate table
API | Usage |
---|---|
Public | from frictionless import validate_table |
Arguments:
source
any - the source of the resourcechecks?
list - a list of checks pick_errors? ((str|int)[]): pick errors skip_errors? ((str|int)[]): skip errorslimit_errors?
int - limit errorslimit_memory?
int - limit memoryoriginal?
bool - validate metadata as it is (without inferring)**options?
dict - Resource constructor options
Returns:
Report
- validation report
#
validate_schemaValidate schema
API | Usage |
---|---|
Public | from frictionless import validate_schema |
Arguments:
source
dict|str - a schema descriptor
Returns:
Report
- validation report