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

Uploaded Python 3

File details

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

File metadata

  • Download URL: madmpy-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 f0c7ea61d2bae20ab09599d4013bbf2abeb588d48180ea095e074030af952f21
MD5 eed56b68c59413fe588587613ae62b49
BLAKE2b-256 c46dcb9a64a0728801e3e3be9f0967d5ce6a254e58795e60334f634969dd65a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: madmpy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 22.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dcb59d655fc6ba30a4de047a9f6d9ebe5e473b2e9e2ba3cdb29f921ba1938b9c
MD5 c284dab7f25c7bcf64d2e4dff16e336c
BLAKE2b-256 9faa02ce48a30aae4849b0ce1cc9c52a295c0204e51c300a9c944cb0cd32425d

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