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).

🔧 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

# Local installation (dev mode)
pip install -e .

# With test dependencies
pip install -e .[test]

🚀 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.13"
  }
}

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-0.1.1.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-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dsjson-0.1.1.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-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d1d2d4c5a7e872e317899a9f7ebf342d2c785b437554de778342b42aa4500b91
MD5 75ec6f17a36115f4fbfc6a1b0dd22fd2
BLAKE2b-256 522cbdd4d12578d46841974af5a688c439efb03c7b25d282ba1f26a6faa7027d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dsjson-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c101e365f5af8d9a7c299a687652f23316eb7a0308d3752702110e7a60e2c9a4
MD5 b01b7ed00213da7170cbb14d05db7c60
BLAKE2b-256 68c607c3bc89fa88acf1256f749a67392b50e48f21f877ddb84d18fc6229346a

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