spinta 0.2.dev26__py3-none-any.whl → 0.2.dev28__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 (401) hide show
  1. spinta/accesslog/__init__.py +2 -10
  2. spinta/accesslog/file.py +3 -6
  3. spinta/accesslog/python.py +1 -2
  4. spinta/adapters/soap_plugins.py +2 -2
  5. spinta/api/__init__.py +44 -30
  6. spinta/api/inspect.py +7 -8
  7. spinta/api/schema.py +9 -9
  8. spinta/api/validators.py +2 -2
  9. spinta/asgi.py +1 -1
  10. spinta/auth.py +19 -25
  11. spinta/backends/__init__.py +46 -59
  12. spinta/backends/components.py +2 -5
  13. spinta/backends/fs/commands/bootstrap.py +1 -1
  14. spinta/backends/fs/commands/changes.py +1 -1
  15. spinta/backends/fs/commands/decode.py +2 -2
  16. spinta/backends/fs/commands/encode.py +1 -1
  17. spinta/backends/fs/commands/init.py +3 -3
  18. spinta/backends/fs/commands/load.py +2 -2
  19. spinta/backends/fs/commands/migrate.py +1 -1
  20. spinta/backends/fs/commands/read.py +4 -7
  21. spinta/backends/fs/commands/validate.py +5 -5
  22. spinta/backends/fs/commands/wait.py +1 -1
  23. spinta/backends/fs/commands/wipe.py +1 -1
  24. spinta/backends/fs/commands/write.py +6 -8
  25. spinta/backends/helpers.py +6 -19
  26. spinta/backends/memory/commands/bootstrap.py +1 -1
  27. spinta/backends/memory/commands/init.py +2 -2
  28. spinta/backends/memory/commands/load.py +2 -2
  29. spinta/backends/memory/commands/read.py +4 -5
  30. spinta/backends/memory/commands/wait.py +1 -1
  31. spinta/backends/memory/commands/wipe.py +1 -2
  32. spinta/backends/memory/components.py +2 -3
  33. spinta/backends/mongo/commands/bootstrap.py +1 -1
  34. spinta/backends/mongo/commands/changes.py +2 -2
  35. spinta/backends/mongo/commands/encode.py +1 -1
  36. spinta/backends/mongo/commands/init.py +1 -1
  37. spinta/backends/mongo/commands/load.py +1 -1
  38. spinta/backends/mongo/commands/migrate.py +1 -1
  39. spinta/backends/mongo/commands/read.py +3 -7
  40. spinta/backends/mongo/commands/validate.py +2 -2
  41. spinta/backends/mongo/commands/wait.py +1 -1
  42. spinta/backends/mongo/commands/wipe.py +1 -1
  43. spinta/backends/mongo/commands/write.py +4 -5
  44. spinta/backends/mongo/components.py +1 -2
  45. spinta/backends/mongo/helpers.py +1 -1
  46. spinta/backends/mongo/types/array/write.py +4 -4
  47. spinta/backends/mongo/types/file/write.py +4 -4
  48. spinta/backends/mongo/types/object/write.py +2 -2
  49. spinta/backends/mongo/ufuncs/components.py +3 -3
  50. spinta/backends/mongo/ufuncs/ufuncs.py +5 -16
  51. spinta/backends/nobackend/commands/load.py +1 -1
  52. spinta/backends/nobackend/commands/read.py +3 -4
  53. spinta/backends/nobackend/commands/wait.py +1 -1
  54. spinta/backends/nobackend/commands/wipe.py +1 -2
  55. spinta/backends/nobackend/commands/write.py +3 -3
  56. spinta/backends/postgresql/commands/bootstrap.py +3 -3
  57. spinta/backends/postgresql/commands/changes.py +1 -1
  58. spinta/backends/postgresql/commands/column.py +5 -5
  59. spinta/backends/postgresql/commands/encode.py +3 -5
  60. spinta/backends/postgresql/commands/load.py +1 -1
  61. spinta/backends/postgresql/commands/migrate/migrate.py +6 -6
  62. spinta/backends/postgresql/commands/migrate/model.py +11 -11
  63. spinta/backends/postgresql/commands/migrate/property.py +1 -1
  64. spinta/backends/postgresql/commands/migrate/types/array.py +4 -4
  65. spinta/backends/postgresql/commands/migrate/types/datatype.py +13 -14
  66. spinta/backends/postgresql/commands/migrate/types/file.py +1 -1
  67. spinta/backends/postgresql/commands/migrate/types/object.py +3 -3
  68. spinta/backends/postgresql/commands/migrate/types/ref.py +16 -16
  69. spinta/backends/postgresql/commands/migrate/types/string.py +4 -4
  70. spinta/backends/postgresql/commands/migrate/types/text.py +2 -2
  71. spinta/backends/postgresql/commands/read.py +5 -8
  72. spinta/backends/postgresql/commands/redirect.py +1 -1
  73. spinta/backends/postgresql/commands/summary.py +8 -10
  74. spinta/backends/postgresql/commands/validate.py +1 -1
  75. spinta/backends/postgresql/commands/wait.py +1 -1
  76. spinta/backends/postgresql/commands/wipe.py +2 -2
  77. spinta/backends/postgresql/commands/write.py +4 -4
  78. spinta/backends/postgresql/components.py +5 -7
  79. spinta/backends/postgresql/files.py +1 -3
  80. spinta/backends/postgresql/helpers/__init__.py +1 -1
  81. spinta/backends/postgresql/helpers/changes.py +2 -3
  82. spinta/backends/postgresql/helpers/exceptions.py +4 -4
  83. spinta/backends/postgresql/helpers/migrate/actions.py +7 -3
  84. spinta/backends/postgresql/helpers/migrate/citus.py +5 -6
  85. spinta/backends/postgresql/helpers/migrate/migrate.py +13 -13
  86. spinta/backends/postgresql/helpers/migrate/name.py +1 -2
  87. spinta/backends/postgresql/helpers/name.py +1 -1
  88. spinta/backends/postgresql/helpers/type.py +1 -1
  89. spinta/backends/postgresql/helpers/validate.py +1 -1
  90. spinta/backends/postgresql/sqlalchemy.py +2 -4
  91. spinta/backends/postgresql/types/array/init.py +3 -4
  92. spinta/backends/postgresql/types/array/wipe.py +2 -2
  93. spinta/backends/postgresql/types/array/write.py +3 -4
  94. spinta/backends/postgresql/types/denorm/init.py +1 -1
  95. spinta/backends/postgresql/types/external_ref/init.py +3 -3
  96. spinta/backends/postgresql/types/file/init.py +5 -6
  97. spinta/backends/postgresql/types/file/read.py +6 -7
  98. spinta/backends/postgresql/types/file/write.py +8 -9
  99. spinta/backends/postgresql/types/geometry/encode.py +5 -10
  100. spinta/backends/postgresql/types/geometry/write.py +1 -1
  101. spinta/backends/postgresql/types/object/init.py +1 -1
  102. spinta/backends/postgresql/types/object/read.py +5 -10
  103. spinta/backends/postgresql/types/object/wipe.py +1 -1
  104. spinta/backends/postgresql/types/ref/init.py +1 -1
  105. spinta/backends/postgresql/types/ref/validate.py +2 -3
  106. spinta/backends/postgresql/types/text/init.py +1 -1
  107. spinta/backends/postgresql/ufuncs/query/components.py +5 -8
  108. spinta/backends/postgresql/ufuncs/query/ufuncs.py +31 -24
  109. spinta/backends/postgresql/ufuncs/result/components.py +2 -1
  110. spinta/backends/postgresql/ufuncs/result/ufuncs.py +1 -1
  111. spinta/cli/admin.py +3 -3
  112. spinta/cli/auth.py +8 -13
  113. spinta/cli/comment.py +2 -7
  114. spinta/cli/data.py +8 -10
  115. spinta/cli/get.py +3 -3
  116. spinta/cli/helpers/admin/registry.py +7 -6
  117. spinta/cli/helpers/admin/scripts/changelog.py +4 -4
  118. spinta/cli/helpers/admin/scripts/citus_shard.py +58 -4
  119. spinta/cli/helpers/admin/scripts/deduplicate.py +3 -3
  120. spinta/cli/helpers/admin/scripts/enums.py +2 -4
  121. spinta/cli/helpers/admin/scripts/remove_local_ids.py +0 -1
  122. spinta/cli/helpers/auth.py +1 -4
  123. spinta/cli/helpers/data.py +6 -15
  124. spinta/cli/helpers/export/backends/postgresql/commands.py +8 -8
  125. spinta/cli/helpers/export/backends/postgresql/components.py +2 -1
  126. spinta/cli/helpers/export/backends/postgresql/helpers.py +3 -3
  127. spinta/cli/helpers/export/commands.py +2 -2
  128. spinta/cli/helpers/export/helpers.py +3 -3
  129. spinta/cli/helpers/migrate.py +1 -1
  130. spinta/cli/helpers/push/__init__.py +1 -1
  131. spinta/cli/helpers/push/components.py +1 -4
  132. spinta/cli/helpers/push/delete.py +3 -7
  133. spinta/cli/helpers/push/error.py +2 -6
  134. spinta/cli/helpers/push/read.py +5 -10
  135. spinta/cli/helpers/push/state.py +2 -6
  136. spinta/cli/helpers/push/sync.py +3 -5
  137. spinta/cli/helpers/push/utils.py +4 -8
  138. spinta/cli/helpers/push/write.py +4 -13
  139. spinta/cli/helpers/script/core.py +2 -2
  140. spinta/cli/helpers/script/helpers.py +0 -1
  141. spinta/cli/helpers/script/registry.py +0 -1
  142. spinta/cli/helpers/store.py +10 -7
  143. spinta/cli/helpers/sync/api_helpers.py +1 -2
  144. spinta/cli/helpers/sync/controllers/data_service.py +1 -1
  145. spinta/cli/helpers/sync/controllers/dataset.py +4 -3
  146. spinta/cli/helpers/sync/controllers/distribution.py +2 -1
  147. spinta/cli/helpers/sync/controllers/dsa.py +2 -1
  148. spinta/cli/helpers/sync/controllers/synchronization/connection.py +1 -1
  149. spinta/cli/helpers/sync/controllers/synchronization/manifest_catalog_to_agent.py +3 -4
  150. spinta/cli/helpers/sync/helpers.py +14 -12
  151. spinta/cli/helpers/typer.py +1 -2
  152. spinta/cli/helpers/upgrade/registry.py +5 -6
  153. spinta/cli/helpers/upgrade/scripts/backends/postgresql/comments.py +5 -8
  154. spinta/cli/helpers/upgrade/scripts/backends/postgresql/schemas.py +7 -10
  155. spinta/cli/helpers/upgrade/scripts/clients.py +6 -6
  156. spinta/cli/helpers/upgrade/scripts/keymaps/sqlalchemy/helpers.py +2 -2
  157. spinta/cli/helpers/upgrade/scripts/keymaps/sqlalchemy/initial_setup.py +3 -3
  158. spinta/cli/helpers/upgrade/scripts/keymaps/sqlalchemy/modified_time.py +1 -1
  159. spinta/cli/helpers/upgrade/scripts/keymaps/sqlalchemy/redirect_support.py +2 -1
  160. spinta/cli/helpers/upgrade/scripts/redirect.py +4 -4
  161. spinta/cli/init.py +1 -1
  162. spinta/cli/inspect.py +2 -5
  163. spinta/cli/keymap.py +4 -6
  164. spinta/cli/main.py +7 -19
  165. spinta/cli/migrate.py +4 -7
  166. spinta/cli/pii.py +7 -21
  167. spinta/cli/pull.py +3 -6
  168. spinta/cli/push.py +6 -12
  169. spinta/cli/server.py +6 -9
  170. spinta/cli/show.py +3 -6
  171. spinta/cli/sync.py +6 -6
  172. spinta/cli/uncomment.py +3 -9
  173. spinta/cli/upgrade.py +3 -4
  174. spinta/client.py +6 -5
  175. spinta/commands/__init__.py +10 -28
  176. spinta/commands/read.py +12 -17
  177. spinta/commands/search.py +3 -3
  178. spinta/commands/write.py +9 -17
  179. spinta/compat.py +0 -1
  180. spinta/components.py +30 -23
  181. spinta/config.py +15 -1
  182. spinta/config.yml +6 -0
  183. spinta/core/access.py +3 -8
  184. spinta/core/config.py +3 -6
  185. spinta/core/context.py +2 -7
  186. spinta/core/enums.py +1 -1
  187. spinta/core/ufuncs.py +1 -4
  188. spinta/datasets/backends/dataframe/backends/csv/commands/read.py +2 -2
  189. spinta/datasets/backends/dataframe/backends/json/commands/read.py +3 -3
  190. spinta/datasets/backends/dataframe/backends/soap/commands/read.py +2 -2
  191. spinta/datasets/backends/dataframe/backends/soap/components.py +1 -1
  192. spinta/datasets/backends/dataframe/backends/soap/ufuncs/ufuncs.py +3 -3
  193. spinta/datasets/backends/dataframe/backends/xml/commands/read.py +3 -3
  194. spinta/datasets/backends/dataframe/commands/read.py +11 -11
  195. spinta/datasets/backends/dataframe/ufuncs/query/components.py +3 -4
  196. spinta/datasets/backends/dataframe/ufuncs/query/ufuncs.py +8 -6
  197. spinta/datasets/backends/helpers.py +2 -2
  198. spinta/datasets/backends/notimpl/commands/load.py +1 -2
  199. spinta/datasets/backends/sql/backends/mariadb/ufuncs/query/components.py +1 -1
  200. spinta/datasets/backends/sql/backends/mysql/ufuncs/query/components.py +1 -1
  201. spinta/datasets/backends/sql/backends/oracle/helpers.py +6 -5
  202. spinta/datasets/backends/sql/backends/oracle/types/geometry/encode.py +1 -0
  203. spinta/datasets/backends/sql/backends/oracle/ufuncs/query/components.py +1 -1
  204. spinta/datasets/backends/sql/backends/oracle/ufuncs/query/ufuncs.py +3 -4
  205. spinta/datasets/backends/sql/backends/postgresql/helpers.py +1 -1
  206. spinta/datasets/backends/sql/backends/postgresql/ufuncs/query/ufuncs.py +3 -3
  207. spinta/datasets/backends/sql/backends/sas/commands/__init__.py +5 -3
  208. spinta/datasets/backends/sql/backends/sas/commands/cast.py +1 -1
  209. spinta/datasets/backends/sql/backends/sas/commands/load.py +2 -2
  210. spinta/datasets/backends/sql/backends/sas/commands/read.py +1 -3
  211. spinta/datasets/backends/sql/backends/sas/constants.py +1 -1
  212. spinta/datasets/backends/sql/backends/sas/dialect.py +4 -3
  213. spinta/datasets/backends/sql/backends/sas/formats.py +2 -1
  214. spinta/datasets/backends/sql/backends/sas/helpers.py +0 -1
  215. spinta/datasets/backends/sql/backends/sas/introspection.py +1 -1
  216. spinta/datasets/backends/sql/backends/sas/types.py +1 -0
  217. spinta/datasets/backends/sql/backends/sas/ufuncs/query/components.py +1 -1
  218. spinta/datasets/backends/sql/backends/sas/ufuncs/query/ufuncs.py +1 -1
  219. spinta/datasets/backends/sql/backends/sqlite/ufuncs/query/ufuncs.py +3 -3
  220. spinta/datasets/backends/sql/commands/cast.py +3 -3
  221. spinta/datasets/backends/sql/commands/column.py +2 -1
  222. spinta/datasets/backends/sql/commands/load.py +1 -1
  223. spinta/datasets/backends/sql/commands/read.py +3 -4
  224. spinta/datasets/backends/sql/components.py +1 -2
  225. spinta/datasets/backends/sql/helpers.py +3 -3
  226. spinta/datasets/backends/sql/ufuncs/query/components.py +3 -9
  227. spinta/datasets/backends/sql/ufuncs/query/helpers.py +1 -1
  228. spinta/datasets/backends/sql/ufuncs/query/ufuncs.py +7 -21
  229. spinta/datasets/backends/sql/ufuncs/result/components.py +2 -1
  230. spinta/datasets/backends/sql/ufuncs/result/ufuncs.py +1 -1
  231. spinta/datasets/backends/sql/ufuncs/ufuncs.py +2 -3
  232. spinta/datasets/backends/sqldump/commands/inspect.py +5 -17
  233. spinta/datasets/backends/sqldump/commands/load.py +1 -2
  234. spinta/datasets/backends/sqldump/ufuncs/ufuncs.py +2 -5
  235. spinta/datasets/backends/wsdl/components.py +1 -0
  236. spinta/datasets/commands/check.py +1 -2
  237. spinta/datasets/commands/error.py +1 -1
  238. spinta/datasets/commands/link.py +1 -1
  239. spinta/datasets/commands/load.py +9 -16
  240. spinta/datasets/commands/wipe.py +1 -2
  241. spinta/datasets/components.py +4 -10
  242. spinta/datasets/helpers.py +7 -13
  243. spinta/datasets/inspect/commands/merge.py +9 -11
  244. spinta/datasets/inspect/helpers.py +6 -16
  245. spinta/datasets/keymaps/components.py +1 -1
  246. spinta/datasets/keymaps/redis.py +3 -4
  247. spinta/datasets/keymaps/sqlalchemy.py +5 -6
  248. spinta/datasets/keymaps/sync.py +3 -3
  249. spinta/datasets/utils.py +2 -5
  250. spinta/dimensions/comments/helpers.py +2 -4
  251. spinta/dimensions/enum/commands.py +3 -8
  252. spinta/dimensions/enum/components.py +2 -3
  253. spinta/dimensions/enum/helpers.py +6 -18
  254. spinta/dimensions/enum/ufuncs.py +2 -2
  255. spinta/dimensions/lang/components.py +1 -2
  256. spinta/dimensions/param/components.py +2 -2
  257. spinta/dimensions/param/helpers.py +3 -3
  258. spinta/dimensions/param/ufuncs.py +2 -4
  259. spinta/dimensions/prefix/commands/load.py +2 -4
  260. spinta/dimensions/prefix/helpers.py +1 -3
  261. spinta/dimensions/scope/components.py +2 -2
  262. spinta/dimensions/scope/ufuncs.py +2 -2
  263. spinta/dispatcher.py +3 -10
  264. spinta/fetcher.py +1 -1
  265. spinta/formats/ascii/commands.py +3 -4
  266. spinta/formats/ascii/components.py +5 -5
  267. spinta/formats/csv/commands.py +4 -10
  268. spinta/formats/helpers.py +5 -20
  269. spinta/formats/html/commands.py +53 -48
  270. spinta/formats/html/components.py +1 -5
  271. spinta/formats/html/helpers.py +94 -18
  272. spinta/formats/json/commands.py +3 -3
  273. spinta/formats/json/components.py +1 -1
  274. spinta/formats/jsonlines/commands.py +3 -3
  275. spinta/formats/rdf/commands.py +23 -18
  276. spinta/formats/xlsx/commands.py +3 -8
  277. spinta/hacks/urlparams.py +2 -1
  278. spinta/handlers.py +1 -0
  279. spinta/logging_config.py +2 -2
  280. spinta/manifests/backend/commands/load.py +1 -1
  281. spinta/manifests/backend/commands/migrate.py +1 -2
  282. spinta/manifests/backend/commands/sync.py +4 -5
  283. spinta/manifests/backend/helpers.py +5 -13
  284. spinta/manifests/commands/error.py +1 -2
  285. spinta/manifests/commands/inspect.py +2 -4
  286. spinta/manifests/commands/read.py +6 -4
  287. spinta/manifests/components.py +3 -15
  288. spinta/manifests/dict/commands/configure.py +1 -1
  289. spinta/manifests/dict/commands/load.py +1 -1
  290. spinta/manifests/dict/helpers.py +6 -9
  291. spinta/manifests/helpers.py +10 -19
  292. spinta/manifests/internal_sql/commands/auth.py +1 -0
  293. spinta/manifests/internal_sql/commands/bootstrap.py +2 -2
  294. spinta/manifests/internal_sql/commands/configure.py +1 -0
  295. spinta/manifests/internal_sql/commands/load.py +3 -3
  296. spinta/manifests/internal_sql/commands/read.py +5 -4
  297. spinta/manifests/internal_sql/components.py +3 -2
  298. spinta/manifests/internal_sql/helpers.py +14 -14
  299. spinta/manifests/mermaid/helpers.py +2 -3
  300. spinta/manifests/open_api/helpers.py +2 -4
  301. spinta/manifests/open_api/openapi_generator.py +7 -7
  302. spinta/manifests/rdf/helpers.py +1 -1
  303. spinta/manifests/sql/components.py +2 -1
  304. spinta/manifests/sql/helpers.py +6 -13
  305. spinta/manifests/tabular/commands/configure.py +1 -3
  306. spinta/manifests/tabular/commands/load.py +1 -3
  307. spinta/manifests/tabular/components.py +1 -8
  308. spinta/manifests/tabular/formats/gsheets.py +2 -5
  309. spinta/manifests/tabular/helpers.py +106 -83
  310. spinta/manifests/xsd/commands/load.py +1 -1
  311. spinta/manifests/xsd/helpers.py +1 -2
  312. spinta/manifests/yaml/commands/configure.py +1 -2
  313. spinta/manifests/yaml/commands/load.py +2 -4
  314. spinta/manifests/yaml/components.py +1 -3
  315. spinta/manifests/yaml/helpers.py +6 -9
  316. spinta/middlewares.py +86 -4
  317. spinta/naming/components.py +1 -2
  318. spinta/naming/helpers.py +4 -9
  319. spinta/naming/ufuncts.py +2 -6
  320. spinta/nodes.py +5 -17
  321. spinta/renderer.py +3 -5
  322. spinta/spyna.py +1 -3
  323. spinta/templates/base.html +6 -8
  324. spinta/testing/citus.py +0 -2
  325. spinta/testing/cli.py +1 -3
  326. spinta/testing/client.py +4 -10
  327. spinta/testing/config.py +1 -1
  328. spinta/testing/context.py +5 -10
  329. spinta/testing/data.py +1 -8
  330. spinta/testing/datasets.py +1 -2
  331. spinta/testing/dtypes.py +2 -2
  332. spinta/testing/migration.py +1 -2
  333. spinta/testing/pytest.py +4 -7
  334. spinta/testing/request.py +2 -8
  335. spinta/testing/tabular.py +1 -3
  336. spinta/testing/utils.py +3 -5
  337. spinta/types/array/check.py +2 -2
  338. spinta/types/array/link.py +4 -4
  339. spinta/types/backref/link.py +2 -2
  340. spinta/types/command.py +1 -1
  341. spinta/types/config.py +13 -7
  342. spinta/types/datatype.py +7 -13
  343. spinta/types/denorm/link.py +2 -2
  344. spinta/types/file/decode.py +4 -4
  345. spinta/types/geometry/helpers.py +1 -2
  346. spinta/types/geometry/load.py +2 -5
  347. spinta/types/helpers.py +4 -9
  348. spinta/types/model.py +4 -4
  349. spinta/types/namespace.py +4 -17
  350. spinta/types/partial/link.py +1 -1
  351. spinta/types/ref/link.py +2 -3
  352. spinta/types/store.py +4 -6
  353. spinta/types/text/components.py +1 -2
  354. spinta/typing.py +1 -3
  355. spinta/ufuncs/binds.py +1 -6
  356. spinta/ufuncs/changebase/components.py +1 -2
  357. spinta/ufuncs/changebase/helpers.py +2 -4
  358. spinta/ufuncs/changebase/ufuncs.py +2 -6
  359. spinta/ufuncs/common.py +1 -1
  360. spinta/ufuncs/components.py +3 -6
  361. spinta/ufuncs/helpers.py +1 -2
  362. spinta/ufuncs/linkbuilder/components.py +1 -1
  363. spinta/ufuncs/linkbuilder/ufuncs.py +1 -1
  364. spinta/ufuncs/loadbuilder/components.py +1 -1
  365. spinta/ufuncs/loadbuilder/helpers.py +3 -2
  366. spinta/ufuncs/loadbuilder/ufuncs.py +3 -3
  367. spinta/ufuncs/propertyresolver/ufuncs.py +5 -5
  368. spinta/ufuncs/querybuilder/components.py +2 -2
  369. spinta/ufuncs/querybuilder/helpers.py +4 -4
  370. spinta/ufuncs/querybuilder/ufuncs.py +10 -10
  371. spinta/ufuncs/requestparamsbuilder/components.py +1 -1
  372. spinta/ufuncs/requestparamsbuilder/helpers.py +1 -1
  373. spinta/ufuncs/requestparamsbuilder/ufuncs.py +3 -3
  374. spinta/ufuncs/resultbuilder/helpers.py +1 -1
  375. spinta/ufuncs/resultbuilder/ufuncs.py +16 -7
  376. spinta/ufuncs/summaryenv/ufuncs.py +3 -3
  377. spinta/units/helpers.py +1 -5
  378. spinta/urlparams.py +14 -11
  379. spinta/utils/__init__.py +4 -2
  380. spinta/utils/aiotools.py +1 -2
  381. spinta/utils/config.py +1 -1
  382. spinta/utils/enums.py +2 -1
  383. spinta/utils/errors.py +0 -1
  384. spinta/utils/imports.py +1 -2
  385. spinta/utils/itertools.py +2 -7
  386. spinta/utils/json.py +2 -2
  387. spinta/utils/nestedstruct.py +4 -9
  388. spinta/utils/path.py +1 -1
  389. spinta/utils/response.py +12 -19
  390. spinta/utils/schema.py +1 -1
  391. spinta/utils/scopes.py +1 -2
  392. spinta/utils/sqlalchemy.py +2 -2
  393. spinta/utils/sqlite.py +1 -1
  394. spinta/utils/streams.py +2 -4
  395. spinta/utils/tree.py +1 -2
  396. spinta/utils/url.py +1 -1
  397. {spinta-0.2.dev26.dist-info → spinta-0.2.dev28.dist-info}/METADATA +3 -1
  398. {spinta-0.2.dev26.dist-info → spinta-0.2.dev28.dist-info}/RECORD +401 -401
  399. {spinta-0.2.dev26.dist-info → spinta-0.2.dev28.dist-info}/WHEEL +0 -0
  400. {spinta-0.2.dev26.dist-info → spinta-0.2.dev28.dist-info}/entry_points.txt +0 -0
  401. {spinta-0.2.dev26.dist-info → spinta-0.2.dev28.dist-info}/licenses/LICENSE +0 -0
@@ -1,22 +1,14 @@
1
1
  import datetime
2
2
  import os
3
3
  import time
4
- from typing import Any
5
- from typing import Dict
6
- from typing import Iterable
7
- from typing import Iterator
8
- from typing import List
9
- from typing import TypeVar
10
- from typing import AsyncIterator
11
- from typing import overload
4
+ from typing import Any, AsyncIterator, Dict, Iterable, Iterator, List, TypeVar, overload
12
5
 
13
6
  import psutil
14
7
  from starlette.requests import Request
15
8
 
16
9
  from spinta import commands
17
10
  from spinta.auth import Token, get_default_auth_client_id
18
- from spinta.components import Context, Config
19
- from spinta.components import UrlParams
11
+ from spinta.components import Config, Context, UrlParams
20
12
 
21
13
 
22
14
  class AccessLog:
spinta/accesslog/file.py CHANGED
@@ -1,16 +1,13 @@
1
- from typing import Any
2
- from typing import Dict
3
- from typing import TextIO, Union
4
-
5
1
  import json
6
- import sys
7
2
  import pathlib
3
+ import sys
4
+ from typing import Any, Dict, TextIO, Union
8
5
 
9
6
  from starlette.requests import Request
10
7
 
11
8
  from spinta import commands
12
9
  from spinta.accesslog import AccessLog
13
- from spinta.components import Context, Config, Store
10
+ from spinta.components import Config, Context, Store
14
11
 
15
12
 
16
13
  class FileAccessLog(AccessLog):
@@ -1,6 +1,5 @@
1
- from typing import Dict, Any
2
-
3
1
  import json
2
+ from typing import Any, Dict
4
3
 
5
4
  from spinta import commands
6
5
  from spinta.accesslog import AccessLog
@@ -6,10 +6,10 @@ from pathlib import Path
6
6
  from types import ModuleType
7
7
  from typing import Any, Callable
8
8
 
9
- from spinta.core.ufuncs import Expr, UFuncRegistry
10
9
  from spinta.core.config import RawConfig
11
- from spinta.ufuncs.loadbuilder.components import LoadBuilder
10
+ from spinta.core.ufuncs import Expr, UFuncRegistry
12
11
  from spinta.datasets.backends.dataframe.backends.soap.ufuncs.components import SoapQueryBuilder
12
+ from spinta.ufuncs.loadbuilder.components import LoadBuilder
13
13
 
14
14
  log = logging.getLogger(__name__)
15
15
 
spinta/api/__init__.py CHANGED
@@ -11,50 +11,51 @@ from starlette.datastructures import FormData
11
11
  from starlette.exceptions import HTTPException
12
12
  from starlette.middleware import Middleware
13
13
  from starlette.requests import Request
14
- from starlette.responses import RedirectResponse
15
- from starlette.responses import Response, JSONResponse
16
- from starlette.routing import Route, Mount
14
+ from starlette.responses import JSONResponse, RedirectResponse, Response
15
+ from starlette.routing import Mount, Route
17
16
  from starlette.staticfiles import StaticFiles
18
- from starlette.templating import Jinja2Templates
19
17
 
20
- from spinta import components, commands
18
+ from spinta import commands, components
21
19
  from spinta.accesslog import create_accesslog
22
- from spinta.api.validators import ClientAddData, ClientPatchData, ClientSecretPatchData, ClientBackendsData
20
+ from spinta.api.validators import ClientAddData, ClientBackendsData, ClientPatchData, ClientSecretPatchData
23
21
  from spinta.auth import (
24
22
  AuthorizationServer,
23
+ BearerTokenValidator,
24
+ KeyType,
25
+ ResourceProtector,
26
+ Scopes,
27
+ StarletteOAuth2Data,
28
+ authenticate_token,
25
29
  check_scope,
26
- query_client,
27
- get_clients_list,
28
30
  client_exists,
29
31
  create_client_file,
30
32
  delete_client_file,
31
- update_client_file,
33
+ get_auth_request,
34
+ get_auth_token,
35
+ get_clients_list,
32
36
  get_clients_path,
33
- Scopes,
34
- authenticate_token,
35
- StarletteOAuth2Data,
36
- KeyType,
37
- load_key_from_file,
38
37
  has_scope,
38
+ load_key_from_file,
39
+ query_client,
40
+ update_client_file,
39
41
  )
40
- from spinta.auth import BearerTokenValidator
41
- from spinta.auth import ResourceProtector
42
- from spinta.auth import get_auth_request
43
- from spinta.auth import get_auth_token
44
- from spinta.commands import prepare, get_version
42
+ from spinta.commands import get_version, prepare
45
43
  from spinta.components import Context, UrlParams
46
- from spinta.exceptions import BaseError, MultipleErrors, error_response, InsufficientPermission, ClientValidationError
47
- from spinta.exceptions import NoAuthServer
48
- from spinta.middlewares import ContextMiddleware
49
- from spinta.urlparams import Version
50
- from spinta.urlparams import get_response_type
51
- from spinta.utils.path import resource_filename
44
+ from spinta.exceptions import (
45
+ BaseError,
46
+ ClientValidationError,
47
+ InsufficientPermission,
48
+ MultipleErrors,
49
+ NoAuthServer,
50
+ error_response,
51
+ )
52
+ from spinta.formats.html.helpers import get_templates
53
+ from spinta.middlewares import ContextMiddleware, PathNormalizationMiddleware, StrictTransportSecurityMiddleware
54
+ from spinta.urlparams import Version, get_response_type
52
55
 
53
56
  log = logging.getLogger(__name__)
54
57
 
55
- templates = Jinja2Templates(
56
- directory=str(resource_filename("spinta", "templates")),
57
- )
58
+ templates = get_templates()
58
59
 
59
60
 
60
61
  async def favicon(request: Request):
@@ -369,7 +370,7 @@ async def error(request, exc):
369
370
  elif isinstance(exc, BaseError):
370
371
  status_code = exc.status_code
371
372
  errors = [error_response(exc)]
372
- headers = exc.headers
373
+ headers = dict(exc.headers)
373
374
  else:
374
375
  if isinstance(exc, HTTPException):
375
376
  status_code = exc.status_code
@@ -399,6 +400,11 @@ async def error(request, exc):
399
400
 
400
401
  response = {"errors": errors}
401
402
 
403
+ # Error responses can reflect request input (e.g. the requested path) and
404
+ # must never be stored by shared caches, otherwise they can be used for
405
+ # web cache poisoning.
406
+ headers["Cache-Control"] = "no-store"
407
+
402
408
  fmt = get_response_type(request.state.context, request)
403
409
  if fmt == "json" or fmt is None:
404
410
  return JSONResponse(
@@ -422,6 +428,7 @@ async def error(request, exc):
422
428
 
423
429
  async def srid_check(request: Request):
424
430
  from shapely.geometry import Point
431
+
425
432
  from spinta.types.geometry.helpers import get_osm_link
426
433
 
427
434
  srid = request.path_params["srid"]
@@ -460,7 +467,14 @@ def init(context: Context):
460
467
  Route("/{path:path}", homepage, methods=["HEAD", "GET", "POST", "PUT", "PATCH", "DELETE"]),
461
468
  ]
462
469
 
463
- middleware = [Middleware(ContextMiddleware, context=context)]
470
+ middleware = [
471
+ Middleware(
472
+ StrictTransportSecurityMiddleware,
473
+ value=config.http_strict_transport_security,
474
+ ),
475
+ Middleware(PathNormalizationMiddleware),
476
+ Middleware(ContextMiddleware, context=context),
477
+ ]
464
478
 
465
479
  exception_handlers = {
466
480
  Exception: error,
spinta/api/inspect.py CHANGED
@@ -1,23 +1,22 @@
1
1
  import os
2
2
  import tempfile
3
+ from typing import Tuple
3
4
 
4
- from starlette.requests import Request, FormData
5
5
  from starlette.datastructures import UploadFile
6
-
7
- from typing import Tuple
6
+ from starlette.requests import FormData, Request
8
7
 
9
8
  from spinta import commands
10
- from spinta.auth import check_scope, Scopes
9
+ from spinta.auth import Scopes, check_scope
11
10
  from spinta.components import Context, UrlParams
12
11
  from spinta.datasets.inspect.helpers import create_manifest_from_inspect
13
12
  from spinta.exceptions import (
14
- UnexpectedFormKeys,
15
13
  InvalidFormKeyCombination,
16
- RequiredFormKeyWithCondition,
17
- MissingFormKeys,
18
14
  InvalidInputData,
15
+ MissingFormKeys,
16
+ RequiredFormKeyWithCondition,
17
+ UnexpectedFormKeys,
19
18
  )
20
- from spinta.manifests.components import ManifestPath, Manifest
19
+ from spinta.manifests.components import Manifest, ManifestPath
21
20
 
22
21
 
23
22
  def _validate_form_data(form: FormData):
spinta/api/schema.py CHANGED
@@ -6,24 +6,24 @@ from starlette.requests import Request
6
6
  from starlette.responses import JSONResponse
7
7
 
8
8
  from spinta import commands
9
- from spinta.auth import check_scope, Scopes
9
+ from spinta.auth import Scopes, check_scope
10
10
  from spinta.cli.helpers.migrate import MigrationConfig
11
11
  from spinta.cli.helpers.store import prepare_manifest
12
- from spinta.components import Context, UrlParams, Store, Model, Config, Property
12
+ from spinta.components import Config, Context, Model, Property, Store, UrlParams
13
13
  from spinta.core.context import configure_context, create_context
14
14
  from spinta.datasets.inspect.helpers import zipitems
15
15
  from spinta.exceptions import (
16
- NotSupportedManifestType,
17
- InvalidSchemaUrlPath,
18
- InvalidName,
19
- UnknownContentType,
20
- FileSizeTooLarge,
21
16
  DatasetNameMissmatch,
22
17
  DatasetSchemaRequiresIds,
23
- ModifySchemaRequiresFile,
18
+ FileSizeTooLarge,
19
+ InvalidName,
20
+ InvalidSchemaUrlPath,
24
21
  ModifyOneDatasetSchema,
22
+ ModifySchemaRequiresFile,
23
+ NotSupportedManifestType,
24
+ UnknownContentType,
25
25
  )
26
- from spinta.manifests.components import ManifestPath, Manifest
26
+ from spinta.manifests.components import Manifest, ManifestPath
27
27
  from spinta.manifests.tabular.helpers import datasets_to_tabular
28
28
  from spinta.utils.naming import is_valid_namespace_name
29
29
  from spinta.utils.schema import NA
spinta/api/validators.py CHANGED
@@ -1,6 +1,6 @@
1
- from typing import Optional, Any
1
+ from typing import Any, Optional
2
2
 
3
- from pydantic import BaseModel, Field, ConfigDict
3
+ from pydantic import BaseModel, ConfigDict, Field
4
4
 
5
5
 
6
6
  class ClientAddData(BaseModel):
spinta/asgi.py CHANGED
@@ -1,6 +1,6 @@
1
+ from spinta import commands
1
2
  from spinta.api import init
2
3
  from spinta.core.context import create_context
3
- from spinta import commands
4
4
 
5
5
  context = create_context("asgi")
6
6
 
spinta/auth.py CHANGED
@@ -14,54 +14,48 @@ from collections import defaultdict
14
14
  from functools import cached_property
15
15
  from itertools import chain
16
16
  from threading import Lock
17
- from typing import Set, Any, TypedDict, Literal
18
- from typing import Type
19
- from typing import Union, List, Tuple
17
+ from typing import Any, List, Literal, Set, Tuple, Type, TypedDict, Union
20
18
 
21
19
  import requests
22
20
  import ruamel.yaml
23
- from authlib.jose import JsonWebKey, RSAKey, JWTClaims
24
- from authlib.jose import jwt
25
- from authlib.jose.errors import JoseError, DecodeError, InvalidTokenError, BadSignatureError
26
- from authlib.oauth2 import OAuth2Error
27
- from authlib.oauth2 import OAuth2Request
28
- from authlib.oauth2 import rfc6749
29
- from authlib.oauth2 import rfc6750
30
- from authlib.oauth2.rfc6749 import grants, OAuth2Payload, list_to_scope
21
+ from authlib.jose import JsonWebKey, JWTClaims, RSAKey, jwt
22
+ from authlib.jose.errors import BadSignatureError, DecodeError, InvalidTokenError, JoseError
23
+ from authlib.oauth2 import OAuth2Error, OAuth2Request, rfc6749, rfc6750
24
+ from authlib.oauth2.rfc6749 import OAuth2Payload, grants, list_to_scope
31
25
  from authlib.oauth2.rfc6749.errors import InvalidClientError
32
- from authlib.oauth2.rfc6750.errors import InsufficientScopeError
33
26
  from authlib.oauth2.rfc6749.util import scope_to_list
34
- from cachetools import cached, LRUCache
27
+ from authlib.oauth2.rfc6750.errors import InsufficientScopeError
28
+ from cachetools import LRUCache, cached
35
29
  from cachetools.keys import hashkey
36
30
  from cryptography.hazmat.backends import default_backend
37
31
  from cryptography.hazmat.primitives.asymmetric import rsa
38
32
  from multipledispatch import dispatch
39
33
  from requests import RequestException
40
- from starlette.datastructures import FormData, QueryParams, Headers
34
+ from starlette.datastructures import FormData, Headers, QueryParams
41
35
  from starlette.exceptions import HTTPException
42
36
  from starlette.responses import JSONResponse
43
37
 
44
38
  from spinta import commands
45
- from spinta.components import Config
46
- from spinta.components import Context, Namespace, Model, Property
47
- from spinta.components import ScopeFormatterFunc
39
+ from spinta.components import Config, Context, Model, Namespace, Property, ScopeFormatterFunc
48
40
  from spinta.core.enums import Access, Action
49
- from spinta.exceptions import AuthorizedClientsOnly, NoScopesForNamespaces, InvalidExtraScopes
50
- from spinta.exceptions import BasicAuthRequired
51
41
  from spinta.exceptions import (
52
- InvalidToken,
53
- NoTokenValidationKey,
54
- ClientWithNameAlreadyExists,
42
+ AuthorizedClientsOnly,
43
+ BasicAuthRequired,
55
44
  ClientAlreadyExists,
56
- ClientsKeymapNotFound,
57
45
  ClientsIdFolderNotFound,
46
+ ClientsKeymapNotFound,
47
+ ClientWithNameAlreadyExists,
48
+ InvalidClientFileFormat,
58
49
  InvalidClientsKeymapStructure,
50
+ InvalidExtraScopes,
59
51
  InvalidScopes,
60
- InvalidClientFileFormat,
52
+ InvalidToken,
61
53
  ModelNotFound,
54
+ NoScopesForNamespaces,
55
+ NoTokenValidationKey,
62
56
  )
63
57
  from spinta.utils import passwords
64
- from spinta.utils.config import get_clients_path, get_keymap_path, get_id_path, get_helpers_path
58
+ from spinta.utils.config import get_clients_path, get_helpers_path, get_id_path, get_keymap_path
65
59
  from spinta.utils.scopes import name_to_scope
66
60
  from spinta.utils.types import is_str_uuid
67
61
 
@@ -6,93 +6,80 @@ import decimal
6
6
  import json
7
7
  import pathlib
8
8
  import uuid
9
- from typing import Any
10
- from typing import AsyncIterator
11
- from typing import Dict
12
- from typing import Iterable
13
- from typing import List
14
- from typing import Optional
9
+ from typing import Any, AsyncIterator, Dict, Iterable, List, Optional
15
10
 
16
- from cbor2 import dumps as cbor_dumps
17
11
  import dateutil
18
12
  import shapely.geometry.base
19
- from geoalchemy2.elements import WKTElement, WKBElement
13
+ from cbor2 import dumps as cbor_dumps
14
+ from geoalchemy2.elements import WKBElement, WKTElement
20
15
  from geoalchemy2.shape import to_shape
21
16
  from shapely import wkt
22
17
 
23
- from spinta import commands
24
- from spinta import exceptions
25
- from spinta.backends.components import Backend
26
- from spinta.backends.components import SelectTree
27
- from spinta.backends.helpers import check_unknown_props, get_select_tree, prepare_response, is_accessible_by_equals_sign
28
- from spinta.backends.helpers import flat_select_to_nested
29
- from spinta.backends.helpers import get_model_reserved_props
30
- from spinta.backends.helpers import get_select_prop_names
31
- from spinta.backends.helpers import select_keys
32
- from spinta.backends.helpers import select_model_props
33
- from spinta.backends.helpers import select_props
34
- from spinta.commands import gen_object_id
35
- from spinta.commands import is_object_id
36
- from spinta.commands import load_operator_value
37
- from spinta.commands import prepare
38
- from spinta.components import Context
39
- from spinta.components import DataItem
40
- from spinta.components import Model
41
- from spinta.components import Namespace
42
- from spinta.components import Node
43
- from spinta.components import Property
44
- from spinta.components import UrlParams, page_in_data
18
+ from spinta import commands, exceptions
19
+ from spinta.backends.components import Backend, SelectTree
20
+ from spinta.backends.helpers import (
21
+ check_unknown_props,
22
+ flat_select_to_nested,
23
+ get_model_reserved_props,
24
+ get_select_prop_names,
25
+ get_select_tree,
26
+ is_accessible_by_equals_sign,
27
+ prepare_response,
28
+ select_keys,
29
+ select_model_props,
30
+ select_props,
31
+ )
32
+ from spinta.commands import gen_object_id, is_object_id, load_operator_value, prepare
33
+ from spinta.components import Context, DataItem, Model, Namespace, Node, Property, UrlParams, page_in_data
45
34
  from spinta.core.enums import Action
46
35
  from spinta.core.ufuncs import asttoexpr
47
36
  from spinta.exceptions import (
48
37
  ConflictingValue,
49
- RequiredProperty,
50
- LangNotDeclared,
51
- TooManyLangsGiven,
52
- UnableToDetermineRequiredLang,
53
38
  CoordinatesOutOfRange,
39
+ DirectRefValueUnassignment,
54
40
  InheritPropertyValueMissmatch,
55
- SRIDNotSetForGeometry,
56
41
  InvalidUuidValue,
57
- DirectRefValueUnassignment,
42
+ LangNotDeclared,
43
+ NoItemRevision,
44
+ RequiredProperty,
45
+ SRIDNotSetForGeometry,
46
+ TooManyLangsGiven,
47
+ UnableToDetermineRequiredLang,
58
48
  )
59
- from spinta.exceptions import NoItemRevision
60
49
  from spinta.formats.components import Format
61
50
  from spinta.manifests.components import Manifest
62
51
  from spinta.types.datatype import (
52
+ JSON,
53
+ UUID,
63
54
  Array,
64
- ExternalRef,
65
- Inherit,
66
- PageType,
67
- BackRef,
68
55
  ArrayBackRef,
69
- Integer,
56
+ BackRef,
57
+ Base32,
58
+ Binary,
70
59
  Boolean,
60
+ DataType,
61
+ Date,
62
+ DateTime,
71
63
  Denorm,
72
- Base32,
64
+ ExternalRef,
65
+ File,
66
+ Inherit,
67
+ Integer,
68
+ Number,
69
+ Object,
70
+ PageType,
71
+ PrimaryKey,
72
+ Ref,
73
73
  String,
74
+ Time,
74
75
  )
75
- from spinta.types.datatype import Binary
76
- from spinta.types.datatype import DataType
77
- from spinta.types.datatype import Date
78
- from spinta.types.datatype import DateTime
79
- from spinta.types.datatype import File
80
- from spinta.types.datatype import JSON
81
- from spinta.types.datatype import Number
82
- from spinta.types.datatype import Object
83
- from spinta.types.datatype import PrimaryKey
84
- from spinta.types.datatype import Ref
85
- from spinta.types.datatype import String
86
- from spinta.types.datatype import Time
87
- from spinta.types.datatype import UUID
88
76
  from spinta.types.geometry.components import Geometry
89
77
  from spinta.types.geometry.helpers import get_crs_bounding_area
90
78
  from spinta.types.text.components import Text
91
- from spinta.utils.types import is_nan
92
79
  from spinta.utils.config import asbool
93
80
  from spinta.utils.encoding import encode_page_values
94
- from spinta.utils.schema import NA
95
- from spinta.utils.schema import NotAvailable
81
+ from spinta.utils.schema import NA, NotAvailable
82
+ from spinta.utils.types import is_nan
96
83
 
97
84
 
98
85
  @commands.prepare_for_write.register(Context, Model, Backend, dict)
@@ -2,12 +2,9 @@ from __future__ import annotations
2
2
 
3
3
  import contextlib
4
4
  import dataclasses
5
- from typing import Any, Type
6
- from typing import Dict
7
- from typing import Optional
8
- from typing import Set
5
+ from typing import Any, Dict, Optional, Set, Type
9
6
 
10
- from spinta.backends.constants import BackendOrigin, BackendFeatures, DistributionType
7
+ from spinta.backends.constants import BackendFeatures, BackendOrigin, DistributionType
11
8
  from spinta.core.ufuncs import Env
12
9
  from spinta.ufuncs.resultbuilder.components import ResultBuilder
13
10
 
@@ -1,6 +1,6 @@
1
1
  from spinta import commands
2
- from spinta.components import Context
3
2
  from spinta.backends.fs.components import FileSystem
3
+ from spinta.components import Context
4
4
 
5
5
 
6
6
  @commands.bootstrap.register(Context, FileSystem)
@@ -1,8 +1,8 @@
1
1
  from typing import AsyncIterator
2
2
 
3
3
  from spinta import commands
4
- from spinta.components import Context, Property, DataItem
5
4
  from spinta.backends.fs.components import FileSystem
5
+ from spinta.components import Context, DataItem, Property
6
6
 
7
7
 
8
8
  @commands.create_changelog_entry.register(Context, Property, FileSystem)
@@ -1,10 +1,10 @@
1
1
  import pathlib
2
2
 
3
3
  from spinta import commands
4
+ from spinta.backends.fs.components import FileSystem
4
5
  from spinta.components import Context
5
- from spinta.types.datatype import File
6
6
  from spinta.formats.components import Format
7
- from spinta.backends.fs.components import FileSystem
7
+ from spinta.types.datatype import File
8
8
 
9
9
 
10
10
  @commands.decode.register(Context, Format, FileSystem, File, dict)
@@ -3,7 +3,7 @@ from typing import Optional, Union
3
3
  from spinta import commands
4
4
  from spinta.components import Context
5
5
  from spinta.types.datatype import File
6
- from spinta.utils.schema import NotAvailable, NA
6
+ from spinta.utils.schema import NA, NotAvailable
7
7
 
8
8
 
9
9
  @commands.build_data_patch_for_write.register(Context, File)
@@ -1,9 +1,9 @@
1
1
  from spinta import commands
2
- from spinta.components import Context, Attachment
3
- from spinta.manifests.components import Manifest
4
2
  from spinta.backends.components import Backend
5
- from spinta.types.datatype import File
6
3
  from spinta.backends.fs.components import FileSystem
4
+ from spinta.components import Attachment, Context
5
+ from spinta.manifests.components import Manifest
6
+ from spinta.types.datatype import File
7
7
 
8
8
 
9
9
  @commands.prepare.register(Context, FileSystem, Manifest)
@@ -1,9 +1,9 @@
1
1
  import pathlib
2
- from typing import Dict, Any
2
+ from typing import Any, Dict
3
3
 
4
4
  from spinta import commands
5
- from spinta.components import Context
6
5
  from spinta.backends.fs.components import FileSystem
6
+ from spinta.components import Context
7
7
 
8
8
 
9
9
  @commands.load.register(Context, FileSystem, dict)
@@ -1,7 +1,7 @@
1
1
  from spinta import commands
2
+ from spinta.backends.fs.components import FileSystem
2
3
  from spinta.components import Context
3
4
  from spinta.manifests.components import Manifest
4
- from spinta.backends.fs.components import FileSystem
5
5
 
6
6
 
7
7
  @commands.migrate.register(Context, Manifest, FileSystem)
@@ -1,15 +1,12 @@
1
- from typing import Optional
2
- from typing import overload
3
1
  from pathlib import Path
2
+ from typing import Optional, overload
4
3
 
5
- from spinta.typing import ObjectData
6
- from spinta.typing import FileObjectData
7
4
  from spinta import commands
8
- from spinta.components import Context
9
- from spinta.components import Property
10
5
  from spinta.backends.fs.components import FileSystem
11
- from spinta.types.datatype import DataType, File
6
+ from spinta.components import Context, Property
12
7
  from spinta.exceptions import ItemDoesNotExist
8
+ from spinta.types.datatype import DataType, File
9
+ from spinta.typing import FileObjectData, ObjectData
13
10
 
14
11
 
15
12
  @overload
@@ -1,13 +1,13 @@
1
1
  import os
2
-
3
2
  from pathlib import Path
3
+
4
4
  from spinta import commands
5
- from spinta.components import Context, Property, DataItem
6
- from spinta.core.enums import Action
7
5
  from spinta.backends.components import Backend
8
- from spinta.types.datatype import DataType, File
9
6
  from spinta.backends.fs.components import FileSystem
10
- from spinta.exceptions import FileNotFound, ConflictingValue, UnacceptableFileName
7
+ from spinta.components import Context, DataItem, Property
8
+ from spinta.core.enums import Action
9
+ from spinta.exceptions import ConflictingValue, FileNotFound, UnacceptableFileName
10
+ from spinta.types.datatype import DataType, File
11
11
 
12
12
 
13
13
  @commands.simple_data_check.register(Context, DataItem, File, Property, FileSystem, dict)
@@ -1,6 +1,6 @@
1
1
  from spinta import commands
2
- from spinta.components import Context
3
2
  from spinta.backends.fs.components import FileSystem
3
+ from spinta.components import Context
4
4
 
5
5
 
6
6
  @commands.wait.register(Context, FileSystem)
@@ -1,7 +1,7 @@
1
1
  from spinta import commands
2
+ from spinta.backends.fs.components import FileSystem
2
3
  from spinta.commands import getall
3
4
  from spinta.components import Context
4
- from spinta.backends.fs.components import FileSystem
5
5
  from spinta.types.datatype import File
6
6
  from spinta.utils.data import take
7
7