Validating RDA DMP 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:
- Fork the repository
- Create a new branch for your feature or fix
- Commit your changes and write meaningful commit messages
- Push your branch to your fork
- Submit a Pull Request (PR)
Issues & Feature Requests
- If you find a bug or have a feature request, open an issue.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file madmpy-0.1.0.tar.gz.
File metadata
- Download URL: madmpy-0.1.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15223e487a8730e467156b07436ebd752b3d8a9ab1747a2b0df01652dab3238b
|
|
| MD5 |
2d7066399816c6c0ec5c5528bb17afa6
|
|
| BLAKE2b-256 |
5a1724cf4d428f69ecf70fb775242bd0f539b0c8c5c1b1f33fdcd98ebce7015a
|
File details
Details for the file madmpy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: madmpy-0.1.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2707a52c4db86daa34ce0ace21c3a248860d840b19c4d15b0e75b7714b1f6d85
|
|
| MD5 |
f622f6b489d5d03bece1710f520db214
|
|
| BLAKE2b-256 |
681373c2d03611226b14fae6cea599e1b154f9e77314575a92948e9ff004fa37
|