bam-masterdata 0.8.2__tar.gz → 0.8.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/PKG-INFO +1 -1
  2. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/_version.py +3 -3
  3. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/cli/cli.py +9 -1
  4. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/cli/run_parser.py +9 -1
  5. {bam_masterdata-0.8.2/bam_masterdata/cli → bam_masterdata-0.8.4/bam_masterdata/excel}/excel_to_entities.py +11 -4
  6. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata.egg-info/PKG-INFO +1 -1
  7. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata.egg-info/SOURCES.txt +0 -1
  8. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/index.md +1 -0
  9. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/references/api.md +2 -2
  10. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/references/extra.md +6 -5
  11. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/tutorials/parsing.md +12 -3
  12. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/cli/test_run_parser.py +42 -0
  13. bam_masterdata-0.8.2/bam_masterdata/excel/excel_to_entities.py +0 -722
  14. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/.coveragerc +0 -0
  15. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/.github/release.yml +0 -0
  16. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/.github/workflows/actions.yml +0 -0
  17. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/.github/workflows/coveralls.yml +0 -0
  18. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/.github/workflows/mkdocs-deploy.yml +0 -0
  19. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/.github/workflows/publish.yml +0 -0
  20. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/.gitignore +0 -0
  21. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/.vscode/settings.json +0 -0
  22. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/AUTHORS +0 -0
  23. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/LICENSE +0 -0
  24. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/LICENSE.datamodel +0 -0
  25. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/NOTICE +0 -0
  26. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/README.md +0 -0
  27. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/__init__.py +0 -0
  28. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/checker/__init__.py +0 -0
  29. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/checker/checker.py +0 -0
  30. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/checker/masterdata_validator.py +0 -0
  31. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/checker/source_loader.py +0 -0
  32. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/checker/validation_rules/all_validation_rules.json +0 -0
  33. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/checker/validation_rules/excel_validation_rules.json +0 -0
  34. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/checker/validation_rules/validation_rules.json +0 -0
  35. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/cli/__init__.py +0 -0
  36. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/cli/entities_to_excel.py +0 -0
  37. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/cli/entities_to_rdf.py +0 -0
  38. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/cli/fill_masterdata.py +0 -0
  39. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/datamodel/__init__.py +0 -0
  40. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/datamodel/collection_types.py +0 -0
  41. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/datamodel/dataset_types.py +0 -0
  42. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/datamodel/object_types.py +0 -0
  43. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/datamodel/vocabulary_types.py +0 -0
  44. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/excel/__init__.py +0 -0
  45. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/logger.py +0 -0
  46. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/metadata/__init__.py +0 -0
  47. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/metadata/_maps.py +0 -0
  48. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/metadata/definitions.py +0 -0
  49. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/metadata/entities.py +0 -0
  50. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/metadata/entities_dict.py +0 -0
  51. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/openbis/__init__.py +0 -0
  52. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/openbis/get_entities.py +0 -0
  53. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/openbis/login.py +0 -0
  54. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/parsing/__init__.py +0 -0
  55. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/parsing/parsing.py +0 -0
  56. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/utils/__init__.py +0 -0
  57. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/utils/paths.py +0 -0
  58. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/utils/users.py +0 -0
  59. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata/utils/utils.py +0 -0
  60. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata.egg-info/dependency_links.txt +0 -0
  61. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata.egg-info/entry_points.txt +0 -0
  62. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata.egg-info/requires.txt +0 -0
  63. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/bam_masterdata.egg-info/top_level.txt +0 -0
  64. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/bammasterdata_blue_transparent.png +0 -0
  65. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/bammasterdata_blue_transparent_text.png +0 -0
  66. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/bammasterdata_blue_transparent_text.svg +0 -0
  67. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/bammasterdata_blue_white.png +0 -0
  68. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/bammasterdata_blue_white_text.png +0 -0
  69. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/datastore-logo-white.png +0 -0
  70. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/datastore-logo.png +0 -0
  71. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/drawio/UML.drawio +0 -0
  72. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/drawio/checker-structure.drawio +0 -0
  73. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/drawio/levels_base_entities.drawio +0 -0
  74. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/drawio/masterdata-workflow.drawio +0 -0
  75. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/fonts/BAMKlavika-Light.ttf +0 -0
  76. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/fonts/BAMKlavika-LightItalic.ttf +0 -0
  77. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/fonts/BAMKlavika-Medium.ttf +0 -0
  78. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/fonts/BAMKlavika-MediumItalic.ttf +0 -0
  79. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/masterdata-workflow.drawio.png +0 -0
  80. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/parsing/Card1ParserApp.jpg +0 -0
  81. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/parsing/Card2.jpg +0 -0
  82. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/parsing/Card3Logs.jpg +0 -0
  83. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/parsing/ETLParsingNewColors.drawio.png +0 -0
  84. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/parsing/ETLParsingNewColors.drawio.svg +0 -0
  85. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/assets/parsing/LoginParserApp.jpg +0 -0
  86. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/explanations/parsing_structure.md +0 -0
  87. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/explanations/schema_defs.md +0 -0
  88. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/howtos/object_references.md +0 -0
  89. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/howtos/overview.md +0 -0
  90. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/howtos/parsing/create_new_parsers.md +0 -0
  91. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/howtos/parsing/parser_app.md +0 -0
  92. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/references/glossary.md +0 -0
  93. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/stylesheets/extra.css +0 -0
  94. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/docs/tutorials/getting_started.md +0 -0
  95. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/mkdocs.yml +0 -0
  96. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/pyproject.toml +0 -0
  97. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/scripts/install_python_dependencies.bat +0 -0
  98. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/scripts/install_python_dependencies.sh +0 -0
  99. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/scripts/pkg_size.py +0 -0
  100. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/setup.cfg +0 -0
  101. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/__init__.py +0 -0
  102. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/checker/test_source_loader.py +0 -0
  103. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/cli/test_entities_to_excel.py +0 -0
  104. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/cli/test_entities_to_rdf.py +0 -0
  105. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/conftest.py +0 -0
  106. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/datamodel_test/collection_types.py +0 -0
  107. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/datamodel_test/dataset_types.py +0 -0
  108. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/datamodel_test/object_types.py +0 -0
  109. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example01_codedoesnoteexists.xlsx +0 -0
  110. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example02_codeexists_proptype_datatypechanged.xlsx +0 -0
  111. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example03_codeexists_proptype_contvoccodechanged.xlsx +0 -0
  112. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example04_codeexists_proptype_objectcodechanged.xlsx +0 -0
  113. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example05_codeexists_proptype_warningdefschanged.xlsx +0 -0
  114. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example06_codeexists_proptype_vocobjcodemiss.xlsx +0 -0
  115. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example07_codeexists_objtype_warningdefschanged.xlsx +0 -0
  116. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example08_codeexists_objtype_assignprop_listcodeschanged_add.xlsx +0 -0
  117. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example09_codeexists_objtype_assignprop_listcodeschanged_del.xlsx +0 -0
  118. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example10_codeexists_objtype_assignprop_codedoesnotexists.xlsx +0 -0
  119. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example11_codeexists_objtype_assignprop_listcodeschanged_datatypechanged.xlsx +0 -0
  120. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example12_codeexists_objtype_assignprop_listcodeschanged_warningdefschanged.xlsx +0 -0
  121. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example13_codeexists_objtype_assignprop_coincide2objects.xlsx +0 -0
  122. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example_incoming_excel.xlsx +0 -0
  123. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example_incoming_python/collection_types.py +0 -0
  124. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example_incoming_python/dataset_types.py +0 -0
  125. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/example_incoming_python/object_types.py +0 -0
  126. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/masterdata_example.xlsx +0 -0
  127. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/masterdata_excel_output.json +0 -0
  128. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/checker/masterdata_python_output.json +0 -0
  129. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/cli/test_parser.txt +0 -0
  130. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/metadata/example_vocabulary.py +0 -0
  131. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/utils/example_prop_types_1.py +0 -0
  132. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/data/utils/example_prop_types_2.py +0 -0
  133. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/excel/test_excel_to_entities.py +0 -0
  134. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/metadata/test_definitions.py +0 -0
  135. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/metadata/test_entities.py +0 -0
  136. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/metadata/test_entities_dict.py +0 -0
  137. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/metadata/test_object_data_type.py +0 -0
  138. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/test_logger.py +0 -0
  139. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/utils/test_paths.py +0 -0
  140. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/utils/test_users.py +0 -0
  141. {bam_masterdata-0.8.2 → bam_masterdata-0.8.4}/tests/utils/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bam-masterdata
3
- Version: 0.8.2
3
+ Version: 0.8.4
4
4
  Summary: The BAM Data Store utility tools and masterdata models wrapped in a Python package with a front-end web interface.
5
5
  Author-email: BAM Data Store <datastore@bam.de>
6
6
  Maintainer-email: "Jose M. Pizarro" <jose.pizarro-blanco@bam.de>
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.8.2'
32
- __version_tuple__ = version_tuple = (0, 8, 2)
31
+ __version__ = version = '0.8.4'
32
+ __version_tuple__ = version_tuple = (0, 8, 4)
33
33
 
34
- __commit_id__ = commit_id = 'ge06cea03b'
34
+ __commit_id__ = commit_id = 'g79f8723d1'
@@ -617,7 +617,14 @@ def push_to_openbis(file_path, datamodel_path):
617
617
  required=False,
618
618
  help="OpenBIS space name",
619
619
  )
620
- def parser(files_parser, project_name, collection_name, space_name):
620
+ @click.option(
621
+ "--collection-type",
622
+ "collection_type", # alias
623
+ type=click.Choice(["COLLECTION", "DEFAULT_EXPERIMENT"], case_sensitive=False),
624
+ default="COLLECTION",
625
+ help="Type of collection to create in openBIS. Options are 'COLLECTION' or 'DEFAULT_EXPERIMENT'. Defaults to 'COLLECTION'.",
626
+ )
627
+ def parser(files_parser, project_name, collection_name, space_name, collection_type):
621
628
  parser_map = {} # TODO load from configuration from yaml file
622
629
  parse_file_dict = {}
623
630
  for parser_key, filepath in files_parser:
@@ -636,6 +643,7 @@ def parser(files_parser, project_name, collection_name, space_name):
636
643
  project_name=project_name,
637
644
  collection_name=collection_name,
638
645
  files_parser=parse_file_dict,
646
+ collection_type=collection_type.upper(),
639
647
  )
640
648
 
641
649
 
@@ -15,6 +15,7 @@ def run_parser(
15
15
  project_name: str = "PROJECT",
16
16
  collection_name: str = "",
17
17
  files_parser: dict[AbstractParser, list[str]] = {},
18
+ collection_type: str = "COLLECTION",
18
19
  ) -> None:
19
20
  """
20
21
  Run the parsers on the specified files and collect the results.
@@ -26,6 +27,7 @@ def run_parser(
26
27
  project_name (str): The project in openBIS where the entities will be stored.
27
28
  collection_name (str): The collection in openBIS where the entities will be stored.
28
29
  files_parser (dict): A dictionary where keys are parser instances and values are lists of file paths to be parsed. E.g., {MasterdataParserExample(): ["path/to/file.json", "path/to/another_file.json"]}
30
+ collection_type (str): The type of collection to create in openBIS. Options are "COLLECTION" or "DEFAULT_EXPERIMENT". Defaults to "COLLECTION".
29
31
  """
30
32
  # Ensure openbis is provided
31
33
  if openbis is None:
@@ -41,6 +43,12 @@ def run_parser(
41
43
  "No files or parsers to parse. Please provide valid file paths or contact an Admin to add missing parser."
42
44
  )
43
45
  return
46
+ # Ensure collection_type is valid
47
+ if collection_type not in ["COLLECTION", "DEFAULT_EXPERIMENT"]:
48
+ logger.error(
49
+ f"Invalid collection_type '{collection_type}'. Must be either 'COLLECTION' or 'DEFAULT_EXPERIMENT'."
50
+ )
51
+ return
44
52
 
45
53
  # Specify the space
46
54
  try:
@@ -91,7 +99,7 @@ def run_parser(
91
99
  logger.info("Replacing collection code with uppercase and underscores.")
92
100
  collection_openbis = openbis.new_collection(
93
101
  code=collection_name.replace(" ", "_").upper(),
94
- type="DEFAULT_EXPERIMENT",
102
+ type=collection_type,
95
103
  project=project,
96
104
  )
97
105
  collection_openbis.save()
@@ -160,6 +160,8 @@ class MasterdataExcelExtractor:
160
160
  sheet_title=sheet_title,
161
161
  )
162
162
  elif is_data:
163
+ # Normalize data type to uppercase
164
+ val = val.upper()
163
165
  if val not in [dt.value for dt in DataType]:
164
166
  self.logger.error(
165
167
  error_message
@@ -581,10 +583,15 @@ class MasterdataExcelExtractor:
581
583
  "permId": extracted_columns["Code"][i],
582
584
  "code": extracted_columns["Code"][i],
583
585
  }
584
- for attr_key in ["Description", "Url template", "Label", "Official"]:
585
- if extracted_columns.get(attr_key):
586
- value = extracted_columns[attr_key][i]
587
- terms_dict[extracted_columns["Code"][i]][attr_key] = value
586
+ for key, pybis_val in {
587
+ "Description": "descriptions",
588
+ "Url template": "url_template",
589
+ "Label": "label",
590
+ "Official": "official",
591
+ }.items():
592
+ if extracted_columns.get(key):
593
+ value = extracted_columns[key][i]
594
+ terms_dict[extracted_columns["Code"][i]][pybis_val] = value
588
595
 
589
596
  return terms_dict
590
597
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bam-masterdata
3
- Version: 0.8.2
3
+ Version: 0.8.4
4
4
  Summary: The BAM Data Store utility tools and masterdata models wrapped in a Python package with a front-end web interface.
5
5
  Author-email: BAM Data Store <datastore@bam.de>
6
6
  Maintainer-email: "Jose M. Pizarro" <jose.pizarro-blanco@bam.de>
@@ -33,7 +33,6 @@ bam_masterdata/cli/__init__.py
33
33
  bam_masterdata/cli/cli.py
34
34
  bam_masterdata/cli/entities_to_excel.py
35
35
  bam_masterdata/cli/entities_to_rdf.py
36
- bam_masterdata/cli/excel_to_entities.py
37
36
  bam_masterdata/cli/fill_masterdata.py
38
37
  bam_masterdata/cli/run_parser.py
39
38
  bam_masterdata/datamodel/__init__.py
@@ -52,6 +52,7 @@ The **References** include a glossary of terms and the automatically generated A
52
52
 
53
53
  - [Glossary](references/glossary.md)
54
54
  - [API Reference](references/api.md)
55
+ - [Extra](references/extra.md)
55
56
 
56
57
  </div>
57
58
 
@@ -62,7 +62,7 @@ cli/
62
62
 
63
63
  ---
64
64
 
65
- ::: bam_masterdata.cli.excel_to_entities
65
+ ::: bam_masterdata.excel.excel_to_entities
66
66
  options:
67
67
  show_root_heading: true
68
68
  members:
@@ -189,4 +189,4 @@ utils/
189
189
  options:
190
190
  show_root_heading: true
191
191
 
192
- ---
192
+ ---
@@ -367,16 +367,17 @@ for obj_code, obj_data in object_types.items():
367
367
 
368
368
  ```bash
369
369
  # Export all masterdata to Excel
370
- bam-masterdata export-to-excel masterdata_export.xlsx
370
+ bam_masterdata export_to_excel masterdata_export.xlsx
371
371
 
372
372
  # Export specific entity types to JSON
373
- bam-masterdata export-to-json --entity-types object_types dataset_types output.json
373
+ bam_masterdata export_to_json --entity-types object_types dataset_types output.json
374
374
 
375
375
  # Run consistency checker
376
- bam-masterdata checker --verbose
376
+ bam_masterdata checker --verbose
377
377
 
378
378
  # Fill masterdata from OpenBIS
379
- bam-masterdata fill-masterdata --url https://openbis.example.com --username user
379
+ # environment variables OPENBIS_USERNAME and OPENBIS_PASSWORD are required for authentication
380
+ bam_masterdata fill_masterdata --url https://openbis.example.com
380
381
  ```
381
382
 
382
383
  ### How to Generate Code from Masterdata
@@ -503,4 +504,4 @@ for entity_data in batch_data:
503
504
 
504
505
  # Create all at once
505
506
  result = openbis.create_objects(entities_to_create)
506
- ```
507
+ ```
@@ -54,6 +54,7 @@ The whole process then depends on the inputs and output `run_parser()`:
54
54
  - `space_name`: _string_, this coincides with the space name you have associated in your openBIS instance
55
55
  - `project_name`: _string_, the name of the project where you want to store the parsed objects
56
56
  - `collection_name`: _string_, optional, the name of the collection you want to store the parsed objects
57
+ - `collection_type`: _string_, optional, the type of collection to create in openBIS. Options are `"COLLECTION"` or `"DEFAULT_EXPERIMENT"`. Defaults to `"COLLECTION"`.
57
58
  - `files_parser`: _dict_, a dictionary where the keys are the parser class instances (see below) and the values are the files you want to pass to the specific parser class
58
59
  - **Output**: the metadata objects and relationships mapped to your space/project/collection in openBIS
59
60
 
@@ -193,10 +194,18 @@ run_parser(
193
194
  space_name="MY_RESEARCH_SPACE",
194
195
  project_name="MY_PROJECT",
195
196
  collection_name="MY_EXPERIMENT_COLLECTION",
196
- files_parser=files_parser
197
+ files_parser=files_parser,
198
+ collection_type="COLLECTION" # Optional: defaults to "COLLECTION"
197
199
  )
198
200
  ```
199
201
 
202
+ !!! tip "Collection Types"
203
+ You can choose between two collection types:
204
+ - `"COLLECTION"` (default): A general-purpose collection type
205
+ - `"DEFAULT_EXPERIMENT"`: A collection type designed for experiments with additional metadata fields like start/end dates, experimental goals, etc.
206
+
207
+ If you don't specify `collection_type`, it defaults to `"COLLECTION"`. We recommend keeping the default `collection_type`, as future openBIS releases will get rid of the collection concept and we will, as a result, deprecate this feature.
208
+
200
209
  ### What Happens Next?
201
210
 
202
211
  When you call `run_parser()`, the following steps occur automatically:
@@ -235,7 +244,7 @@ run_parser(
235
244
  space_name="MY_RESEARCH_SPACE",
236
245
  project_name="MY_PROJECT",
237
246
  collection_name="MULTI_DATA_COLLECTION",
238
- files_parser=files_parser
247
+ files_parser=files_parser,
239
248
  )
240
249
  ```
241
250
 
@@ -456,7 +465,7 @@ def main():
456
465
  space_name="RESEARCH_SPACE",
457
466
  project_name="AUTOMATION_TEST",
458
467
  collection_name="BATCH_EXPERIMENTS",
459
- files_parser=files_parser
468
+ files_parser=files_parser,
460
469
  )
461
470
 
462
471
  print("Metadata injection complete!")
@@ -67,6 +67,7 @@ def test_run_parser_with_test_parser(cleared_log_storage, mock_openbis):
67
67
  project_name="TEST_PROJECT",
68
68
  collection_name="TEST_COLLECTION",
69
69
  files_parser=files_parser,
70
+ collection_type="COLLECTION",
70
71
  )
71
72
 
72
73
  # Check that objects were created in openbis
@@ -105,6 +106,7 @@ def test_run_parser_with_object_reference(cleared_log_storage, mock_openbis):
105
106
  project_name="TEST_PROJECT",
106
107
  collection_name="TEST_COLLECTION",
107
108
  files_parser=files_parser,
109
+ collection_type="COLLECTION",
108
110
  )
109
111
 
110
112
  # Only 2 instruments are created (the person is referenced but not persisted)
@@ -122,4 +124,44 @@ def test_run_parser_with_object_reference(cleared_log_storage, mock_openbis):
122
124
  )
123
125
 
124
126
 
127
+ def test_run_parser_with_default_experiment_type(cleared_log_storage, mock_openbis):
128
+ """Test run_parser with DEFAULT_EXPERIMENT collection type."""
129
+ file = "./tests/data/cli/test_parser.txt"
130
+ files_parser = {TestParser(): [file]}
131
+ run_parser(
132
+ openbis=mock_openbis,
133
+ space_name="USERNAME_SPACE",
134
+ project_name="TEST_PROJECT",
135
+ collection_name="TEST_COLLECTION",
136
+ files_parser=files_parser,
137
+ collection_type="DEFAULT_EXPERIMENT",
138
+ )
139
+
140
+ # Check that objects were created in openbis
141
+ assert len(mock_openbis._objects) == 1
142
+
143
+ # Check logs for success messages
144
+ assert any("Added test object" in log["event"] for log in cleared_log_storage)
145
+
146
+
147
+ def test_run_parser_defaults_to_collection_type(cleared_log_storage, mock_openbis):
148
+ """Test that run_parser defaults to COLLECTION type when not specified."""
149
+ file = "./tests/data/cli/test_parser.txt"
150
+ files_parser = {TestParser(): [file]}
151
+ # Call without specifying collection_type - should default to "COLLECTION"
152
+ run_parser(
153
+ openbis=mock_openbis,
154
+ space_name="USERNAME_SPACE",
155
+ project_name="TEST_PROJECT",
156
+ collection_name="TEST_COLLECTION",
157
+ files_parser=files_parser,
158
+ )
159
+
160
+ # Check that objects were created in openbis
161
+ assert len(mock_openbis._objects) == 1
162
+
163
+ # Check logs for success messages
164
+ assert any("Added test object" in log["event"] for log in cleared_log_storage)
165
+
166
+
125
167
  # TODO add other tests for the different situations in `run_parser()` and parsers from `conftest.py`