Skip to main content

Datadock is a PySpark-based data interoperability library. It automatically detects schemas from heterogeneous files (CSV, JSON, Parquet), groups them by structural similarity, and performs standardized batch reads. Designed for pipelines handling non-uniform large-scale data, enabling robust integration and reuse in distributed environments.

Project description

Datadock

Datadock is a Python library built on top of PySpark, designed to simplify data interoperability between files of different formats and schemas in modern data engineering pipelines.

It automatically detects schemas from CSV, JSON and Parquet files, groups structurally similar files, and allows standardized reading of all grouped files into a single Spark DataFrame — even in highly heterogeneous datasets.

✨ Key Features

  • 🚀 Automatic parsing of multiple file formats: .csv, .json, .parquet
  • 🧠 Schema-based file grouping by structural similarity
  • 📊 Auto-selection of dominant schemas
  • 🛠️ Unified read across similar files into a single PySpark DataFrame
  • 🔍 Schema insight for diagnostics and inspection

🔧 Installation

pip install datadock

🗂️ Expected Input Structure

Place your data files (CSV, JSON or Parquet) inside a single folder. The library will automatically detect supported files and organize them by schema similarity.

/data/input/
├── sales_2020.csv
├── sales_2021.csv
├── products.json
├── archive.parquet
├── log.parquet

🧪 Usage Example

from datadock import scan_schema, get_schema_info, read_data

path = "/path/to/your/data"

# Logs schema groups detected
scan_schema(path)

# Retrieves schema metadata
info = get_schema_info(path)
print(info)

# Loads all files from schema group 1
df = read_data(path, schema_id=1, logs=True)
df.show()

📌 Public API

scan_schema

Logs the identified schema groups found in the specified folder.

get_schema_info

Returns a list of dictionaries containing:

  • schema_id: ID of the schema group
  • file_count: number of files in the group
  • column_count: number of columns in the schema
  • files: list of file names in the group

read_data

Reads and merges all files that share the same schema.
If schema_id is not specified, the group with the most columns will be selected.

✅ Requirements

  • Python 3.10+
  • PySpark

📚 Motivation

In real-world data engineering workflows, it's common to deal with files that represent the same data domain but have slight structural variations — such as missing columns, different orders, or evolving schemas.
Datadock automates the process of grouping, inspecting, and reading these files reliably, allowing you to build pipelines that are schema-aware, scalable, and format-agnostic.

📄 License

This project is licensed under the MIT License.

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

datadock-0.1.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datadock-0.1.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file datadock-0.1.3.tar.gz.

File metadata

  • Download URL: datadock-0.1.3.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for datadock-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1d0d486bdc7e087f563d37c7c77b9b8cc0a0f1a7fbccafa9b401fb061cb65e52
MD5 51203ae925c00cfa87f765aae3a79e72
BLAKE2b-256 b0776132fe8fdcdc31abca793602e23ac1ce252aee209fc9a34e5459600805af

See more details on using hashes here.

File details

Details for the file datadock-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: datadock-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for datadock-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 592f36faa2256b0cb2717d37483a3a75882d5428ff085d0c9c29fb1651fee81f
MD5 b3f7c0f4f1fcfa49f20534ba6087cd42
BLAKE2b-256 24b836c2e6fe980afdea64256f5d5c229f55b1e2495551bc970310c492eb1c6d

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