Describe is a high-level function (action) to infer a metadata from a data source.
from frictionless import describe
resource = describe('table.csv')
print(resource)
{'name': 'table',
'type': 'table',
'path': 'table.csv',
'scheme': 'file',
'format': 'csv',
'mediatype': 'text/csv',
'encoding': 'utf-8',
'schema': {'fields': [{'name': 'id', 'type': 'integer'},
{'name': 'name', 'type': 'string'}]}}
Describe the data source
(source: Optional[Any] = None, *, name: Optional[str] = None, type: Optional[str] = None, stats: bool = False, **options: Any) -> Metadata
Extract is a high-level function (action) to read tabular data from a data source. The output is encoded in 'utf-8' scheme.
from pprint import pprint
from frictionless import extract
rows = extract('table.csv')
pprint(rows)
{'table': [{'id': 1, 'name': 'english'}, {'id': 2, 'name': '中国人'}]}
Extract rows
(source: Optional[Any] = None, *, name: Optional[str] = None, type: Optional[str] = None, filter: Optional[types.IFilterFunction] = None, process: Optional[types.IProcessFunction] = None, limit_rows: Optional[int] = None, resource_name: Optional[str] = None, **options: Any)
Validate is a high-level function (action) to validate data from a data source.
from frictionless import validate
report = validate('table.csv')
print(report.valid)
True
Validate resource
(source: Optional[Any] = None, *, name: Optional[str] = None, type: Optional[str] = None, checklist: Union[frictionless.checklist.checklist.Checklist, str, NoneType] = None, checks: List[frictionless.checklist.check.Check] = [], pick_errors: List[str] = [], skip_errors: List[str] = [], limit_errors: int = 1000, limit_rows: Optional[int] = None, parallel: bool = False, resource_name: Optional[str] = None, **options: Any)
Transform is a high-level function (action) to transform tabular data from a data source.
from frictionless import transform, steps
resource = transform('table.csv', steps=[steps.cell_set(field_name='name', value='new')])
print(resource.read_rows())
[{'id': 1, 'name': 'new'}, {'id': 2, 'name': 'new'}]
Transform resource
(source: Optional[Any] = None, *, type: Optional[str] = None, pipeline: Union[frictionless.pipeline.pipeline.Pipeline, str, NoneType] = None, steps: Optional[List[frictionless.pipeline.step.Step]] = None, **options: Any)