Skip to main content

A Python package to convert tabular data and metadata into CDISC Dataset-JSON v1.1 format.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

📄 README.md

Project: dsjson

A lightweight Python package to convert clinical tabular datasets (e.g., SDTM/ADaM) and metadata into CDISC Dataset-JSON v1.1 format. It supports multiple metadata input formats including CSV, Excel, JSON, and XML (planned).

PyPI version License: MIT

🔧 Features

  • Converts DataFrame + column metadata to Dataset-JSON v1.1
  • Supports CSV, Excel, JSON for metadata
  • Auto-generates datasetJSONCreationDateTime
  • Enforces required top-level metadata
  • Clean and minimal API

📦 Installation

pip install dsjson

🚀 Quick Start

from dsjson import load_metadata, to_dataset_json
import pandas as pd

# Load data and metadata
rows = pd.read_csv("examples/vs.csv")
columns = load_metadata("examples/columns_vs.csv", file_type="csv")

# Create Dataset-JSON
ds = to_dataset_json(
    data_df=rows,
    columns_df=columns,
    name="VS",
    label="Vital Signs",
    itemGroupOID="IG.VS",
    originator="My CRO",
    sourceSystem_name="Python",
    sourceSystem_version="3.10",
    fileOID="F.VS.001",
    studyOID="S.1234"
)

📁 Supported Input Types

  • Column Metadata: .csv, .xlsx, .json, (planned: .xml)
  • Data Table: Any Pandas-compatible format

✅ Output Example

{
  "datasetJSONVersion": "1.1",
  "datasetJSONCreationDateTime": "2025-07-19T00:00:00",
  "name": "VS",
  "label": "Vital Signs",
  "itemGroupOID": "IG.VS",
  "columns": [...],
  "rows": [...],
  "records": 100,
  "originator": "My CRO",
  "sourceSystem": {
    "name": "Python",
    "version": "3.10"
  }
}

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

dsjson-1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

dsjson-1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file dsjson-1.0.tar.gz.

File metadata

  • Download URL: dsjson-1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for dsjson-1.0.tar.gz
Algorithm Hash digest
SHA256 00267294750ce2e14d74d9c705fd35b61849362e70db6d21489e2a18758dec10
MD5 d23af134229bd54822ab1fc2e73efa82
BLAKE2b-256 0c88fb952729de6679b5529dfa90031801706b072e18c6fb6cc83ab67788ee28

See more details on using hashes here.

File details

Details for the file dsjson-1.0-py3-none-any.whl.

File metadata

  • Download URL: dsjson-1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for dsjson-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c7bab65e3ba9b018453bbd387a2219bf28c4130a46fcff3403adaba0c4a7736
MD5 aace6635be0b66f8e09dc365f1c3c33a
BLAKE2b-256 65fc5326bd5bf6d3989462dd6e1e35831a0b9903d23a790d5ff3f745579e5c15

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