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 License: MIT PyPI - Python Version

🔧 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.1.tar.gz (4.8 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.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dsjson-1.1.tar.gz
Algorithm Hash digest
SHA256 9b25238d52050c1249a4799aefaf8ad46389d98c5ac3c1e130ed38dec432336e
MD5 b9c98bde2db1636c1837749f294b1f68
BLAKE2b-256 39a0e3c2e8b800f8671738a1e4190ce72227a9f06ea41728a4626a054fa1412e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dsjson-1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c41b7e4cde3b8774279618d37edb806e142218a86fb10fd17caa642d59aeab12
MD5 2eff55339e421127bea55ce386303f8a
BLAKE2b-256 19aea79cc9feda2669ef77d959d096b3af232faee8613e4d9efb30af33ca5a71

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