Skip to main content

Creating and validating DMPs following the RDA Common Standard

Project description

madmpy

Validating and creating machine Actionable Data Management Plan descriptions in a pythonic way.

madmpy is a Python library for creating and validating Data Management Plans (DMPs) following the recommendations of the RDA DMP Common Standard.

Installation

Ensure you have Python 3.11+ installed. You can install madmpy using pip:

pip install madmpy

Quickstart

Import the library in your Python script or interactive session:

import madmpy

To load the DMP module:

>>> import madmpy
>>> dmp_module = madmpy.load()
Loaded madmpy with RDA-DMP specification v1.1

To use an older version of the RDA-DMP Common Standard:

>>> import madmpy
>>> VERSION = "1.0"
>>> madmpy.set_version(VERSION)
>>> dmp_module = madmpy.load()
Loaded madmpy with RDA-DMP specification v1.0

Validate a DMP File

To validate a DMP file in JSON format:

>>> madmpy.validate_DMP("path_DMP_JSON")
DMP validated!

Create a DMP

You can generate a new DMP that conforms to the RDA-DMP Common Standard using madmpy. Below is an example with only the required elements:

import datetime
import madmpy

dmp_module = madmpy.load()

title = "DMP Title"
language = dmp_module.LanguageEnum.eng
dataset = dmp_module.Dataset(
    dataset_id=dmp_module.DatasetIdentifier(
        identifier="https://doi.org/10.25504/FAIRsharing.r3vtvx",
        type=dmp_module.dmp_dataset_id_type.DOI,
    ),
    description="Dataset description example",
    personal_data="no",
    sensitive_data="no",
    technical_resource=[dmp_module.TechnicalResource(name="Technical resource")],
    title="Dataset title",
)

contact = dmp_module.Contact(
    name="name",
    contact_id=dmp_module.ContactIdentifier(
        identifier="https://orcid.org/0000-0001-2345-6789",
        type=dmp_module.contact_id_type.ORCID,
    ),
    mbox="name@email.com",
)

dmp_id = dmp_module.DMPIdentifier(
    identifier="https://doi.org/10.15497/rda00039",
    type=dmp_module.dmp_dataset_id_type.DOI)

DMP = dmp_module.DMP(
    dataset=[dataset],
    language=language,
    title=title,
    contact=contact,
    dmp_id=dmp_id,
    ethical_issues_exist=dmp_module.YesNoUnknown.NO,
    created=datetime.datetime.now().replace(microsecond=0),
    modified=datetime.datetime.now().replace(microsecond=0),
)

Convert to JSON

To generate a JSON representation of the DMP object:

madmpy.export_DMP_json(DMP)

This will output a structured JSON-formatted representation of the DMP:

{
    "dmp": {
        "title": "DMP Title",
        "contact": {
            "name": "name",
            "contact_id": {
                "identifier": "https://orcid.org/0000-0001-2345-6789",
                "type": "orcid"
            },
            "mbox": "name@email.com"
        },
        "contributor": null,
        "cost": null,
        "created": "2025-02-12T08:15:03",
        "dataset": [
            {
                "data_quality_assurance": null,
                "dataset_id": {
                    "identifier": "https://doi.org/10.25504/FAIRsharing.r3vtvx",
                    "type": "doi"
                },
                "description": "Dataset description example",
                "distribution": null,
                "issued": null,
                "keyword": null,
                "language": null,
                "metadata": null,
                "personal_data": "no",
                "preservation_statement": null,
                "security_and_privacy": null,
                "sensitive_data": "no",
                "technical_resource": [
                    {
                        "description": null,
                        "name": "Technical resource"
                    }
                ],
                "title": "Dataset title",
                "type": null
            }
        ],
        "description": null,
        "dmp_id": {
            "identifier": "https://n2t.net/ark:/123456/xyz123?info",
            "type": "ark"
        },
        "ethical_issues_description": null,
        "ethical_issues_exist": "no",
        "ethical_issues_report": null,
        "language": "eng",
        "modified": "2025-02-12T08:15:03",
        "project": null
    }
}

Contributing

Contributions are welcome! If you would like to improve madmpy, follow these steps:

  1. Fork the repository
  2. Create a new branch for your feature or fix
  3. Commit your changes and write meaningful commit messages
  4. Push your branch to your fork
  5. Submit a Pull Request (PR)

Issues & Feature Requests

License

This project is licensed under the MIT License.

📖 Documentation

For a detailed API reference and more examples, check out the official documentation.

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

madmpy-0.1.1.tar.gz (2.8 MB view details)

Uploaded Source

Built Distribution

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

madmpy-0.1.1-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: madmpy-0.1.1.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for madmpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2d315acf14556c641716267f31c03311ae8fb5981416504ca6c907813e6236c4
MD5 e3126669b17b9888c612fe855a980d05
BLAKE2b-256 48a761ffba3a196d55385aa60d81b74deabe4ada34209e5e6f06399a203be51d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for madmpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90ea83c41d32efb307a0184959c2eb2e858f5ea8860d2a0f41f339d750a5d9bc
MD5 6e29e956190b4bb14e5aeeb3fae8deae
BLAKE2b-256 476e6f0ac25ed7dc2ed300959a3f7ba304acdf84b51b160515953625a80f5a06

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