https://github.com/bamresearch/masterdata-template
A template to create and work with data models in the BAM Data Store
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.1%) to scientific vocabulary
Keywords
Repository
A template to create and work with data models in the BAM Data Store
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
masterdata-template
A template to create and work with Masterdata definitions in the BAM Data Store.
Generating your Masterdata repository
- Click on Use this template button on the top right and create a new Masterdata repository.

- The next screen will prompt you to chose a Github organization or profile for the new repository, as well as a name. We recommend you naming the repository starting with
masterdata-, so it is easy to be recognized. - After creating your new repository, you can:
- Open in Github Codespace
- Clone it locally
- You need to install
cruft. - Run the following command to create the structure of the new Masterdata project:
bash cruft create https://github.com/BAMresearch/masterdata-generator
This will prompt you with some questions to be filled in:
bash
[1/8] Name of the main author (Erika Mustermann):
[2/8] Email of the main author (erika.mustermann@bam.de):
[3/8] Github organization or profile name (BAMResearch):
[4/8] The name of the folder containing the generated files <project-name> (masterdata-example):
[5/8] The name of the folder src/<module_name>, default is the <project_name> separated with underscores (masterdata_example):
[6/8] Description of the project (A short description for the masterdata project.):
[7/8] Do you want to add Python schema files? [y/n] (y):
[8/8] Do you want to add Excel schema files? [y/n] (y):
[!NOTE] Not filling anything on the questions above will result on chosing the default. The default value for each question is defined in between parenthesis next to the question.
The files generated by
cruftare created under./<project-name>. To move all the structure one level up, run:sh python <project-name>/move_generated_files.pyAfter filling the questionnaire and running the
move_generated_files.pyscript, you will have a new repository with: ```sh masterdata-/ ├── LICENSE (MIT) ├── README.md ├── pyproject.toml ├── src/ │ └── masterdata- / if Python is selected as an option
│ ├── init.py │ ├── objecttypes.py │ ├── vocabularytypes.py
if Excel is selected as an option
│ ├── masterdata.xlsx └── tests/ ├── init.py └── test.py ```
If you are using Python, you can install the package and its dependencies by creating a virtual environment (either with
condaorvenv) and running:sh python3 -m venv .venv source .venv/bin/activate pip install --upgrade pip pip install uv uv pip install -e '.[dev]'
[!NOTE] Step 8 is defined using
venvfor creating a virtual environment in an Ubuntu OS. Please, modify the commands if you usecondaor you are installing in Windows/MacOS.
Development
Once you have the skeleton of the Masterdata repository, you can define new classes in the corresponding file under src/<module-name>/.
In case of Python, these are different modules for Object Types and Vocabularies. For Excel or RDF/XML, this is a single file named masterdata.xlsx/masterdata.owl, respectively. In all the cases, a dummy entity called ExampleObjectType is created to serve as an example.
You can export from Python to the other formats using the bam-masterdata CLI. You can also generate Python code from Excel or RDF/XML with the same CLI. Read more in the bam-masterdata documentation.
Github actions
A set of Github actions are defined in .github/workflows/. These will:
1. Ensure typing and formatting consistency in Python code following PEP-8 standards using mypy and ruff rules defined in the pyproject.toml.
2. Check consistency of the Masterdata definitions using the bam-masterdata checker CLI functionalities.
If the pipeline passes, it means your Masterdata definitions are formatted properly and do not clash with the current bam-masterdata definitions.
[!IMPORTANT] In
bam-masterdata, there is a set of Masterdata entities already defined. These correspond to the general definitions (to be used across MSE sub-communities). If you want to know how to define new Masterdata entities using inheritance from the general ones, read the corresponding documentation.
Publishing Masterdata as an independent PyPI package
The action .github/workflows/publish.yml already implements the publishing of your repository to PyPI. When you are ready, you need:
1. Define a secret and name it PYPI_API_TOKEN from pypi.org.
2. Create a Release from the Github page of your repository.
Read more here: Github PyPI documentation.
Owner
- Name: Bundesanstalt für Materialforschung und -prüfung
- Login: BAMresearch
- Kind: organization
- Email: oss@bam.de
- Location: Berlin/Germany
- Website: www.bam.de
- Repositories: 36
- Profile: https://github.com/BAMresearch
German Federal scientific research institute for materials testing and research
GitHub Events
Total
- Push event: 5
- Public event: 1
Last Year
- Push event: 5
- Public event: 1