oarepo-runtime 1.10.3__tar.gz → 2.0.0.dev4__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 (199) hide show
  1. oarepo_runtime-2.0.0.dev4/.gitignore +382 -0
  2. {oarepo_runtime-1.10.3/oarepo_runtime.egg-info → oarepo_runtime-2.0.0.dev4}/PKG-INFO +10 -21
  3. oarepo_runtime-2.0.0.dev4/oarepo_runtime/__init__.py +24 -0
  4. oarepo_runtime-2.0.0.dev4/oarepo_runtime/api.py +210 -0
  5. oarepo_runtime-2.0.0.dev4/oarepo_runtime/cli/__init__.py +11 -0
  6. oarepo_runtime-2.0.0.dev4/oarepo_runtime/cli/search.py +34 -0
  7. oarepo_runtime-2.0.0.dev4/oarepo_runtime/config.py +104 -0
  8. oarepo_runtime-2.0.0.dev4/oarepo_runtime/ext.py +84 -0
  9. oarepo_runtime-2.0.0.dev4/oarepo_runtime/proxies.py +24 -0
  10. oarepo_runtime-2.0.0.dev4/oarepo_runtime/records/__init__.py +11 -0
  11. oarepo_runtime-2.0.0.dev4/oarepo_runtime/records/drafts.py +48 -0
  12. oarepo_runtime-2.0.0.dev4/oarepo_runtime/records/mapping.py +84 -0
  13. oarepo_runtime-2.0.0.dev4/oarepo_runtime/records/pid_providers.py +58 -0
  14. oarepo_runtime-2.0.0.dev4/oarepo_runtime/records/systemfields/__init__.py +16 -0
  15. oarepo_runtime-2.0.0.dev4/oarepo_runtime/records/systemfields/mapping.py +56 -0
  16. oarepo_runtime-2.0.0.dev4/oarepo_runtime/records/systemfields/publication_status.py +61 -0
  17. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/__init__.py +12 -0
  18. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/config/__init__.py +29 -0
  19. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/config/link_conditions.py +120 -0
  20. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/config/permissions.py +62 -0
  21. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/facets/__init__.py +12 -0
  22. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/facets/params.py +127 -0
  23. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/records/__init__.py +16 -0
  24. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/records/links.py +31 -0
  25. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/records/mapping.py +42 -0
  26. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/results.py +184 -0
  27. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/schema/__init__.py +12 -0
  28. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/schema/i18n.py +101 -0
  29. oarepo_runtime-2.0.0.dev4/oarepo_runtime/services/schema/i18n_ui.py +119 -0
  30. oarepo_runtime-2.0.0.dev4/pyproject.toml +48 -0
  31. oarepo_runtime-1.10.3/MANIFEST.in +0 -3
  32. oarepo_runtime-1.10.3/PKG-INFO +0 -175
  33. oarepo_runtime-1.10.3/oarepo_runtime/__init__.py +0 -0
  34. oarepo_runtime-1.10.3/oarepo_runtime/cli/__init__.py +0 -22
  35. oarepo_runtime-1.10.3/oarepo_runtime/cli/assets.py +0 -145
  36. oarepo_runtime-1.10.3/oarepo_runtime/cli/base.py +0 -25
  37. oarepo_runtime-1.10.3/oarepo_runtime/cli/cf.py +0 -15
  38. oarepo_runtime-1.10.3/oarepo_runtime/cli/check.py +0 -167
  39. oarepo_runtime-1.10.3/oarepo_runtime/cli/configuration.py +0 -51
  40. oarepo_runtime-1.10.3/oarepo_runtime/cli/fixtures.py +0 -167
  41. oarepo_runtime-1.10.3/oarepo_runtime/cli/index.py +0 -272
  42. oarepo_runtime-1.10.3/oarepo_runtime/cli/permissions/__init__.py +0 -6
  43. oarepo_runtime-1.10.3/oarepo_runtime/cli/permissions/base.py +0 -26
  44. oarepo_runtime-1.10.3/oarepo_runtime/cli/permissions/evaluate.py +0 -63
  45. oarepo_runtime-1.10.3/oarepo_runtime/cli/permissions/list.py +0 -239
  46. oarepo_runtime-1.10.3/oarepo_runtime/cli/permissions/search.py +0 -121
  47. oarepo_runtime-1.10.3/oarepo_runtime/cli/validate.py +0 -150
  48. oarepo_runtime-1.10.3/oarepo_runtime/config.py +0 -19
  49. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/__init__.py +0 -38
  50. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/asynchronous.py +0 -247
  51. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/catalogue.py +0 -150
  52. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/datastreams.py +0 -152
  53. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/errors.py +0 -54
  54. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/ext.py +0 -41
  55. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/fixtures.py +0 -265
  56. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/json.py +0 -4
  57. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/readers/__init__.py +0 -39
  58. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/readers/attachments.py +0 -51
  59. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/readers/excel.py +0 -123
  60. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/readers/json.py +0 -27
  61. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/readers/service.py +0 -54
  62. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/readers/yaml.py +0 -14
  63. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/semi_asynchronous.py +0 -91
  64. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/synchronous.py +0 -70
  65. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/transformers.py +0 -18
  66. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/types.py +0 -323
  67. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/utils.py +0 -131
  68. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/writers/__init__.py +0 -21
  69. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/writers/attachments_file.py +0 -92
  70. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/writers/attachments_service.py +0 -118
  71. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/writers/publish.py +0 -70
  72. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/writers/service.py +0 -175
  73. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/writers/utils.py +0 -30
  74. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/writers/validation_errors.py +0 -20
  75. oarepo_runtime-1.10.3/oarepo_runtime/datastreams/writers/yaml.py +0 -56
  76. oarepo_runtime-1.10.3/oarepo_runtime/ext.py +0 -102
  77. oarepo_runtime-1.10.3/oarepo_runtime/ext_config.py +0 -67
  78. oarepo_runtime-1.10.3/oarepo_runtime/i18n/__init__.py +0 -3
  79. oarepo_runtime-1.10.3/oarepo_runtime/info/__init__.py +0 -0
  80. oarepo_runtime-1.10.3/oarepo_runtime/info/check.py +0 -95
  81. oarepo_runtime-1.10.3/oarepo_runtime/info/permissions/__init__.py +0 -0
  82. oarepo_runtime-1.10.3/oarepo_runtime/info/permissions/debug.py +0 -191
  83. oarepo_runtime-1.10.3/oarepo_runtime/info/views.py +0 -586
  84. oarepo_runtime-1.10.3/oarepo_runtime/profile.py +0 -60
  85. oarepo_runtime-1.10.3/oarepo_runtime/proxies.py +0 -8
  86. oarepo_runtime-1.10.3/oarepo_runtime/records/__init__.py +0 -50
  87. oarepo_runtime-1.10.3/oarepo_runtime/records/drafts.py +0 -42
  88. oarepo_runtime-1.10.3/oarepo_runtime/records/dumpers/__init__.py +0 -8
  89. oarepo_runtime-1.10.3/oarepo_runtime/records/dumpers/edtf_interval.py +0 -38
  90. oarepo_runtime-1.10.3/oarepo_runtime/records/dumpers/multilingual_dumper.py +0 -34
  91. oarepo_runtime-1.10.3/oarepo_runtime/records/entity_resolvers/__init__.py +0 -13
  92. oarepo_runtime-1.10.3/oarepo_runtime/records/entity_resolvers/proxies.py +0 -57
  93. oarepo_runtime-1.10.3/oarepo_runtime/records/mappings/__init__.py +0 -0
  94. oarepo_runtime-1.10.3/oarepo_runtime/records/mappings/rdm_parent_mapping.json +0 -483
  95. oarepo_runtime-1.10.3/oarepo_runtime/records/owners/__init__.py +0 -3
  96. oarepo_runtime-1.10.3/oarepo_runtime/records/owners/registry.py +0 -22
  97. oarepo_runtime-1.10.3/oarepo_runtime/records/pid_providers.py +0 -22
  98. oarepo_runtime-1.10.3/oarepo_runtime/records/relations/__init__.py +0 -22
  99. oarepo_runtime-1.10.3/oarepo_runtime/records/relations/base.py +0 -296
  100. oarepo_runtime-1.10.3/oarepo_runtime/records/relations/internal.py +0 -46
  101. oarepo_runtime-1.10.3/oarepo_runtime/records/relations/lookup.py +0 -28
  102. oarepo_runtime-1.10.3/oarepo_runtime/records/relations/pid_relation.py +0 -102
  103. oarepo_runtime-1.10.3/oarepo_runtime/records/systemfields/__init__.py +0 -34
  104. oarepo_runtime-1.10.3/oarepo_runtime/records/systemfields/featured_file.py +0 -45
  105. oarepo_runtime-1.10.3/oarepo_runtime/records/systemfields/has_draftcheck.py +0 -47
  106. oarepo_runtime-1.10.3/oarepo_runtime/records/systemfields/icu.py +0 -371
  107. oarepo_runtime-1.10.3/oarepo_runtime/records/systemfields/mapping.py +0 -39
  108. oarepo_runtime-1.10.3/oarepo_runtime/records/systemfields/owner.py +0 -115
  109. oarepo_runtime-1.10.3/oarepo_runtime/records/systemfields/record_status.py +0 -35
  110. oarepo_runtime-1.10.3/oarepo_runtime/records/systemfields/selectors.py +0 -98
  111. oarepo_runtime-1.10.3/oarepo_runtime/records/systemfields/synthetic.py +0 -130
  112. oarepo_runtime-1.10.3/oarepo_runtime/resources/__init__.py +0 -4
  113. oarepo_runtime-1.10.3/oarepo_runtime/resources/config.py +0 -12
  114. oarepo_runtime-1.10.3/oarepo_runtime/resources/file_resource.py +0 -15
  115. oarepo_runtime-1.10.3/oarepo_runtime/resources/json_serializer.py +0 -27
  116. oarepo_runtime-1.10.3/oarepo_runtime/resources/localized_ui_json_serializer.py +0 -54
  117. oarepo_runtime-1.10.3/oarepo_runtime/resources/resource.py +0 -53
  118. oarepo_runtime-1.10.3/oarepo_runtime/resources/responses.py +0 -20
  119. oarepo_runtime-1.10.3/oarepo_runtime/services/__init__.py +0 -0
  120. oarepo_runtime-1.10.3/oarepo_runtime/services/components.py +0 -429
  121. oarepo_runtime-1.10.3/oarepo_runtime/services/config/__init__.py +0 -35
  122. oarepo_runtime-1.10.3/oarepo_runtime/services/config/draft_link.py +0 -23
  123. oarepo_runtime-1.10.3/oarepo_runtime/services/config/link_conditions.py +0 -126
  124. oarepo_runtime-1.10.3/oarepo_runtime/services/config/permissions_presets.py +0 -174
  125. oarepo_runtime-1.10.3/oarepo_runtime/services/config/service.py +0 -117
  126. oarepo_runtime-1.10.3/oarepo_runtime/services/custom_fields/__init__.py +0 -80
  127. oarepo_runtime-1.10.3/oarepo_runtime/services/custom_fields/mappings.py +0 -188
  128. oarepo_runtime-1.10.3/oarepo_runtime/services/entity/__init__.py +0 -0
  129. oarepo_runtime-1.10.3/oarepo_runtime/services/entity/config.py +0 -14
  130. oarepo_runtime-1.10.3/oarepo_runtime/services/entity/schema.py +0 -9
  131. oarepo_runtime-1.10.3/oarepo_runtime/services/entity/service.py +0 -48
  132. oarepo_runtime-1.10.3/oarepo_runtime/services/expansions/__init__.py +0 -0
  133. oarepo_runtime-1.10.3/oarepo_runtime/services/expansions/expandable_fields.py +0 -21
  134. oarepo_runtime-1.10.3/oarepo_runtime/services/expansions/service.py +0 -4
  135. oarepo_runtime-1.10.3/oarepo_runtime/services/facets/__init__.py +0 -33
  136. oarepo_runtime-1.10.3/oarepo_runtime/services/facets/base.py +0 -12
  137. oarepo_runtime-1.10.3/oarepo_runtime/services/facets/date.py +0 -72
  138. oarepo_runtime-1.10.3/oarepo_runtime/services/facets/enum.py +0 -11
  139. oarepo_runtime-1.10.3/oarepo_runtime/services/facets/facet_groups_names.py +0 -17
  140. oarepo_runtime-1.10.3/oarepo_runtime/services/facets/max_facet.py +0 -13
  141. oarepo_runtime-1.10.3/oarepo_runtime/services/facets/multilingual_facet.py +0 -33
  142. oarepo_runtime-1.10.3/oarepo_runtime/services/facets/nested_facet.py +0 -32
  143. oarepo_runtime-1.10.3/oarepo_runtime/services/facets/params.py +0 -192
  144. oarepo_runtime-1.10.3/oarepo_runtime/services/facets/year_histogram.py +0 -200
  145. oarepo_runtime-1.10.3/oarepo_runtime/services/files/__init__.py +0 -8
  146. oarepo_runtime-1.10.3/oarepo_runtime/services/files/components.py +0 -62
  147. oarepo_runtime-1.10.3/oarepo_runtime/services/files/service.py +0 -16
  148. oarepo_runtime-1.10.3/oarepo_runtime/services/generators.py +0 -10
  149. oarepo_runtime-1.10.3/oarepo_runtime/services/permissions/__init__.py +0 -3
  150. oarepo_runtime-1.10.3/oarepo_runtime/services/permissions/generators.py +0 -103
  151. oarepo_runtime-1.10.3/oarepo_runtime/services/records/__init__.py +0 -3
  152. oarepo_runtime-1.10.3/oarepo_runtime/services/records/links.py +0 -21
  153. oarepo_runtime-1.10.3/oarepo_runtime/services/relations/__init__.py +0 -0
  154. oarepo_runtime-1.10.3/oarepo_runtime/services/relations/components.py +0 -15
  155. oarepo_runtime-1.10.3/oarepo_runtime/services/relations/errors.py +0 -18
  156. oarepo_runtime-1.10.3/oarepo_runtime/services/relations/mapping.py +0 -38
  157. oarepo_runtime-1.10.3/oarepo_runtime/services/results.py +0 -195
  158. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/__init__.py +0 -44
  159. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/cf.py +0 -13
  160. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/i18n.py +0 -76
  161. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/i18n_ui.py +0 -82
  162. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/i18n_validation.py +0 -7
  163. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/marshmallow.py +0 -44
  164. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/marshmallow_to_json_schema.py +0 -72
  165. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/oneofschema.py +0 -192
  166. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/polymorphic.py +0 -21
  167. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/rdm.py +0 -146
  168. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/rdm_ui.py +0 -156
  169. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/ui.py +0 -251
  170. oarepo_runtime-1.10.3/oarepo_runtime/services/schema/validation.py +0 -70
  171. oarepo_runtime-1.10.3/oarepo_runtime/services/search.py +0 -282
  172. oarepo_runtime-1.10.3/oarepo_runtime/services/service.py +0 -61
  173. oarepo_runtime-1.10.3/oarepo_runtime/tasks.py +0 -6
  174. oarepo_runtime-1.10.3/oarepo_runtime/translations/cs/LC_MESSAGES/messages.mo +0 -0
  175. oarepo_runtime-1.10.3/oarepo_runtime/translations/cs/LC_MESSAGES/messages.po +0 -95
  176. oarepo_runtime-1.10.3/oarepo_runtime/translations/default_translations.py +0 -6
  177. oarepo_runtime-1.10.3/oarepo_runtime/translations/en/LC_MESSAGES/messages.mo +0 -0
  178. oarepo_runtime-1.10.3/oarepo_runtime/translations/en/LC_MESSAGES/messages.po +0 -97
  179. oarepo_runtime-1.10.3/oarepo_runtime/translations/messages.pot +0 -100
  180. oarepo_runtime-1.10.3/oarepo_runtime/uow.py +0 -146
  181. oarepo_runtime-1.10.3/oarepo_runtime/utils/__init__.py +0 -0
  182. oarepo_runtime-1.10.3/oarepo_runtime/utils/functools.py +0 -37
  183. oarepo_runtime-1.10.3/oarepo_runtime/utils/identity_utils.py +0 -35
  184. oarepo_runtime-1.10.3/oarepo_runtime/utils/index.py +0 -11
  185. oarepo_runtime-1.10.3/oarepo_runtime/utils/path.py +0 -97
  186. oarepo_runtime-1.10.3/oarepo_runtime.egg-info/SOURCES.txt +0 -169
  187. oarepo_runtime-1.10.3/oarepo_runtime.egg-info/dependency_links.txt +0 -1
  188. oarepo_runtime-1.10.3/oarepo_runtime.egg-info/entry_points.txt +0 -16
  189. oarepo_runtime-1.10.3/oarepo_runtime.egg-info/requires.txt +0 -21
  190. oarepo_runtime-1.10.3/oarepo_runtime.egg-info/top_level.txt +0 -2
  191. oarepo_runtime-1.10.3/pyproject.toml +0 -3
  192. oarepo_runtime-1.10.3/setup.cfg +0 -64
  193. oarepo_runtime-1.10.3/setup.py +0 -3
  194. oarepo_runtime-1.10.3/tests/marshmallow_to_json/__init__.py +0 -0
  195. oarepo_runtime-1.10.3/tests/marshmallow_to_json/test_datacite_ui_schema.py +0 -1410
  196. oarepo_runtime-1.10.3/tests/marshmallow_to_json/test_simple_schema.py +0 -52
  197. oarepo_runtime-1.10.3/tests/pkg_data/__init__.py +0 -0
  198. {oarepo_runtime-1.10.3 → oarepo_runtime-2.0.0.dev4}/LICENSE +0 -0
  199. {oarepo_runtime-1.10.3 → oarepo_runtime-2.0.0.dev4}/README.md +0 -0
@@ -0,0 +1,382 @@
1
+ #
2
+ # Python gitignore
3
+ #
4
+
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[codz]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ coverage.json
53
+ *.cover
54
+ *.py.cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+ cover/
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # UV
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ #uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ #poetry.lock
110
+ #poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ #pdm.lock
117
+ #pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ #pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi
127
+
128
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
129
+ __pypackages__/
130
+
131
+ # Celery stuff
132
+ celerybeat-schedule
133
+ celerybeat.pid
134
+
135
+ # SageMath parsed files
136
+ *.sage.py
137
+
138
+ # Environments
139
+ .env
140
+ .envrc
141
+ .venv
142
+ env/
143
+ venv/
144
+ ENV/
145
+ env.bak/
146
+ venv.bak/
147
+
148
+ # Spyder project settings
149
+ .spyderproject
150
+ .spyproject
151
+
152
+ # Rope project settings
153
+ .ropeproject
154
+
155
+ # mkdocs documentation
156
+ /site
157
+
158
+ # mypy
159
+ .mypy_cache/
160
+ .mypy.ini
161
+ .dmypy.json
162
+ dmypy.json
163
+
164
+ # Pyre type checker
165
+ .pyre/
166
+
167
+ # pytype static type analyzer
168
+ .pytype/
169
+
170
+ # Cython debug symbols
171
+ cython_debug/
172
+
173
+ # PyCharm
174
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
175
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
176
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
177
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
178
+ #.idea/
179
+
180
+ # Abstra
181
+ # Abstra is an AI-powered process automation framework.
182
+ # Ignore directories containing user credentials, local state, and settings.
183
+ # Learn more at https://abstra.io/docs
184
+ .abstra/
185
+
186
+ # Visual Studio Code
187
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
188
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
189
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
190
+ # you could uncomment the following to ignore the entire vscode folder
191
+ # .vscode/
192
+
193
+ # Ruff stuff:
194
+ .ruff.toml
195
+ .ruff_cache/
196
+ .mypy.ini
197
+
198
+ # PyPI configuration file
199
+ .pypirc
200
+
201
+ # Marimo
202
+ marimo/_static/
203
+ marimo/_lsp/
204
+ __marimo__/
205
+
206
+ # Streamlit
207
+ .streamlit/secrets.toml
208
+
209
+ # UV package management
210
+ uv.lock
211
+
212
+ #
213
+ # Node.js gitignore
214
+ #
215
+ # Logs
216
+ logs
217
+ *.log
218
+ npm-debug.log*
219
+ yarn-debug.log*
220
+ yarn-error.log*
221
+ lerna-debug.log*
222
+
223
+ # Diagnostic reports (https://nodejs.org/api/report.html)
224
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
225
+
226
+ # Runtime data
227
+ pids
228
+ *.pid
229
+ *.seed
230
+ *.pid.lock
231
+
232
+ # Directory for instrumented libs generated by jscoverage/JSCover
233
+ lib-cov
234
+
235
+ # Coverage directory used by tools like istanbul
236
+ coverage
237
+ *.lcov
238
+
239
+ # nyc test coverage
240
+ .nyc_output
241
+
242
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
243
+ .grunt
244
+
245
+ # Bower dependency directory (https://bower.io/)
246
+ bower_components
247
+
248
+ # node-waf configuration
249
+ .lock-wscript
250
+
251
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
252
+ build/Release
253
+
254
+ # Dependency directories
255
+ node_modules/
256
+ jspm_packages/
257
+
258
+ # Snowpack dependency directory (https://snowpack.dev/)
259
+ web_modules/
260
+
261
+ # TypeScript cache
262
+ *.tsbuildinfo
263
+
264
+ # Optional npm cache directory
265
+ .npm
266
+
267
+ # Optional eslint cache
268
+ .eslintcache
269
+
270
+ # Optional stylelint cache
271
+ .stylelintcache
272
+
273
+ # Optional REPL history
274
+ .node_repl_history
275
+
276
+ # Output of 'npm pack'
277
+ *.tgz
278
+
279
+ # Yarn Integrity file
280
+ .yarn-integrity
281
+
282
+ # dotenv environment variable files
283
+ .env
284
+ .env.*
285
+ !.env.example
286
+
287
+ # parcel-bundler cache (https://parceljs.org/)
288
+ .cache
289
+ .parcel-cache
290
+
291
+ # Next.js build output
292
+ .next
293
+ out
294
+
295
+ # Nuxt.js build / generate output
296
+ .nuxt
297
+ dist
298
+
299
+ # Gatsby files
300
+ .cache/
301
+ # Comment in the public line in if your project uses Gatsby and not Next.js
302
+ # https://nextjs.org/blog/next-9-1#public-directory-support
303
+ # public
304
+
305
+ # vuepress build output
306
+ .vuepress/dist
307
+
308
+ # vuepress v2.x temp and cache directory
309
+ .temp
310
+ .cache
311
+
312
+ # Sveltekit cache directory
313
+ .svelte-kit/
314
+
315
+ # vitepress build output
316
+ **/.vitepress/dist
317
+
318
+ # vitepress cache directory
319
+ **/.vitepress/cache
320
+
321
+ # Docusaurus cache and generated files
322
+ .docusaurus
323
+
324
+ # Serverless directories
325
+ .serverless/
326
+
327
+ # FuseBox cache
328
+ .fusebox/
329
+
330
+ # DynamoDB Local files
331
+ .dynamodb/
332
+
333
+ # Firebase cache directory
334
+ .firebase/
335
+
336
+ # TernJS port file
337
+ .tern-port
338
+
339
+ # Stores VSCode versions used for testing VSCode extensions
340
+ .vscode-test
341
+
342
+ # yarn v3
343
+ .pnp.*
344
+ .yarn/*
345
+ !.yarn/patches
346
+ !.yarn/plugins
347
+ !.yarn/releases
348
+ !.yarn/sdks
349
+ !.yarn/versions
350
+
351
+ # Vite logs files
352
+ vite.config.js.timestamp-*
353
+ vite.config.ts.timestamp-*
354
+
355
+ #
356
+ # OARepo specific gitignore
357
+ #
358
+ .runner.sh
359
+ .env-services
360
+ .eslintrc.yaml
361
+ .mypy.ini
362
+ .ruff.toml
363
+
364
+ #
365
+ # Editors
366
+ .vscode/
367
+ .idea/
368
+ *.swp
369
+ *.swo
370
+ *.swn
371
+ *.sublime-workspace
372
+ *.sublime-project
373
+ *.kate-swp
374
+ *.kate-swp.*
375
+ *.komodoproject
376
+ *.komodotools
377
+ *.komodoide
378
+ *.komodotools
379
+ *.komodotools.*
380
+ .DS_Store
381
+ *.DS_Store?
382
+ #
@@ -1,29 +1,18 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oarepo-runtime
3
- Version: 1.10.3
3
+ Version: 2.0.0.dev4
4
4
  Summary: A set of runtime extensions of Invenio repository
5
- Description-Content-Type: text/markdown
5
+ Project-URL: Homepage, https://github.com/oarepo/oarepo-runtime
6
+ License-Expression: MIT
6
7
  License-File: LICENSE
7
- Requires-Dist: marshmallow
8
- Requires-Dist: langcodes
9
- Requires-Dist: pyyaml
10
- Requires-Dist: openpyxl
11
- Requires-Dist: flask-babelex
12
- Requires-Dist: deepmerge
13
- Requires-Dist: tqdm
14
- Requires-Dist: deprecated
15
- Requires-Dist: idutils
8
+ Requires-Python: <3.14,>=3.13
9
+ Requires-Dist: langcodes>=3.5.0
10
+ Requires-Dist: oarepo[rdm,tests]<14,>=13
16
11
  Provides-Extra: dev
17
- Requires-Dist: pytest>=7.1.2; extra == "dev"
18
- Requires-Dist: black; extra == "dev"
19
- Requires-Dist: isort; extra == "dev"
20
- Requires-Dist: autoflake; extra == "dev"
21
- Requires-Dist: oarepo-tools; extra == "dev"
12
+ Requires-Dist: pytest>=7.1.2; extra == 'dev'
22
13
  Provides-Extra: tests
23
- Requires-Dist: pytest>=7.1.2; extra == "tests"
24
- Requires-Dist: pytest-oarepo; extra == "tests"
25
- Requires-Dist: psutil; extra == "tests"
26
- Dynamic: license-file
14
+ Requires-Dist: pytest>=7.1.2; extra == 'tests'
15
+ Description-Content-Type: text/markdown
27
16
 
28
17
  # OARepo runtime
29
18
 
@@ -172,4 +161,4 @@ Will print/write to file a json with the following format:
172
161
  ```
173
162
  ```json
174
163
 
175
- ```
164
+ ```
@@ -0,0 +1,24 @@
1
+ #
2
+ # Copyright (c) 2025 CESNET z.s.p.o.
3
+ #
4
+ # This file is a part of oarepo-runtime (see http://github.com/oarepo/oarepo-runtime).
5
+ #
6
+ # oarepo-runtime is free software; you can redistribute it and/or modify it
7
+ # under the terms of the MIT License; see LICENSE file for more details.
8
+ #
9
+
10
+ """OARepo Runtime package.
11
+
12
+ This package provides support for custom fields identification and iteration and `invenio oarepo cf init`
13
+ initialization tool for customfields.
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ from .api import Model
19
+ from .ext import OARepoRuntime
20
+ from .proxies import current_runtime
21
+
22
+ __version__ = "2.0.0dev4"
23
+
24
+ __all__ = ("Model", "OARepoRuntime", "__version__", "current_runtime")
@@ -0,0 +1,210 @@
1
+ #
2
+ # Copyright (c) 2025 CESNET z.s.p.o.
3
+ #
4
+ # This file is a part of oarepo-runtime (see http://github.com/oarepo/oarepo-runtime).
5
+ #
6
+ # oarepo-runtime is free software; you can redistribute it and/or modify it
7
+ # under the terms of the MIT License; see LICENSE file for more details.
8
+ #
9
+
10
+ """Runtime API classes that are returned from the current_runtime instance."""
11
+
12
+ from __future__ import annotations
13
+
14
+ import dataclasses
15
+ from functools import cached_property
16
+ from typing import TYPE_CHECKING, cast
17
+
18
+ from flask import current_app
19
+ from invenio_base.utils import obj_or_import_string
20
+ from invenio_records_resources.proxies import current_service_registry
21
+
22
+ if TYPE_CHECKING:
23
+ from flask_babel.speaklater import LazyString
24
+ from flask_resources.responses import ResponseHandler
25
+ from flask_resources.serializers import BaseSerializer
26
+ from invenio_drafts_resources.records.api import Draft
27
+ from invenio_records_resources.records.api import RecordBase
28
+ from invenio_records_resources.resources.records.config import RecordResourceConfig
29
+ from invenio_records_resources.resources.records.resource import RecordResource
30
+ from invenio_records_resources.services import RecordService, RecordServiceConfig
31
+
32
+
33
+ @dataclasses.dataclass
34
+ class Export:
35
+ """Configuration of an export format.
36
+
37
+ Exports are shown on the record landing page and user can download them.
38
+ """
39
+
40
+ name: LazyString
41
+ """Name of the export format, human readable."""
42
+
43
+ mimetype: str
44
+ """MIME type of the export format."""
45
+
46
+ serializer: BaseSerializer
47
+ """Serializer used to serialize the record into the export format."""
48
+
49
+ display: bool = True
50
+ """Whether the export format is displayed in the UI."""
51
+
52
+ oai_metadata_prefix: str | None = None
53
+ """OAI metadata prefix, if applicable. If not set, the export can not be used in OAI-PMH responses."""
54
+
55
+ oai_schema: str | None = None
56
+ """OAI schema, if applicable. If not set, the export can not be used in OAI-PMH responses."""
57
+
58
+ oai_namespace: str | None = None
59
+ """OAI namespace, if applicable. If not set, the export can not be used in OAI-PMH responses."""
60
+
61
+
62
+ class Model[
63
+ S: RecordService = RecordService,
64
+ C: RecordServiceConfig = RecordServiceConfig,
65
+ R: RecordBase = RecordBase,
66
+ D: Draft = Draft,
67
+ # not sure why this is flagged by pyright as an error
68
+ RR: RecordResource = RecordResource, # pyright: ignore[reportGeneralTypeIssues]
69
+ RC: RecordResourceConfig = RecordResourceConfig,
70
+ ]:
71
+ """Model configuration.
72
+
73
+ Every model in oarepo repository must have this configuration which must be
74
+ registered in the `oarepo.runtime` extension via the OAREPO_MODELS config
75
+ variable.
76
+ """
77
+
78
+ name: str | LazyString
79
+ """Name of the model, human readable."""
80
+
81
+ version: str
82
+ """Version of the model, should be a valid semantic version."""
83
+
84
+ description: str | LazyString | None = None
85
+ """Description of the model, human readable."""
86
+
87
+ records_alias_enabled: bool = False
88
+ """Whether the records alias is enabled for this model. Such models will be searchable
89
+ via the `/api/records` endpoint."""
90
+
91
+ def __init__( # noqa: PLR0913 more attributes as we are creating a config
92
+ self,
93
+ name: str | LazyString,
94
+ version: str,
95
+ service: str | S,
96
+ resource_config: RC | str,
97
+ # params with default values
98
+ service_config: C | None = None,
99
+ description: str | LazyString | None = None,
100
+ record: type[R] | None = None,
101
+ draft: type[D] | None = None,
102
+ resource: str | RR = "invenio_records_resources.resources.records.resource.RecordResource",
103
+ exports: list[Export] | None = None,
104
+ records_alias_enabled: bool = True,
105
+ ):
106
+ """Initialize the model configuration.
107
+
108
+ :param name: Name of the model, human readable.
109
+ :param version: Version of the model, should be a valid semantic version.
110
+ :param description: Description of the model, human readable.
111
+ :param service: Name of the service inside the `current_service_registry` or
112
+ a configured service instance.
113
+ :param service_config: Service configuration, if not provided,
114
+ if will be taken from the service.
115
+ :param record: Record class, if not provided, it will be taken from the service
116
+ configuration.
117
+ :param draft: Draft class, if not provided, it will be taken from the service
118
+ configuration.
119
+ :param resource: Resource class or string import path to the resource class.
120
+ If not provided, it will be taken from the service configuration.
121
+ :param resource_config: Resource configuration, if not provided, it will be
122
+ taken from the resource class.
123
+ :param exports: List of export formats that can be used to export the record.
124
+ If not provided, no exports are available.
125
+ :param records_alias_enabled: Whether the records alias is enabled for this model.
126
+ Such models will be searchable via the `/api/records` endpoint.
127
+ """
128
+ self.name = name
129
+ self.version = version
130
+ self.description = description
131
+ self.records_alias_enabled = records_alias_enabled
132
+
133
+ # lazy getters ...
134
+ self._record = record
135
+ self._draft = draft
136
+ self._service = service
137
+ self._service_config = service_config
138
+ self._resource = resource
139
+ self._resource_config = resource_config
140
+ self._exports = exports or []
141
+
142
+ @property
143
+ def service(self) -> S:
144
+ """Get the service."""
145
+ if isinstance(self._service, str):
146
+ return cast(
147
+ "S",
148
+ current_service_registry.get(self._service), # type: ignore[attr-defined]
149
+ )
150
+ return self._service
151
+
152
+ @property
153
+ def service_config(self) -> C:
154
+ """Get the service configuration."""
155
+ if self._service_config is not None:
156
+ return self._service_config
157
+ return cast("C", self.service.config)
158
+
159
+ @property
160
+ def record_cls(self) -> type[R]:
161
+ """Get the record class."""
162
+ if self._record is None:
163
+ return cast("type[R]", self.service.config.record_cls)
164
+ return self._record
165
+
166
+ @property
167
+ def draft_cls(self) -> type[D] | None:
168
+ """Get the draft class."""
169
+ if self._draft is None:
170
+ if hasattr(self.service.config, "draft_cls"):
171
+ return cast("type[D]", self.service.config.draft_cls)
172
+ return None
173
+ return self._draft
174
+
175
+ @cached_property
176
+ def resource_config(self) -> RC:
177
+ """Get the resource configuration."""
178
+ if isinstance(self._resource_config, str):
179
+ resource_config_class: type[RC] = cast("type[RC]", obj_or_import_string(self._resource_config))
180
+ # need to import it here to avoid circular import issues
181
+ from .config import build_config
182
+
183
+ return build_config(resource_config_class, current_app)
184
+ return self._resource_config
185
+
186
+ @cached_property
187
+ def resource(self) -> RR:
188
+ """Get the resource."""
189
+ if isinstance(self._resource, str):
190
+ resource_class = obj_or_import_string(self._resource)
191
+ if resource_class is None:
192
+ raise ValueError(f"Resource class {self._resource} can not be None.")
193
+ return cast(
194
+ "RR",
195
+ resource_class(
196
+ service=self.service,
197
+ config=self.resource_config,
198
+ ),
199
+ )
200
+ return self._resource
201
+
202
+ @property
203
+ def exports(self) -> list[Export]:
204
+ """Get all exportable response handlers."""
205
+ return self._exports
206
+
207
+ @property
208
+ def response_handlers(self) -> dict[str, ResponseHandler]:
209
+ """Get all response handlers from the resource configuration."""
210
+ return cast("dict[str, ResponseHandler]", self.resource_config.response_handlers)
@@ -0,0 +1,11 @@
1
+ #
2
+ # Copyright (c) 2025 CESNET z.s.p.o.
3
+ #
4
+ # This file is a part of oarepo-runtime (see http://github.com/oarepo/oarepo-runtime).
5
+ #
6
+ # oarepo-runtime is free software; you can redistribute it and/or modify it
7
+ # under the terms of the MIT License; see LICENSE file for more details.
8
+ #
9
+ """OAREPO Runtime CLI module."""
10
+
11
+ from __future__ import annotations
@@ -0,0 +1,34 @@
1
+ #
2
+ # Copyright (c) 2025 CESNET z.s.p.o.
3
+ #
4
+ # This file is a part of oarepo-runtime (see http://github.com/oarepo/oarepo-runtime).
5
+ #
6
+ # oarepo-runtime is free software; you can redistribute it and/or modify it
7
+ # under the terms of the MIT License; see LICENSE file for more details.
8
+ #
9
+ """OARepo extensions to the index command."""
10
+
11
+ from __future__ import annotations
12
+
13
+ import click
14
+ from flask.cli import with_appcontext
15
+ from invenio_search.cli import index, search_version_check
16
+ from invenio_search.cli import init as original_init
17
+
18
+ from oarepo_runtime.services.records.mapping import update_all_records_mappings
19
+
20
+
21
+ @index.command()
22
+ @click.option("--force", is_flag=True, default=False)
23
+ @with_appcontext
24
+ @search_version_check
25
+ @click.pass_context
26
+ def init(ctx: click.Context, force: bool) -> None:
27
+ """Initialize registered aliases and mappings.
28
+
29
+ This command initializes the search indices by creating templates, component templates,
30
+ index templates, and the actual indices. It will also create all dynamic mappings
31
+ defined inside the models.
32
+ """
33
+ ctx.invoke(original_init, force=force)
34
+ update_all_records_mappings()