arctrl 3.0.0a3__py3-none-any.whl

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 (456) hide show
  1. arctrl/__init__.py +18 -0
  2. arctrl/py/CWL/__init__.py +0 -0
  3. arctrl/py/CWL/cwltypes.py +150 -0
  4. arctrl/py/CWL/decode.py +973 -0
  5. arctrl/py/CWL/encode.py +1 -0
  6. arctrl/py/CWL/inputs.py +88 -0
  7. arctrl/py/CWL/outputs.py +85 -0
  8. arctrl/py/CWL/requirements.py +77 -0
  9. arctrl/py/CWL/tool_description.py +103 -0
  10. arctrl/py/CWL/workflow_description.py +104 -0
  11. arctrl/py/CWL/workflow_steps.py +113 -0
  12. arctrl/py/Contract/__init__.py +0 -0
  13. arctrl/py/Contract/arc.py +60 -0
  14. arctrl/py/Contract/arc_assay.py +125 -0
  15. arctrl/py/Contract/arc_investigation.py +88 -0
  16. arctrl/py/Contract/arc_run.py +125 -0
  17. arctrl/py/Contract/arc_study.py +126 -0
  18. arctrl/py/Contract/arc_workflow.py +125 -0
  19. arctrl/py/Contract/contract.py +153 -0
  20. arctrl/py/Contract/datamap.py +372 -0
  21. arctrl/py/Contract/git.py +118 -0
  22. arctrl/py/Contract/validation_packages_config.py +107 -0
  23. arctrl/py/ContractIO/__init__.py +0 -0
  24. arctrl/py/ContractIO/contract_io.py +344 -0
  25. arctrl/py/ContractIO/file_system_helper.py +264 -0
  26. arctrl/py/Core/Helper/__init__.py +0 -0
  27. arctrl/py/Core/Helper/collections_.py +438 -0
  28. arctrl/py/Core/Helper/date_time.py +26 -0
  29. arctrl/py/Core/Helper/hash_codes.py +60 -0
  30. arctrl/py/Core/Helper/identifier.py +248 -0
  31. arctrl/py/Core/Helper/orcid.py +42 -0
  32. arctrl/py/Core/Helper/printer.py +13 -0
  33. arctrl/py/Core/Helper/regex.py +554 -0
  34. arctrl/py/Core/Helper/sem_ver.py +71 -0
  35. arctrl/py/Core/Helper/url.py +148 -0
  36. arctrl/py/Core/Process/__init__.py +0 -0
  37. arctrl/py/Core/Process/column_index.py +280 -0
  38. arctrl/py/Core/Process/component.py +200 -0
  39. arctrl/py/Core/Process/factor.py +151 -0
  40. arctrl/py/Core/Process/factor_value.py +182 -0
  41. arctrl/py/Core/Process/material.py +74 -0
  42. arctrl/py/Core/Process/material_attribute.py +95 -0
  43. arctrl/py/Core/Process/material_attribute_value.py +184 -0
  44. arctrl/py/Core/Process/material_type.py +45 -0
  45. arctrl/py/Core/Process/process.py +477 -0
  46. arctrl/py/Core/Process/process_input.py +265 -0
  47. arctrl/py/Core/Process/process_output.py +235 -0
  48. arctrl/py/Core/Process/process_parameter_value.py +200 -0
  49. arctrl/py/Core/Process/process_sequence.py +435 -0
  50. arctrl/py/Core/Process/protocol.py +175 -0
  51. arctrl/py/Core/Process/protocol_parameter.py +98 -0
  52. arctrl/py/Core/Process/sample.py +82 -0
  53. arctrl/py/Core/Process/source.py +62 -0
  54. arctrl/py/Core/Table/__init__.py +0 -0
  55. arctrl/py/Core/Table/arc_table.py +1264 -0
  56. arctrl/py/Core/Table/arc_table_aux.py +575 -0
  57. arctrl/py/Core/Table/arc_tables.py +591 -0
  58. arctrl/py/Core/Table/composite_cell.py +319 -0
  59. arctrl/py/Core/Table/composite_column.py +73 -0
  60. arctrl/py/Core/Table/composite_header.py +739 -0
  61. arctrl/py/Core/__init__.py +0 -0
  62. arctrl/py/Core/arc_types.py +5064 -0
  63. arctrl/py/Core/comment.py +128 -0
  64. arctrl/py/Core/comment_list.py +127 -0
  65. arctrl/py/Core/conversion.py +1313 -0
  66. arctrl/py/Core/data.py +245 -0
  67. arctrl/py/Core/data_context.py +157 -0
  68. arctrl/py/Core/data_file.py +112 -0
  69. arctrl/py/Core/data_map.py +225 -0
  70. arctrl/py/Core/identifier_setters.py +31 -0
  71. arctrl/py/Core/iproperty_value.py +36 -0
  72. arctrl/py/Core/ontology_annotation.py +299 -0
  73. arctrl/py/Core/ontology_source_reference.py +114 -0
  74. arctrl/py/Core/person.py +259 -0
  75. arctrl/py/Core/publication.py +161 -0
  76. arctrl/py/Core/template.py +231 -0
  77. arctrl/py/Core/templates.py +148 -0
  78. arctrl/py/Core/uri.py +11 -0
  79. arctrl/py/Core/value.py +188 -0
  80. arctrl/py/FileSystem/__init__.py +0 -0
  81. arctrl/py/FileSystem/commit.py +21 -0
  82. arctrl/py/FileSystem/default_gitattributes.py +5 -0
  83. arctrl/py/FileSystem/default_gitignore.py +5 -0
  84. arctrl/py/FileSystem/file_system.py +58 -0
  85. arctrl/py/FileSystem/file_system_tree.py +426 -0
  86. arctrl/py/FileSystem/path.py +64 -0
  87. arctrl/py/Json/DataMap/__init__.py +0 -0
  88. arctrl/py/Json/DataMap/data_context.py +101 -0
  89. arctrl/py/Json/DataMap/data_map.py +53 -0
  90. arctrl/py/Json/Process/__init__.py +0 -0
  91. arctrl/py/Json/Process/assay_materials.py +46 -0
  92. arctrl/py/Json/Process/component.py +79 -0
  93. arctrl/py/Json/Process/factor.py +107 -0
  94. arctrl/py/Json/Process/factor_value.py +101 -0
  95. arctrl/py/Json/Process/material.py +226 -0
  96. arctrl/py/Json/Process/material_attribute.py +79 -0
  97. arctrl/py/Json/Process/material_attribute_value.py +101 -0
  98. arctrl/py/Json/Process/material_type.py +53 -0
  99. arctrl/py/Json/Process/process.py +296 -0
  100. arctrl/py/Json/Process/process_input.py +83 -0
  101. arctrl/py/Json/Process/process_output.py +67 -0
  102. arctrl/py/Json/Process/process_parameter_value.py +81 -0
  103. arctrl/py/Json/Process/protocol.py +354 -0
  104. arctrl/py/Json/Process/protocol_parameter.py +79 -0
  105. arctrl/py/Json/Process/sample.py +277 -0
  106. arctrl/py/Json/Process/source.py +214 -0
  107. arctrl/py/Json/Process/study_materials.py +52 -0
  108. arctrl/py/Json/Process/value.py +56 -0
  109. arctrl/py/Json/ROCrate/__init__.py +0 -0
  110. arctrl/py/Json/ROCrate/ldcontext.py +133 -0
  111. arctrl/py/Json/ROCrate/ldgraph.py +111 -0
  112. arctrl/py/Json/ROCrate/ldnode.py +290 -0
  113. arctrl/py/Json/ROCrate/ldref.py +44 -0
  114. arctrl/py/Json/ROCrate/ldvalue.py +102 -0
  115. arctrl/py/Json/Table/__init__.py +0 -0
  116. arctrl/py/Json/Table/arc_table.py +393 -0
  117. arctrl/py/Json/Table/cell_table.py +83 -0
  118. arctrl/py/Json/Table/composite_cell.py +136 -0
  119. arctrl/py/Json/Table/composite_header.py +67 -0
  120. arctrl/py/Json/Table/iotype.py +24 -0
  121. arctrl/py/Json/Table/oatable.py +82 -0
  122. arctrl/py/Json/Table/templates.py +281 -0
  123. arctrl/py/Json/__init__.py +0 -0
  124. arctrl/py/Json/assay.py +600 -0
  125. arctrl/py/Json/comment.py +206 -0
  126. arctrl/py/Json/context/rocrate/__init__.py +0 -0
  127. arctrl/py/Json/context/rocrate/isa_assay_context.py +101 -0
  128. arctrl/py/Json/context/rocrate/isa_comment_context.py +60 -0
  129. arctrl/py/Json/context/rocrate/isa_component_context.py +77 -0
  130. arctrl/py/Json/context/rocrate/isa_data_context.py +74 -0
  131. arctrl/py/Json/context/rocrate/isa_factor_context.py +74 -0
  132. arctrl/py/Json/context/rocrate/isa_factor_value_context.py +84 -0
  133. arctrl/py/Json/context/rocrate/isa_investigation_context.py +110 -0
  134. arctrl/py/Json/context/rocrate/isa_material_attribute_context.py +64 -0
  135. arctrl/py/Json/context/rocrate/isa_material_attribute_value_context.py +80 -0
  136. arctrl/py/Json/context/rocrate/isa_material_context.py +71 -0
  137. arctrl/py/Json/context/rocrate/isa_ontology_annotation_context.py +68 -0
  138. arctrl/py/Json/context/rocrate/isa_ontology_source_reference_context.py +75 -0
  139. arctrl/py/Json/context/rocrate/isa_organization_context.py +55 -0
  140. arctrl/py/Json/context/rocrate/isa_person_context.py +131 -0
  141. arctrl/py/Json/context/rocrate/isa_process_context.py +94 -0
  142. arctrl/py/Json/context/rocrate/isa_process_parameter_value_context.py +80 -0
  143. arctrl/py/Json/context/rocrate/isa_protocol_context.py +97 -0
  144. arctrl/py/Json/context/rocrate/isa_protocol_parameter_context.py +64 -0
  145. arctrl/py/Json/context/rocrate/isa_publication_context.py +78 -0
  146. arctrl/py/Json/context/rocrate/isa_sample_context.py +65 -0
  147. arctrl/py/Json/context/rocrate/isa_source_context.py +66 -0
  148. arctrl/py/Json/context/rocrate/isa_study_context.py +125 -0
  149. arctrl/py/Json/context/rocrate/property_value_context.py +73 -0
  150. arctrl/py/Json/context/rocrate/rocrate_context.py +81 -0
  151. arctrl/py/Json/converter_options.py +23 -0
  152. arctrl/py/Json/data.py +356 -0
  153. arctrl/py/Json/data_file.py +63 -0
  154. arctrl/py/Json/decode.py +155 -0
  155. arctrl/py/Json/encode.py +92 -0
  156. arctrl/py/Json/idtable.py +44 -0
  157. arctrl/py/Json/investigation.py +695 -0
  158. arctrl/py/Json/ontology_annotation.py +404 -0
  159. arctrl/py/Json/ontology_source_reference.py +255 -0
  160. arctrl/py/Json/person.py +658 -0
  161. arctrl/py/Json/property_value.py +359 -0
  162. arctrl/py/Json/publication.py +279 -0
  163. arctrl/py/Json/string_table.py +76 -0
  164. arctrl/py/Json/study.py +793 -0
  165. arctrl/py/JsonIO/DataMap/__init__.py +0 -0
  166. arctrl/py/JsonIO/DataMap/data_map.py +53 -0
  167. arctrl/py/JsonIO/Process/__init__.py +0 -0
  168. arctrl/py/JsonIO/Process/component.py +60 -0
  169. arctrl/py/JsonIO/Process/factor.py +36 -0
  170. arctrl/py/JsonIO/Process/factor_value.py +38 -0
  171. arctrl/py/JsonIO/Process/material.py +60 -0
  172. arctrl/py/JsonIO/Process/material_attribute.py +38 -0
  173. arctrl/py/JsonIO/Process/material_attribute_value.py +60 -0
  174. arctrl/py/JsonIO/Process/material_type.py +36 -0
  175. arctrl/py/JsonIO/Process/process.py +60 -0
  176. arctrl/py/JsonIO/Process/process_input.py +38 -0
  177. arctrl/py/JsonIO/Process/process_output.py +60 -0
  178. arctrl/py/JsonIO/Process/process_parameter_value.py +60 -0
  179. arctrl/py/JsonIO/Process/process_sequence.py +71 -0
  180. arctrl/py/JsonIO/Process/protocol.py +60 -0
  181. arctrl/py/JsonIO/Process/protocol_parameter.py +36 -0
  182. arctrl/py/JsonIO/Process/sample.py +60 -0
  183. arctrl/py/JsonIO/Process/source.py +60 -0
  184. arctrl/py/JsonIO/Process/study_materials.py +52 -0
  185. arctrl/py/JsonIO/Process/value.py +32 -0
  186. arctrl/py/JsonIO/Table/__init__.py +0 -0
  187. arctrl/py/JsonIO/Table/arc_table.py +121 -0
  188. arctrl/py/JsonIO/Table/composite_cell.py +36 -0
  189. arctrl/py/JsonIO/Table/composite_header.py +36 -0
  190. arctrl/py/JsonIO/Table/compression.py +85 -0
  191. arctrl/py/JsonIO/Table/iotype.py +36 -0
  192. arctrl/py/JsonIO/Table/templates.py +113 -0
  193. arctrl/py/JsonIO/__init__.py +0 -0
  194. arctrl/py/JsonIO/assay.py +113 -0
  195. arctrl/py/JsonIO/comment.py +80 -0
  196. arctrl/py/JsonIO/data.py +60 -0
  197. arctrl/py/JsonIO/data_file.py +58 -0
  198. arctrl/py/JsonIO/decode.py +9 -0
  199. arctrl/py/JsonIO/encode.py +1 -0
  200. arctrl/py/JsonIO/investigation.py +113 -0
  201. arctrl/py/JsonIO/ldobject.py +106 -0
  202. arctrl/py/JsonIO/ontology_annotation.py +80 -0
  203. arctrl/py/JsonIO/ontology_source_reference.py +80 -0
  204. arctrl/py/JsonIO/person.py +82 -0
  205. arctrl/py/JsonIO/publication.py +82 -0
  206. arctrl/py/JsonIO/study.py +114 -0
  207. arctrl/py/ROCrate/Generic/__init__.py +0 -0
  208. arctrl/py/ROCrate/Generic/comment.py +131 -0
  209. arctrl/py/ROCrate/Generic/dataset.py +817 -0
  210. arctrl/py/ROCrate/Generic/defined_term.py +131 -0
  211. arctrl/py/ROCrate/Generic/file.py +237 -0
  212. arctrl/py/ROCrate/Generic/lab_process.py +324 -0
  213. arctrl/py/ROCrate/Generic/lab_protocol.py +338 -0
  214. arctrl/py/ROCrate/Generic/organization.py +83 -0
  215. arctrl/py/ROCrate/Generic/person.py +484 -0
  216. arctrl/py/ROCrate/Generic/postal_address.py +195 -0
  217. arctrl/py/ROCrate/Generic/property_value.py +696 -0
  218. arctrl/py/ROCrate/Generic/sample.py +202 -0
  219. arctrl/py/ROCrate/Generic/scholarly_article.py +229 -0
  220. arctrl/py/ROCrate/ISAProfile/__init__.py +0 -0
  221. arctrl/py/ROCrate/ISAProfile/assay.py +70 -0
  222. arctrl/py/ROCrate/ISAProfile/data.py +65 -0
  223. arctrl/py/ROCrate/ISAProfile/dataset.py +24 -0
  224. arctrl/py/ROCrate/ISAProfile/investigation.py +73 -0
  225. arctrl/py/ROCrate/ISAProfile/lab_process.py +162 -0
  226. arctrl/py/ROCrate/ISAProfile/lab_protocol.py +37 -0
  227. arctrl/py/ROCrate/ISAProfile/person.py +72 -0
  228. arctrl/py/ROCrate/ISAProfile/property_value.py +98 -0
  229. arctrl/py/ROCrate/ISAProfile/sample.py +64 -0
  230. arctrl/py/ROCrate/ISAProfile/scholarly_article.py +98 -0
  231. arctrl/py/ROCrate/ISAProfile/study.py +74 -0
  232. arctrl/py/ROCrate/__init__.py +0 -0
  233. arctrl/py/ROCrate/arc_rocrate_metadata.py +39 -0
  234. arctrl/py/ROCrate/dyn_obj_extensions.py +1 -0
  235. arctrl/py/ROCrate/helper.py +8 -0
  236. arctrl/py/ROCrate/ldcontext.py +362 -0
  237. arctrl/py/ROCrate/ldobject.py +1247 -0
  238. arctrl/py/ROCrate/rocrate_context.py +51 -0
  239. arctrl/py/Spreadsheet/AnnotationTable/__init__.py +0 -0
  240. arctrl/py/Spreadsheet/AnnotationTable/arc_table.py +193 -0
  241. arctrl/py/Spreadsheet/AnnotationTable/composite_cell.py +78 -0
  242. arctrl/py/Spreadsheet/AnnotationTable/composite_column.py +210 -0
  243. arctrl/py/Spreadsheet/AnnotationTable/composite_header.py +623 -0
  244. arctrl/py/Spreadsheet/DataMapTable/__init__.py +0 -0
  245. arctrl/py/Spreadsheet/DataMapTable/data_map_column.py +114 -0
  246. arctrl/py/Spreadsheet/DataMapTable/data_map_header.py +618 -0
  247. arctrl/py/Spreadsheet/DataMapTable/data_map_table.py +119 -0
  248. arctrl/py/Spreadsheet/Metadata/__init__.py +0 -0
  249. arctrl/py/Spreadsheet/Metadata/assays.py +125 -0
  250. arctrl/py/Spreadsheet/Metadata/comment.py +77 -0
  251. arctrl/py/Spreadsheet/Metadata/contacts.py +134 -0
  252. arctrl/py/Spreadsheet/Metadata/conversions.py +190 -0
  253. arctrl/py/Spreadsheet/Metadata/design_descriptors.py +34 -0
  254. arctrl/py/Spreadsheet/Metadata/factors.py +107 -0
  255. arctrl/py/Spreadsheet/Metadata/ontology_annotation.py +88 -0
  256. arctrl/py/Spreadsheet/Metadata/ontology_source_reference.py +96 -0
  257. arctrl/py/Spreadsheet/Metadata/protocols.py +146 -0
  258. arctrl/py/Spreadsheet/Metadata/publication.py +122 -0
  259. arctrl/py/Spreadsheet/Metadata/run.py +122 -0
  260. arctrl/py/Spreadsheet/Metadata/sparse_table.py +508 -0
  261. arctrl/py/Spreadsheet/Metadata/study.py +312 -0
  262. arctrl/py/Spreadsheet/Metadata/workflow.py +151 -0
  263. arctrl/py/Spreadsheet/__init__.py +0 -0
  264. arctrl/py/Spreadsheet/arc_assay.py +233 -0
  265. arctrl/py/Spreadsheet/arc_investigation.py +418 -0
  266. arctrl/py/Spreadsheet/arc_run.py +190 -0
  267. arctrl/py/Spreadsheet/arc_study.py +144 -0
  268. arctrl/py/Spreadsheet/arc_workflow.py +176 -0
  269. arctrl/py/Spreadsheet/assembly_info.py +1 -0
  270. arctrl/py/Spreadsheet/collection_aux.py +167 -0
  271. arctrl/py/Spreadsheet/data_map.py +44 -0
  272. arctrl/py/Spreadsheet/template.py +460 -0
  273. arctrl/py/ValidationPackages/__init__.py +0 -0
  274. arctrl/py/ValidationPackages/validation_package.py +82 -0
  275. arctrl/py/ValidationPackages/validation_packages_config.py +132 -0
  276. arctrl/py/WebRequest/__init__.py +0 -0
  277. arctrl/py/WebRequest/web_request.py +9 -0
  278. arctrl/py/WebRequest/web_request_py.py +135 -0
  279. arctrl/py/Yaml/__init__.py +0 -0
  280. arctrl/py/Yaml/decode.py +1 -0
  281. arctrl/py/Yaml/encode.py +10 -0
  282. arctrl/py/Yaml/validation_package.py +77 -0
  283. arctrl/py/Yaml/validation_packages_config.py +86 -0
  284. arctrl/py/__init__.py +0 -0
  285. arctrl/py/arc.py +1400 -0
  286. arctrl/py/column_index.py +280 -0
  287. arctrl/py/conversion.py +2184 -0
  288. arctrl/py/cross_async.py +76 -0
  289. arctrl/py/fable_modules/dynamic_obj/__init__.py +0 -0
  290. arctrl/py/fable_modules/dynamic_obj/dyn_obj.py +136 -0
  291. arctrl/py/fable_modules/dynamic_obj/dynamic_obj.py +415 -0
  292. arctrl/py/fable_modules/dynamic_obj/fable_js.py +1 -0
  293. arctrl/py/fable_modules/dynamic_obj/fable_py.py +288 -0
  294. arctrl/py/fable_modules/dynamic_obj/hash_codes.py +82 -0
  295. arctrl/py/fable_modules/dynamic_obj/property_helper.py +25 -0
  296. arctrl/py/fable_modules/dynamic_obj/reflection_utils.py +87 -0
  297. arctrl/py/fable_modules/fable_library/__init__.py +0 -0
  298. arctrl/py/fable_modules/fable_library/array_.py +1528 -0
  299. arctrl/py/fable_modules/fable_library/async_.py +377 -0
  300. arctrl/py/fable_modules/fable_library/async_builder.py +379 -0
  301. arctrl/py/fable_modules/fable_library/big_int.py +330 -0
  302. arctrl/py/fable_modules/fable_library/bit_converter.py +131 -0
  303. arctrl/py/fable_modules/fable_library/boolean.py +26 -0
  304. arctrl/py/fable_modules/fable_library/char.py +237 -0
  305. arctrl/py/fable_modules/fable_library/choice.py +212 -0
  306. arctrl/py/fable_modules/fable_library/date.py +779 -0
  307. arctrl/py/fable_modules/fable_library/date_offset.py +79 -0
  308. arctrl/py/fable_modules/fable_library/decimal_.py +190 -0
  309. arctrl/py/fable_modules/fable_library/diagnostics.py +54 -0
  310. arctrl/py/fable_modules/fable_library/double.py +87 -0
  311. arctrl/py/fable_modules/fable_library/encoding.py +41 -0
  312. arctrl/py/fable_modules/fable_library/event.py +206 -0
  313. arctrl/py/fable_modules/fable_library/file.py +107 -0
  314. arctrl/py/fable_modules/fable_library/fsharp_collections.py +52 -0
  315. arctrl/py/fable_modules/fable_library/fsharp_core.py +123 -0
  316. arctrl/py/fable_modules/fable_library/global_.py +63 -0
  317. arctrl/py/fable_modules/fable_library/guid.py +41 -0
  318. arctrl/py/fable_modules/fable_library/int32.py +73 -0
  319. arctrl/py/fable_modules/fable_library/list.py +1788 -0
  320. arctrl/py/fable_modules/fable_library/long.py +240 -0
  321. arctrl/py/fable_modules/fable_library/mailbox_processor.py +179 -0
  322. arctrl/py/fable_modules/fable_library/map.py +1854 -0
  323. arctrl/py/fable_modules/fable_library/map_util.py +148 -0
  324. arctrl/py/fable_modules/fable_library/mutable_map.py +397 -0
  325. arctrl/py/fable_modules/fable_library/mutable_set.py +279 -0
  326. arctrl/py/fable_modules/fable_library/native.py +45 -0
  327. arctrl/py/fable_modules/fable_library/numeric.py +46 -0
  328. arctrl/py/fable_modules/fable_library/observable.py +222 -0
  329. arctrl/py/fable_modules/fable_library/option.py +128 -0
  330. arctrl/py/fable_modules/fable_library/path.py +62 -0
  331. arctrl/py/fable_modules/fable_library/range.py +117 -0
  332. arctrl/py/fable_modules/fable_library/reflection.py +463 -0
  333. arctrl/py/fable_modules/fable_library/reg_exp.py +137 -0
  334. arctrl/py/fable_modules/fable_library/resize_array.py +31 -0
  335. arctrl/py/fable_modules/fable_library/result.py +212 -0
  336. arctrl/py/fable_modules/fable_library/seq.py +1979 -0
  337. arctrl/py/fable_modules/fable_library/seq2.py +221 -0
  338. arctrl/py/fable_modules/fable_library/set.py +2414 -0
  339. arctrl/py/fable_modules/fable_library/singleton_local_time_zone.py +36 -0
  340. arctrl/py/fable_modules/fable_library/string_.py +573 -0
  341. arctrl/py/fable_modules/fable_library/system_collections_generic.py +462 -0
  342. arctrl/py/fable_modules/fable_library/system_text.py +237 -0
  343. arctrl/py/fable_modules/fable_library/task.py +116 -0
  344. arctrl/py/fable_modules/fable_library/task_builder.py +122 -0
  345. arctrl/py/fable_modules/fable_library/thread.py +5 -0
  346. arctrl/py/fable_modules/fable_library/time_span.py +283 -0
  347. arctrl/py/fable_modules/fable_library/timer.py +24 -0
  348. arctrl/py/fable_modules/fable_library/types.py +401 -0
  349. arctrl/py/fable_modules/fable_library/uri.py +109 -0
  350. arctrl/py/fable_modules/fable_library/util.py +2735 -0
  351. arctrl/py/fable_modules/fable_openpyxl/__init__.py +0 -0
  352. arctrl/py/fable_modules/fable_openpyxl/openpyxl.py +362 -0
  353. arctrl/py/fable_modules/fable_python/cognite-sdk/__init__.py +0 -0
  354. arctrl/py/fable_modules/fable_python/cognite-sdk/cognite_sdk.py +22 -0
  355. arctrl/py/fable_modules/fable_python/flask/__init__.py +0 -0
  356. arctrl/py/fable_modules/fable_python/flask/flask.py +34 -0
  357. arctrl/py/fable_modules/fable_python/jupyter/__init__.py +0 -0
  358. arctrl/py/fable_modules/fable_python/jupyter/ipy_widgets.py +47 -0
  359. arctrl/py/fable_modules/fable_python/jupyter/ipython.py +13 -0
  360. arctrl/py/fable_modules/fable_python/stdlib/__init__.py +0 -0
  361. arctrl/py/fable_modules/fable_python/stdlib/ast.py +1 -0
  362. arctrl/py/fable_modules/fable_python/stdlib/asyncio/__init__.py +0 -0
  363. arctrl/py/fable_modules/fable_python/stdlib/asyncio/events.py +17 -0
  364. arctrl/py/fable_modules/fable_python/stdlib/asyncio/futures.py +52 -0
  365. arctrl/py/fable_modules/fable_python/stdlib/asyncio/tasks.py +38 -0
  366. arctrl/py/fable_modules/fable_python/stdlib/base64_.py +1 -0
  367. arctrl/py/fable_modules/fable_python/stdlib/builtins_.py +38 -0
  368. arctrl/py/fable_modules/fable_python/stdlib/html.py +1 -0
  369. arctrl/py/fable_modules/fable_python/stdlib/json.py +1 -0
  370. arctrl/py/fable_modules/fable_python/stdlib/math_.py +1 -0
  371. arctrl/py/fable_modules/fable_python/stdlib/os_.py +1 -0
  372. arctrl/py/fable_modules/fable_python/stdlib/queue_.py +1 -0
  373. arctrl/py/fable_modules/fable_python/stdlib/string_.py +1 -0
  374. arctrl/py/fable_modules/fable_python/stdlib/sys_.py +30 -0
  375. arctrl/py/fable_modules/fable_python/stdlib/time_.py +1 -0
  376. arctrl/py/fable_modules/fable_python/stdlib/tk_inter.py +1 -0
  377. arctrl/py/fable_modules/fs_spreadsheet/Cells/__init__.py +0 -0
  378. arctrl/py/fable_modules/fs_spreadsheet/Cells/fs_cell.py +338 -0
  379. arctrl/py/fable_modules/fs_spreadsheet/Cells/fs_cells_collection.py +469 -0
  380. arctrl/py/fable_modules/fs_spreadsheet/DSL/__init__.py +0 -0
  381. arctrl/py/fable_modules/fs_spreadsheet/DSL/cell_builder.py +214 -0
  382. arctrl/py/fable_modules/fs_spreadsheet/DSL/column_builder.py +139 -0
  383. arctrl/py/fable_modules/fs_spreadsheet/DSL/dsl.py +50 -0
  384. arctrl/py/fable_modules/fs_spreadsheet/DSL/expression.py +65 -0
  385. arctrl/py/fable_modules/fs_spreadsheet/DSL/operators.py +9 -0
  386. arctrl/py/fable_modules/fs_spreadsheet/DSL/row_builder.py +139 -0
  387. arctrl/py/fable_modules/fs_spreadsheet/DSL/sheet_builder.py +118 -0
  388. arctrl/py/fable_modules/fs_spreadsheet/DSL/table_builder.py +122 -0
  389. arctrl/py/fable_modules/fs_spreadsheet/DSL/transform.py +464 -0
  390. arctrl/py/fable_modules/fs_spreadsheet/DSL/types.py +314 -0
  391. arctrl/py/fable_modules/fs_spreadsheet/DSL/workbook_builder.py +106 -0
  392. arctrl/py/fable_modules/fs_spreadsheet/Json/__init__.py +0 -0
  393. arctrl/py/fable_modules/fs_spreadsheet/Json/cell.py +103 -0
  394. arctrl/py/fable_modules/fs_spreadsheet/Json/column.py +70 -0
  395. arctrl/py/fable_modules/fs_spreadsheet/Json/row.py +70 -0
  396. arctrl/py/fable_modules/fs_spreadsheet/Json/table.py +57 -0
  397. arctrl/py/fable_modules/fs_spreadsheet/Json/value.py +93 -0
  398. arctrl/py/fable_modules/fs_spreadsheet/Json/workbook.py +71 -0
  399. arctrl/py/fable_modules/fs_spreadsheet/Json/worksheet.py +217 -0
  400. arctrl/py/fable_modules/fs_spreadsheet/Ranges/__init__.py +0 -0
  401. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range.py +47 -0
  402. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_address.py +186 -0
  403. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_base.py +90 -0
  404. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_column.py +78 -0
  405. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_row.py +48 -0
  406. arctrl/py/fable_modules/fs_spreadsheet/Tables/__init__.py +0 -0
  407. arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table.py +393 -0
  408. arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table_field.py +127 -0
  409. arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table_row.py +23 -0
  410. arctrl/py/fable_modules/fs_spreadsheet/__init__.py +0 -0
  411. arctrl/py/fable_modules/fs_spreadsheet/fs_address.py +218 -0
  412. arctrl/py/fable_modules/fs_spreadsheet/fs_column.py +172 -0
  413. arctrl/py/fable_modules/fs_spreadsheet/fs_row.py +183 -0
  414. arctrl/py/fable_modules/fs_spreadsheet/fs_workbook.py +180 -0
  415. arctrl/py/fable_modules/fs_spreadsheet/fs_worksheet.py +600 -0
  416. arctrl/py/fable_modules/fs_spreadsheet/sheet_builder.py +330 -0
  417. arctrl/py/fable_modules/fs_spreadsheet_py/__init__.py +0 -0
  418. arctrl/py/fable_modules/fs_spreadsheet_py/cell.py +63 -0
  419. arctrl/py/fable_modules/fs_spreadsheet_py/cell_type.py +50 -0
  420. arctrl/py/fable_modules/fs_spreadsheet_py/fs_extension.py +60 -0
  421. arctrl/py/fable_modules/fs_spreadsheet_py/json.py +47 -0
  422. arctrl/py/fable_modules/fs_spreadsheet_py/table.py +53 -0
  423. arctrl/py/fable_modules/fs_spreadsheet_py/workbook.py +40 -0
  424. arctrl/py/fable_modules/fs_spreadsheet_py/worksheet.py +54 -0
  425. arctrl/py/fable_modules/fs_spreadsheet_py/xlsx.py +37 -0
  426. arctrl/py/fable_modules/thoth_json_core/__init__.py +0 -0
  427. arctrl/py/fable_modules/thoth_json_core/decode.py +1588 -0
  428. arctrl/py/fable_modules/thoth_json_core/encode.py +261 -0
  429. arctrl/py/fable_modules/thoth_json_core/types.py +181 -0
  430. arctrl/py/fable_modules/thoth_json_python/__init__.py +0 -0
  431. arctrl/py/fable_modules/thoth_json_python/decode.py +112 -0
  432. arctrl/py/fable_modules/thoth_json_python/encode.py +72 -0
  433. arctrl/py/fable_modules/thoth_json_python/python.py +1 -0
  434. arctrl/py/fable_modules/yamlicious/Interop/__init__.py +0 -0
  435. arctrl/py/fable_modules/yamlicious/Interop/js_interop.py +1 -0
  436. arctrl/py/fable_modules/yamlicious/Interop/py_interop.py +7 -0
  437. arctrl/py/fable_modules/yamlicious/__init__.py +0 -0
  438. arctrl/py/fable_modules/yamlicious/decode.py +1784 -0
  439. arctrl/py/fable_modules/yamlicious/encode.py +84 -0
  440. arctrl/py/fable_modules/yamlicious/library.py +10 -0
  441. arctrl/py/fable_modules/yamlicious/persil.py +57 -0
  442. arctrl/py/fable_modules/yamlicious/preprocessing.py +99 -0
  443. arctrl/py/fable_modules/yamlicious/reader.py +665 -0
  444. arctrl/py/fable_modules/yamlicious/regex.py +21 -0
  445. arctrl/py/fable_modules/yamlicious/regex_active_patterns.py +256 -0
  446. arctrl/py/fable_modules/yamlicious/writer.py +175 -0
  447. arctrl/py/fable_modules/yamlicious/yamlicious_types.py +128 -0
  448. arctrl/py/json.py +213 -0
  449. arctrl/py/rocrate_io.py +72 -0
  450. arctrl/py/template_web.py +23 -0
  451. arctrl/py/xlsx.py +148 -0
  452. arctrl/rocrate.py +21 -0
  453. arctrl-3.0.0a3.dist-info/LICENSE +21 -0
  454. arctrl-3.0.0a3.dist-info/METADATA +119 -0
  455. arctrl-3.0.0a3.dist-info/RECORD +456 -0
  456. arctrl-3.0.0a3.dist-info/WHEEL +4 -0
@@ -0,0 +1,133 @@
1
+ from __future__ import annotations
2
+ from typing import (Any, TypeVar)
3
+ from ...fable_modules.fable_library.list import (FSharpList, is_empty, length, head)
4
+ from ...fable_modules.fable_library.result import FSharpResult_2
5
+ from ...fable_modules.fable_library.seq import (map, append, to_list, delay, singleton, empty)
6
+ from ...fable_modules.fable_library.types import Array
7
+ from ...fable_modules.fable_library.util import (IEnumerable_1, get_enumerator)
8
+ from ...fable_modules.thoth_json_core.decode import (Getters_2__ctor_Z4BE6C149, Getters_2, IRequiredGetter, string, Getters_2__get_Errors, resize_array)
9
+ from ...fable_modules.thoth_json_core.encode import seq
10
+ from ...fable_modules.thoth_json_core.types import (Decoder_1, ErrorReason_1, IDecoderHelpers_1, IEncodable, IEncoderHelpers_1)
11
+ from ...ROCrate.ldcontext import LDContext
12
+ from ...ROCrate.rocrate_context import (init_v1_2draft, init_v1_1)
13
+
14
+ __A_ = TypeVar("__A_")
15
+
16
+ class ObjectExpr1907(Decoder_1[LDContext]):
17
+ def Decode(self, helpers: IDecoderHelpers_1[Any], value: Any) -> FSharpResult_2[LDContext, tuple[str, ErrorReason_1[__A_]]]:
18
+ this: Decoder_1[LDContext] = self
19
+ if helpers.is_object(value):
20
+ getters: Getters_2[__A_, Any] = Getters_2__ctor_Z4BE6C149(helpers, value)
21
+ properties: IEnumerable_1[str] = helpers.get_properties(value)
22
+ result: LDContext
23
+ o: LDContext = LDContext()
24
+ with get_enumerator(properties) as enumerator:
25
+ while enumerator.System_Collections_IEnumerator_MoveNext():
26
+ property: str = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
27
+ if (property != "@type") if (property != "@id") else False:
28
+ def _arrow1906(__unit: None=None) -> str:
29
+ object_arg: IRequiredGetter = getters.Required
30
+ return object_arg.Field(property, string)
31
+
32
+ o.AddMapping(property, _arrow1906())
33
+
34
+ result = o
35
+ match_value: FSharpList[tuple[str, ErrorReason_1[__A_]]] = Getters_2__get_Errors(getters)
36
+ if not is_empty(match_value):
37
+ errors: FSharpList[tuple[str, ErrorReason_1[__A_]]] = match_value
38
+ return FSharpResult_2(1, ("", ErrorReason_1(7, errors))) if (length(errors) > 1) else FSharpResult_2(1, head(match_value))
39
+
40
+ else:
41
+ return FSharpResult_2(0, result)
42
+
43
+
44
+ elif helpers.is_string(value):
45
+ s: str = helpers.as_string(value)
46
+ return FSharpResult_2(0, init_v1_2draft()) if (s == "https://w3id.org/ro/crate/1.2-DRAFT/context") else (FSharpResult_2(0, init_v1_1()) if (s == "https://w3id.org/ro/crate/1.1/context") else FSharpResult_2(1, ("", ErrorReason_1(0, "an object", value))))
47
+
48
+ elif helpers.is_array(value):
49
+ match_value_1: FSharpResult_2[Array[LDContext], tuple[str, ErrorReason_1[__A_]]] = resize_array(this).Decode(helpers, value)
50
+ return FSharpResult_2(1, match_value_1.fields[0]) if (match_value_1.tag == 1) else FSharpResult_2(0, LDContext(None, match_value_1.fields[0]))
51
+
52
+ else:
53
+ return FSharpResult_2(1, ("", ErrorReason_1(0, "an object", value)))
54
+
55
+
56
+
57
+ decoder: Decoder_1[LDContext] = ObjectExpr1907()
58
+
59
+ def encoder(ctx_mut: LDContext) -> IEncodable:
60
+ while True:
61
+ (ctx,) = (ctx_mut,)
62
+ match_value: str | None = ctx.Name
63
+ (pattern_matching_result,) = (None,)
64
+ if match_value is not None:
65
+ if match_value == "https://w3id.org/ro/crate/1.2-DRAFT/context":
66
+ pattern_matching_result = 0
67
+
68
+ elif match_value == "https://w3id.org/ro/crate/1.1/context":
69
+ pattern_matching_result = 1
70
+
71
+ else:
72
+ pattern_matching_result = 2
73
+
74
+
75
+ else:
76
+ pattern_matching_result = 2
77
+
78
+ if pattern_matching_result == 0:
79
+ class ObjectExpr1908(IEncodable):
80
+ def Encode(self, helpers: IEncoderHelpers_1[Any], ctx: Any=ctx) -> Any:
81
+ return helpers.encode_string("https://w3id.org/ro/crate/1.2-DRAFT/context")
82
+
83
+ return ObjectExpr1908()
84
+
85
+ elif pattern_matching_result == 1:
86
+ class ObjectExpr1909(IEncodable):
87
+ def Encode(self, helpers_1: IEncoderHelpers_1[Any], ctx: Any=ctx) -> Any:
88
+ return helpers_1.encode_string("https://w3id.org/ro/crate/1.1/context")
89
+
90
+ return ObjectExpr1909()
91
+
92
+ elif pattern_matching_result == 2:
93
+ mappings: IEncodable
94
+ def mapping(kv: Any, ctx: Any=ctx) -> tuple[str, IEncodable]:
95
+ class ObjectExpr1910(IEncodable):
96
+ def Encode(self, helpers_2: IEncoderHelpers_1[Any], kv: Any=kv) -> Any:
97
+ return helpers_2.encode_string(kv[1])
98
+
99
+ return (kv[0], ObjectExpr1910())
100
+
101
+ values: IEnumerable_1[tuple[str, IEncodable]] = map(mapping, ctx.Mappings)
102
+ class ObjectExpr1911(IEncodable):
103
+ def Encode(self, helpers_3: IEncoderHelpers_1[Any], ctx: Any=ctx) -> Any:
104
+ def mapping_1(tupled_arg: tuple[str, IEncodable]) -> tuple[str, __A_]:
105
+ return (tupled_arg[0], tupled_arg[1].Encode(helpers_3))
106
+
107
+ arg: IEnumerable_1[tuple[str, __A_]] = map(mapping_1, values)
108
+ return helpers_3.encode_object(arg)
109
+
110
+ mappings = ObjectExpr1911()
111
+ if len(ctx.BaseContexts) == 0:
112
+ return mappings
113
+
114
+ elif (len(ctx.Mappings) == 0) if (len(ctx.BaseContexts) == 1) else False:
115
+ ctx_mut = ctx.BaseContexts[0]
116
+ continue
117
+
118
+ else:
119
+ def _arrow1913(__unit: None=None, ctx: Any=ctx) -> IEnumerable_1[IEncodable]:
120
+ source_4: IEnumerable_1[IEncodable] = map(encoder, ctx.BaseContexts)
121
+ def _arrow1912(__unit: None=None) -> IEnumerable_1[IEncodable]:
122
+ return singleton(mappings) if (len(ctx.Mappings) != 0) else empty()
123
+
124
+ return append(to_list(delay(_arrow1912)), source_4)
125
+
126
+ return seq(_arrow1913())
127
+
128
+
129
+ break
130
+
131
+
132
+ __all__ = ["decoder", "encoder"]
133
+
@@ -0,0 +1,111 @@
1
+ from __future__ import annotations
2
+ from typing import (Any, TypeVar)
3
+ from ...fable_modules.fable_library.list import (choose, FSharpList, is_empty, length, head)
4
+ from ...fable_modules.fable_library.option import map
5
+ from ...fable_modules.fable_library.result import FSharpResult_2
6
+ from ...fable_modules.fable_library.seq import (to_list, delay, append, singleton, collect, empty, map as map_1)
7
+ from ...fable_modules.fable_library.util import (IEnumerable_1, get_enumerator)
8
+ from ...fable_modules.thoth_json_core.decode import (Getters_2__ctor_Z4BE6C149, Getters_2, IGetters, IOptionalGetter, string, seq as seq_1, IRequiredGetter, Getters_2__get_Errors)
9
+ from ...fable_modules.thoth_json_core.encode import seq
10
+ from ...fable_modules.thoth_json_core.types import (IEncodable, IEncoderHelpers_1, Decoder_1, ErrorReason_1, IDecoderHelpers_1)
11
+ from ...ROCrate.ldcontext import LDContext
12
+ from ...ROCrate.ldobject import (LDNode, LDGraph)
13
+ from ..encode import try_include
14
+ from .ldcontext import (encoder as encoder_1, decoder as decoder_1)
15
+ from .ldnode import (generic_encoder, encoder as encoder_2, decoder as decoder_2, generic_decoder)
16
+
17
+ __A_ = TypeVar("__A_")
18
+
19
+ def encoder(obj: LDGraph) -> IEncodable:
20
+ def chooser(tupled_arg: tuple[str, IEncodable | None], obj: Any=obj) -> tuple[str, IEncodable] | None:
21
+ def mapping_1(v_1: IEncodable, tupled_arg: Any=tupled_arg) -> tuple[str, IEncodable]:
22
+ return (tupled_arg[0], v_1)
23
+
24
+ return map(mapping_1, tupled_arg[1])
25
+
26
+ def _arrow1960(__unit: None=None, obj: Any=obj) -> IEnumerable_1[tuple[str, IEncodable | None]]:
27
+ def _arrow1955(value: str) -> IEncodable:
28
+ class ObjectExpr1954(IEncodable):
29
+ def Encode(self, helpers: IEncoderHelpers_1[Any]) -> Any:
30
+ return helpers.encode_string(value)
31
+
32
+ return ObjectExpr1954()
33
+
34
+ def _arrow1959(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable | None]]:
35
+ def _arrow1958(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable | None]]:
36
+ def _arrow1956(kv: Any) -> IEnumerable_1[tuple[str, IEncodable | None]]:
37
+ l: str = kv[0].lower()
38
+ return singleton((kv[0], generic_encoder(kv[1]))) if ((l != "mappings") if ((l != "nodes") if ((l != "@context") if (l != "id") else False) else False) else False) else empty()
39
+
40
+ def _arrow1957(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable | None]]:
41
+ return singleton(("@graph", seq(map_1(encoder_2, obj.Nodes))))
42
+
43
+ return append(collect(_arrow1956, obj.GetProperties(True)), delay(_arrow1957))
44
+
45
+ return append(singleton(try_include("@context", encoder_1, obj.TryGetContext())), delay(_arrow1958))
46
+
47
+ return append(singleton(try_include("@id", _arrow1955, obj.Id)), delay(_arrow1959))
48
+
49
+ values_1: FSharpList[tuple[str, IEncodable]] = choose(chooser, to_list(delay(_arrow1960)))
50
+ class ObjectExpr1961(IEncodable):
51
+ def Encode(self, helpers_1: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
52
+ def mapping_2(tupled_arg_1: tuple[str, IEncodable]) -> tuple[str, __A_]:
53
+ return (tupled_arg_1[0], tupled_arg_1[1].Encode(helpers_1))
54
+
55
+ arg: IEnumerable_1[tuple[str, __A_]] = map_1(mapping_2, values_1)
56
+ return helpers_1.encode_object(arg)
57
+
58
+ return ObjectExpr1961()
59
+
60
+
61
+ class ObjectExpr1963(Decoder_1[LDGraph]):
62
+ def Decode(self, helpers: IDecoderHelpers_1[Any], value: Any) -> FSharpResult_2[LDGraph, tuple[str, ErrorReason_1[__A_]]]:
63
+ if helpers.is_object(value):
64
+ getters: Getters_2[__A_, Any] = Getters_2__ctor_Z4BE6C149(helpers, value)
65
+ properties: IEnumerable_1[str] = helpers.get_properties(value)
66
+ result: LDGraph
67
+ get: IGetters = getters
68
+ id: str | None
69
+ object_arg: IOptionalGetter = get.Optional
70
+ id = object_arg.Field("@id", string)
71
+ context: LDContext | None
72
+ object_arg_1: IOptionalGetter = get.Optional
73
+ context = object_arg_1.Field("@context", decoder_1)
74
+ nodes: IEnumerable_1[LDNode]
75
+ arg_5: Decoder_1[IEnumerable_1[LDNode]] = seq_1(decoder_2)
76
+ object_arg_2: IRequiredGetter = get.Required
77
+ nodes = object_arg_2.Field("@graph", arg_5)
78
+ o: LDGraph = LDGraph(id, None, context)
79
+ with get_enumerator(properties) as enumerator:
80
+ while enumerator.System_Collections_IEnumerator_MoveNext():
81
+ property: str = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
82
+ if (property != "@context") if ((property != "@graph") if (property != "@id") else False) else False:
83
+ def _arrow1962(__unit: None=None) -> Any:
84
+ object_arg_3: IRequiredGetter = get.Required
85
+ return object_arg_3.Field(property, generic_decoder)
86
+
87
+ o.SetProperty(property, _arrow1962())
88
+
89
+ with get_enumerator(nodes) as enumerator_1:
90
+ while enumerator_1.System_Collections_IEnumerator_MoveNext():
91
+ node: LDNode = enumerator_1.System_Collections_Generic_IEnumerator_1_get_Current()
92
+ o.AddNode(node)
93
+ result = o
94
+ match_value: FSharpList[tuple[str, ErrorReason_1[__A_]]] = Getters_2__get_Errors(getters)
95
+ if not is_empty(match_value):
96
+ errors: FSharpList[tuple[str, ErrorReason_1[__A_]]] = match_value
97
+ return FSharpResult_2(1, ("", ErrorReason_1(7, errors))) if (length(errors) > 1) else FSharpResult_2(1, head(match_value))
98
+
99
+ else:
100
+ return FSharpResult_2(0, result)
101
+
102
+
103
+ else:
104
+ return FSharpResult_2(1, ("", ErrorReason_1(0, "an object", value)))
105
+
106
+
107
+
108
+ decoder: Decoder_1[LDGraph] = ObjectExpr1963()
109
+
110
+ __all__ = ["encoder", "decoder"]
111
+
@@ -0,0 +1,290 @@
1
+ from __future__ import annotations
2
+ from collections.abc import Callable
3
+ from datetime import datetime
4
+ from decimal import Decimal
5
+ from typing import (Any, TypeVar)
6
+ from ...fable_modules.fable_library.array_ import fold
7
+ from ...fable_modules.fable_library.list import (FSharpList, is_empty, length, head, of_array)
8
+ from ...fable_modules.fable_library.option import value as value_12
9
+ from ...fable_modules.fable_library.result import FSharpResult_2
10
+ from ...fable_modules.fable_library.seq import (to_list, delay, map, enumerate_from_functions, append, singleton, empty, collect)
11
+ from ...fable_modules.fable_library.string_ import starts_with_exact
12
+ from ...fable_modules.fable_library.types import Array
13
+ from ...fable_modules.fable_library.util import (equals, is_iterable, get_enumerator, IEnumerator, IEnumerable_1, int32_to_string)
14
+ from ...fable_modules.thoth_json_core.decode import (Getters_2__ctor_Z4BE6C149, Getters_2, IGetters, string, IRequiredGetter, IOptionalGetter, Getters_2__get_Errors, map as map_1, one_of, int_1, decimal)
15
+ from ...fable_modules.thoth_json_core.encode import list_1
16
+ from ...fable_modules.thoth_json_core.types import (IEncodable, IEncoderHelpers_1, Decoder_1, ErrorReason_1, IDecoderHelpers_1)
17
+ from ...ROCrate.ldcontext import LDContext
18
+ from ...ROCrate.ldobject import (LDValue, LDRef, LDNode)
19
+ from ..decode import (Decode_resizeArrayOrSingleton, Helpers_prependPath)
20
+ from ..encode import (date_time, resize_array_or_singleton)
21
+ from .ldcontext import (encoder as encoder_3, decoder as decoder_1)
22
+ from .ldref import (encoder as encoder_2, decoder as decoder_3)
23
+ from .ldvalue import (encoder as encoder_1, decoder as decoder_2)
24
+
25
+ __A_ = TypeVar("__A_")
26
+
27
+ def generic_encoder(obj: Any=None) -> IEncodable:
28
+ if str(type(obj)) == "<class \'str\'>":
29
+ class ObjectExpr1914(IEncodable):
30
+ def Encode(self, helpers: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
31
+ return helpers.encode_string(obj)
32
+
33
+ return ObjectExpr1914()
34
+
35
+ elif str(type(obj)) == "<class \'int\'>":
36
+ class ObjectExpr1915(IEncodable):
37
+ def Encode(self, helpers_1: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
38
+ return helpers_1.encode_signed_integral_number(obj)
39
+
40
+ return ObjectExpr1915()
41
+
42
+ elif str(type(obj)) == "<class \'bool\'>":
43
+ class ObjectExpr1916(IEncodable):
44
+ def Encode(self, helpers_2: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
45
+ return helpers_2.encode_bool(obj)
46
+
47
+ return ObjectExpr1916()
48
+
49
+ elif str(type(obj)) == "<class \'float\'>":
50
+ class ObjectExpr1917(IEncodable):
51
+ def Encode(self, helpers_3: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
52
+ return helpers_3.encode_decimal_number(obj)
53
+
54
+ return ObjectExpr1917()
55
+
56
+ elif isinstance(obj, datetime):
57
+ return date_time(obj)
58
+
59
+ elif isinstance(obj, LDValue):
60
+ return encoder_1(obj)
61
+
62
+ elif isinstance(obj, LDRef):
63
+ return encoder_2(obj)
64
+
65
+ elif isinstance(obj, LDNode):
66
+ return encoder(obj)
67
+
68
+ elif equals(obj, None):
69
+ class ObjectExpr1918(IEncodable):
70
+ def Encode(self, helpers_4: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
71
+ return helpers_4.encode_null()
72
+
73
+ return ObjectExpr1918()
74
+
75
+ elif is_iterable(obj):
76
+ def _arrow1922(__unit: None=None, obj: Any=obj) -> IEnumerable_1[IEncodable]:
77
+ def _arrow1919(__unit: None=None) -> IEnumerator[Any]:
78
+ return get_enumerator(obj)
79
+
80
+ def _arrow1920(enumerator: IEnumerator[Any]) -> bool:
81
+ return enumerator.System_Collections_IEnumerator_MoveNext()
82
+
83
+ def _arrow1921(enumerator_1: IEnumerator[Any]) -> Any:
84
+ return enumerator_1.System_Collections_IEnumerator_get_Current()
85
+
86
+ return map(generic_encoder, enumerate_from_functions(_arrow1919, _arrow1920, _arrow1921))
87
+
88
+ return list_1(to_list(delay(_arrow1922)))
89
+
90
+ else:
91
+ raise Exception("Unknown type")
92
+
93
+
94
+
95
+ def encoder(obj: LDNode) -> IEncodable:
96
+ def _arrow1935(__unit: None=None, obj: Any=obj) -> IEnumerable_1[tuple[str, IEncodable]]:
97
+ def _arrow1924(__unit: None=None) -> IEncodable:
98
+ value: str = obj.Id
99
+ class ObjectExpr1923(IEncodable):
100
+ def Encode(self, helpers: IEncoderHelpers_1[Any]) -> Any:
101
+ return helpers.encode_string(value)
102
+
103
+ return ObjectExpr1923()
104
+
105
+ def _arrow1934(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable]]:
106
+ def _arrow1926(value_1: str) -> IEncodable:
107
+ class ObjectExpr1925(IEncodable):
108
+ def Encode(self, helpers_1: IEncoderHelpers_1[Any]) -> Any:
109
+ return helpers_1.encode_string(value_1)
110
+
111
+ return ObjectExpr1925()
112
+
113
+ def _arrow1933(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable]]:
114
+ def _arrow1928(value_3: str) -> IEncodable:
115
+ class ObjectExpr1927(IEncodable):
116
+ def Encode(self, helpers_2: IEncoderHelpers_1[Any]) -> Any:
117
+ return helpers_2.encode_string(value_3)
118
+
119
+ return ObjectExpr1927()
120
+
121
+ def _arrow1932(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable]]:
122
+ def _arrow1929(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable]]:
123
+ match_value: LDContext | None = obj.TryGetContext()
124
+ if match_value is not None:
125
+ return singleton(("@context", encoder_3(match_value)))
126
+
127
+ else:
128
+ return empty()
129
+
130
+
131
+ def _arrow1931(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable]]:
132
+ def _arrow1930(kv: Any) -> IEnumerable_1[tuple[str, IEncodable]]:
133
+ l: str = kv[0].lower()
134
+ return singleton((kv[0], generic_encoder(kv[1]))) if ((not starts_with_exact(l, "init_")) if ((not starts_with_exact(l, "init@")) if ((l != "@context") if ((l != "additionaltype") if ((l != "schematype") if (l != "id") else False) else False) else False) else False) else False) else empty()
135
+
136
+ return collect(_arrow1930, obj.GetProperties(True))
137
+
138
+ return append(_arrow1929(), delay(_arrow1931))
139
+
140
+ return append(singleton(("additionalType", resize_array_or_singleton(_arrow1928, obj.AdditionalType))) if (len(obj.AdditionalType) != 0) else empty(), delay(_arrow1932))
141
+
142
+ return append(singleton(("@type", resize_array_or_singleton(_arrow1926, obj.SchemaType))), delay(_arrow1933))
143
+
144
+ return append(singleton(("@id", _arrow1924())), delay(_arrow1934))
145
+
146
+ values: FSharpList[tuple[str, IEncodable]] = to_list(delay(_arrow1935))
147
+ class ObjectExpr1936(IEncodable):
148
+ def Encode(self, helpers_3: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
149
+ def mapping(tupled_arg: tuple[str, IEncodable]) -> tuple[str, __A_]:
150
+ return (tupled_arg[0], tupled_arg[1].Encode(helpers_3))
151
+
152
+ arg: IEnumerable_1[tuple[str, __A_]] = map(mapping, values)
153
+ return helpers_3.encode_object(arg)
154
+
155
+ return ObjectExpr1936()
156
+
157
+
158
+ def get_decoder(expect_object: bool) -> Decoder_1[Any]:
159
+ def decode(expect_object_1: bool, expect_object: Any=expect_object) -> Decoder_1[Any]:
160
+ class ObjectExpr1939(Decoder_1[LDNode]):
161
+ def Decode(self, helpers: IDecoderHelpers_1[Any], value: Any, expect_object_1: Any=expect_object_1) -> FSharpResult_2[LDNode, tuple[str, ErrorReason_1[__A_]]]:
162
+ if helpers.is_object(value):
163
+ getters: Getters_2[__A_, Any] = Getters_2__ctor_Z4BE6C149(helpers, value)
164
+ properties: IEnumerable_1[str] = helpers.get_properties(value)
165
+ result: LDNode
166
+ get: IGetters = getters
167
+ t: Array[str]
168
+ arg_1: Decoder_1[Array[str]] = Decode_resizeArrayOrSingleton(string)
169
+ object_arg: IRequiredGetter = get.Required
170
+ t = object_arg.Field("@type", arg_1)
171
+ id: str
172
+ object_arg_1: IRequiredGetter = get.Required
173
+ id = object_arg_1.Field("@id", string)
174
+ context: LDContext | None
175
+ object_arg_2: IOptionalGetter = get.Optional
176
+ context = object_arg_2.Field("@context", decoder_1)
177
+ def _arrow1937(__unit: None=None) -> Array[str] | None:
178
+ arg_7: Decoder_1[Array[str]] = Decode_resizeArrayOrSingleton(string)
179
+ object_arg_3: IOptionalGetter = get.Optional
180
+ return object_arg_3.Field("additionalType", arg_7)
181
+
182
+ o: LDNode = LDNode(id, t, _arrow1937())
183
+ with get_enumerator(properties) as enumerator:
184
+ while enumerator.System_Collections_IEnumerator_MoveNext():
185
+ property: str = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
186
+ if (property != "@context") if ((property != "@type") if (property != "@id") else False) else False:
187
+ def _arrow1938(__unit: None=None) -> Any:
188
+ arg_9: Decoder_1[Any] = decode(False)
189
+ object_arg_4: IRequiredGetter = get.Required
190
+ return object_arg_4.Field(property, arg_9)
191
+
192
+ o.SetProperty(property, _arrow1938())
193
+
194
+ if context is not None:
195
+ o.SetContext(value_12(context))
196
+
197
+ result = o
198
+ match_value: FSharpList[tuple[str, ErrorReason_1[__A_]]] = Getters_2__get_Errors(getters)
199
+ if not is_empty(match_value):
200
+ errors: FSharpList[tuple[str, ErrorReason_1[__A_]]] = match_value
201
+ return FSharpResult_2(1, ("", ErrorReason_1(7, errors))) if (length(errors) > 1) else FSharpResult_2(1, head(match_value))
202
+
203
+ else:
204
+ return FSharpResult_2(0, result)
205
+
206
+
207
+ else:
208
+ return FSharpResult_2(1, ("", ErrorReason_1(0, "an object", value)))
209
+
210
+
211
+ decode_object: Decoder_1[LDNode] = ObjectExpr1939()
212
+ class ObjectExpr1941(Decoder_1[Array[Any]]):
213
+ def Decode(self, helpers_1: IDecoderHelpers_1[Any], value_1: Any, expect_object_1: Any=expect_object_1) -> FSharpResult_2[Array[Any], tuple[str, ErrorReason_1[__A_]]]:
214
+ if helpers_1.is_array(value_1):
215
+ i: int = -1
216
+ def folder(acc: FSharpResult_2[Array[Any], tuple[str, ErrorReason_1[__A_]]], value_2: __A_) -> FSharpResult_2[Array[Any], tuple[str, ErrorReason_1[__A_]]]:
217
+ nonlocal i
218
+ i = (i + 1) or 0
219
+ if acc.tag == 0:
220
+ acc_1: Array[Any] = acc.fields[0]
221
+ match_value_1: FSharpResult_2[Any, tuple[str, ErrorReason_1[__A_]]]
222
+ copy_of_struct: Decoder_1[Any] = decode(False)
223
+ match_value_1 = copy_of_struct.Decode(helpers_1, value_2)
224
+ if match_value_1.tag == 0:
225
+ (acc_1.append(match_value_1.fields[0]))
226
+ return FSharpResult_2(0, acc_1)
227
+
228
+ else:
229
+ def _arrow1940(__unit: None=None, acc: Any=acc, value_2: Any=value_2) -> tuple[str, ErrorReason_1[__A_]]:
230
+ tupled_arg: tuple[str, ErrorReason_1[__A_]] = match_value_1.fields[0]
231
+ return Helpers_prependPath((".[" + int32_to_string(i)) + "]", tupled_arg[0], tupled_arg[1])
232
+
233
+ return FSharpResult_2(1, _arrow1940())
234
+
235
+
236
+ else:
237
+ return acc
238
+
239
+
240
+ return fold(folder, FSharpResult_2(0, []), helpers_1.as_array(value_1))
241
+
242
+ else:
243
+ return FSharpResult_2(1, ("", ErrorReason_1(0, "an array", value_1)))
244
+
245
+
246
+ resize_array: Decoder_1[Array[Any]] = ObjectExpr1941()
247
+ if expect_object_1:
248
+ def _arrow1942(value_4: LDNode, expect_object_1: Any=expect_object_1) -> Any:
249
+ return value_4
250
+
251
+ return map_1(_arrow1942, decode_object)
252
+
253
+ else:
254
+ def _arrow1944(value_5: LDValue, expect_object_1: Any=expect_object_1) -> Any:
255
+ return value_5
256
+
257
+ def _arrow1945(value_6: LDNode, expect_object_1: Any=expect_object_1) -> Any:
258
+ return value_6
259
+
260
+ def _arrow1946(value_7: LDRef, expect_object_1: Any=expect_object_1) -> Any:
261
+ return value_7
262
+
263
+ def _arrow1947(value_8: Array[Any], expect_object_1: Any=expect_object_1) -> Any:
264
+ return value_8
265
+
266
+ def _arrow1948(value_9: str, expect_object_1: Any=expect_object_1) -> Any:
267
+ return value_9
268
+
269
+ def _arrow1949(value_10: int, expect_object_1: Any=expect_object_1) -> Any:
270
+ return value_10
271
+
272
+ def _arrow1950(value_11: Decimal, expect_object_1: Any=expect_object_1) -> Any:
273
+ return value_11
274
+
275
+ return one_of(of_array([map_1(_arrow1944, decoder_2), map_1(_arrow1945, decode_object), map_1(_arrow1946, decoder_3), map_1(_arrow1947, resize_array), map_1(_arrow1948, string), map_1(_arrow1949, int_1), map_1(_arrow1950, decimal)]))
276
+
277
+
278
+ return decode(expect_object)
279
+
280
+
281
+ def _arrow1951(value: Any=None) -> LDNode:
282
+ return value
283
+
284
+
285
+ decoder: Decoder_1[LDNode] = map_1(_arrow1951, get_decoder(True))
286
+
287
+ generic_decoder: Decoder_1[Any] = get_decoder(False)
288
+
289
+ __all__ = ["generic_encoder", "encoder", "get_decoder", "decoder", "generic_decoder"]
290
+
@@ -0,0 +1,44 @@
1
+ from __future__ import annotations
2
+ from typing import (Any, TypeVar)
3
+ from ...fable_modules.fable_library.list import (singleton, FSharpList)
4
+ from ...fable_modules.fable_library.seq import map
5
+ from ...fable_modules.fable_library.util import IEnumerable_1
6
+ from ...fable_modules.thoth_json_core.decode import (object, IRequiredGetter, string, IGetters)
7
+ from ...fable_modules.thoth_json_core.types import (Decoder_1, IEncodable, IEncoderHelpers_1)
8
+ from ...ROCrate.ldobject import LDRef
9
+
10
+ __A_ = TypeVar("__A_")
11
+
12
+ def _arrow1888(decoders: IGetters) -> LDRef:
13
+ def _arrow1887(__unit: None=None) -> str:
14
+ object_arg: IRequiredGetter = decoders.Required
15
+ return object_arg.Field("@id", string)
16
+
17
+ return LDRef(_arrow1887())
18
+
19
+
20
+ decoder: Decoder_1[LDRef] = object(_arrow1888)
21
+
22
+ def encoder(r: LDRef) -> IEncodable:
23
+ def _arrow1890(__unit: None=None, r: Any=r) -> IEncodable:
24
+ value: str = r.Id
25
+ class ObjectExpr1889(IEncodable):
26
+ def Encode(self, helpers: IEncoderHelpers_1[Any]) -> Any:
27
+ return helpers.encode_string(value)
28
+
29
+ return ObjectExpr1889()
30
+
31
+ values: FSharpList[tuple[str, IEncodable]] = singleton(("@id", _arrow1890()))
32
+ class ObjectExpr1891(IEncodable):
33
+ def Encode(self, helpers_1: IEncoderHelpers_1[Any], r: Any=r) -> Any:
34
+ def mapping(tupled_arg: tuple[str, IEncodable]) -> tuple[str, __A_]:
35
+ return (tupled_arg[0], tupled_arg[1].Encode(helpers_1))
36
+
37
+ arg: IEnumerable_1[tuple[str, __A_]] = map(mapping, values)
38
+ return helpers_1.encode_object(arg)
39
+
40
+ return ObjectExpr1891()
41
+
42
+
43
+ __all__ = ["decoder", "encoder"]
44
+
@@ -0,0 +1,102 @@
1
+ from __future__ import annotations
2
+ from datetime import datetime
3
+ from decimal import Decimal
4
+ from typing import (Any, TypeVar)
5
+ from ...fable_modules.fable_library.list import (of_array, FSharpList)
6
+ from ...fable_modules.fable_library.seq import map as map_1
7
+ from ...fable_modules.fable_library.util import IEnumerable_1
8
+ from ...fable_modules.thoth_json_core.decode import (one_of, map, string, int_1, decimal, object, IRequiredGetter, IOptionalGetter, IGetters)
9
+ from ...fable_modules.thoth_json_core.types import (Decoder_1, IEncodable, IEncoderHelpers_1)
10
+ from ...ROCrate.ldobject import LDValue
11
+ from ..encode import date_time
12
+
13
+ __A_ = TypeVar("__A_")
14
+
15
+ def _arrow1893(value: str) -> Any:
16
+ return value
17
+
18
+
19
+ def _arrow1894(value_1: int) -> Any:
20
+ return value_1
21
+
22
+
23
+ def _arrow1895(value_2: Decimal) -> Any:
24
+ return value_2
25
+
26
+
27
+ generic_decoder: Decoder_1[Any] = one_of(of_array([map(_arrow1893, string), map(_arrow1894, int_1), map(_arrow1895, decimal)]))
28
+
29
+ def generic_encoder(value: Any=None) -> IEncodable:
30
+ if str(type(value)) == "<class \'str\'>":
31
+ class ObjectExpr1896(IEncodable):
32
+ def Encode(self, helpers: IEncoderHelpers_1[Any], value: Any=value) -> Any:
33
+ return helpers.encode_string(value)
34
+
35
+ return ObjectExpr1896()
36
+
37
+ elif str(type(value)) == "<class \'int\'>":
38
+ class ObjectExpr1897(IEncodable):
39
+ def Encode(self, helpers_1: IEncoderHelpers_1[Any], value: Any=value) -> Any:
40
+ return helpers_1.encode_signed_integral_number(value)
41
+
42
+ return ObjectExpr1897()
43
+
44
+ elif str(type(value)) == "<class \'bool\'>":
45
+ class ObjectExpr1898(IEncodable):
46
+ def Encode(self, helpers_2: IEncoderHelpers_1[Any], value: Any=value) -> Any:
47
+ return helpers_2.encode_bool(value)
48
+
49
+ return ObjectExpr1898()
50
+
51
+ elif str(type(value)) == "<class \'float\'>":
52
+ class ObjectExpr1899(IEncodable):
53
+ def Encode(self, helpers_3: IEncoderHelpers_1[Any], value: Any=value) -> Any:
54
+ return helpers_3.encode_decimal_number(value)
55
+
56
+ return ObjectExpr1899()
57
+
58
+ elif isinstance(value, datetime):
59
+ return date_time(value)
60
+
61
+ else:
62
+ raise Exception("Unknown type")
63
+
64
+
65
+
66
+ def _arrow1902(decoders: IGetters) -> LDValue:
67
+ def _arrow1900(__unit: None=None) -> Any:
68
+ object_arg: IRequiredGetter = decoders.Required
69
+ return object_arg.Field("@value", generic_decoder)
70
+
71
+ def _arrow1901(__unit: None=None) -> str | None:
72
+ object_arg_1: IOptionalGetter = decoders.Optional
73
+ return object_arg_1.Field("@type", string)
74
+
75
+ return LDValue(_arrow1900(), _arrow1901())
76
+
77
+
78
+ decoder: Decoder_1[LDValue] = object(_arrow1902)
79
+
80
+ def encoder(v: LDValue) -> IEncodable:
81
+ def _arrow1904(__unit: None=None, v: Any=v) -> IEncodable:
82
+ value: str = v.ValueType
83
+ class ObjectExpr1903(IEncodable):
84
+ def Encode(self, helpers: IEncoderHelpers_1[Any]) -> Any:
85
+ return helpers.encode_string(value)
86
+
87
+ return ObjectExpr1903()
88
+
89
+ values: FSharpList[tuple[str, IEncodable]] = of_array([("@value", generic_encoder(v.Value)), ("@type", _arrow1904())])
90
+ class ObjectExpr1905(IEncodable):
91
+ def Encode(self, helpers_1: IEncoderHelpers_1[Any], v: Any=v) -> Any:
92
+ def mapping(tupled_arg: tuple[str, IEncodable]) -> tuple[str, __A_]:
93
+ return (tupled_arg[0], tupled_arg[1].Encode(helpers_1))
94
+
95
+ arg: IEnumerable_1[tuple[str, __A_]] = map_1(mapping, values)
96
+ return helpers_1.encode_object(arg)
97
+
98
+ return ObjectExpr1905()
99
+
100
+
101
+ __all__ = ["generic_decoder", "generic_encoder", "decoder", "encoder"]
102
+