Frictionless Data

5.18.1 · active · verified Sun Apr 12

Frictionless is a data management framework for Python that provides functionality to describe, extract, validate, and transform tabular data (DEVT Framework). It supports a great deal of data sources and formats, as well as provides popular platform integrations. The framework is powered by the lightweight yet comprehensive Frictionless Standards. The current version is 5.18.1. The project has an active development and release cadence, with version 2.0 of the underlying Data Package standard recently released in June 2024, and significant updates to the Python library.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `frictionless` to infer metadata (schema) from a CSV file and then extract its data as Python rows. It first creates a temporary CSV file, then uses `describe` to automatically generate a schema, and `extract` to read the data.

import os
from frictionless import describe, extract

# Create a dummy CSV file for demonstration
csv_content = """id,name,value
1,apple,100
2,banana,200
3,orange,150
"""
file_path = "data.csv"
with open(file_path, "w") as f:
    f.write(csv_content)

# Describe the data to infer metadata (Table Schema)
print("--- Inferred Schema ---")
report = describe(file_path)
print(report.to_json(indent=2))

# Extract data as rows from the file
print("\n--- Extracted Data ---")
rows = extract(file_path)
for row in rows:
    print(row)

# Clean up the dummy file
os.remove(file_path)

view raw JSON →