Skip to content

LeibnizDSMZ/microbial-data-standard

Repository files navigation

release: 0.8.0 MIT LICENSE Documentation Status

Please note that this project is still in development

Microbial Strain Data Standard

This project defines a new microbial strain data standard for all data describing a microbial strain. The new microbial strain data standard is part of the work of WP6 of the Bioindustry 4.0 project.

Basic information

The new microbial strain data standard is defined as a data model written in pydantic. The model is used for data validation and to generate a JSON schema file, describing the microbial strain data standard.

The JSON-schema file is prebuilt and included in this project. You find the JSON schema in schema/microbe_schema.json. The JSON schema will be used for data validation.

If you want to report a bug, contribute to the project or suggest new features, please contact the project owner.

How to use

The provided data model and schema are for data validation.

Examples for using the pydantic data model:

Import:

from microbial_strain_data_model.microbe import Microbe

Generate JSON schema:

import json
from microbial_strain_data_model.microbe import Microbe

mi = Microbe.model_json_schema()
print(json.dumps(mi, indent=2))

Validate a JSON against the pydantic model:

from microbial_strain_data_model.microbe import Microbe

with open("PATH_TO_FILE", "r") as f_in:
        file_content = f_in.read()

Microbe.model_validate_json(file_content)

Validate a JSON against the JSON schema:

import jsonschema
import json

with open("PATH_TO_SCHEMA", "r") as schema_file:
        schema = json.load(schema_file)

with open("PATH_TO_FILE", "r") as f_in:
        json_content = json.loads(f_in)

jsonschema.validate(json_content, schema)

About

Data standard for cultured microbial strains

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •