cognite-neat 1.0.25__tar.gz → 1.0.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/PKG-INFO +1 -1
- cognite_neat-1.0.26/cognite/neat/_client/api.py +178 -0
- cognite_neat-1.0.26/cognite/neat/_client/containers_api.py +77 -0
- cognite_neat-1.0.26/cognite/neat/_client/data_model_api.py +87 -0
- cognite_neat-1.0.26/cognite/neat/_client/filters.py +40 -0
- cognite_neat-1.0.26/cognite/neat/_client/spaces_api.py +80 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_client/statistics_api.py +9 -4
- cognite_neat-1.0.26/cognite/neat/_client/views_api.py +94 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_base.py +3 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/http_client/_client.py +3 -1
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/http_client/_data_classes.py +3 -3
- cognite_neat-1.0.26/cognite/neat/_version.py +2 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/pyproject.toml +1 -1
- cognite_neat-1.0.25/cognite/neat/_client/api.py +0 -8
- cognite_neat-1.0.25/cognite/neat/_client/containers_api.py +0 -138
- cognite_neat-1.0.25/cognite/neat/_client/data_model_api.py +0 -115
- cognite_neat-1.0.25/cognite/neat/_client/spaces_api.py +0 -115
- cognite_neat-1.0.25/cognite/neat/_client/views_api.py +0 -144
- cognite_neat-1.0.25/cognite/neat/_version.py +0 -2
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/README.md +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_client/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_client/client.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_client/config.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_client/data_classes.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_client/init/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_client/init/credentials.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_client/init/env_vars.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_client/init/interactive.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_client/init/main.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_config.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/_analysis.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/_constants.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/_identifiers.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/_shared.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/_snapshot.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/deployer/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/deployer/_differ.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/deployer/_differ_container.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/deployer/_differ_data_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/deployer/_differ_space.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/deployer/_differ_view.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/deployer/data_classes.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/deployer/deployer.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/exporters/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/exporters/_api_exporter.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/exporters/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/exporters/_table_exporter/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/exporters/_table_exporter/exporter.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/exporters/_table_exporter/workbook.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/exporters/_table_exporter/writer.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/importers/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/importers/_api_importer.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/importers/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/importers/_table_importer/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/importers/_table_importer/data_classes.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/importers/_table_importer/importer.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/importers/_table_importer/reader.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/importers/_table_importer/source.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/conceptual/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/conceptual/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/conceptual/_concept.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/conceptual/_data_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/conceptual/_properties.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/conceptual/_property.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_constants.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_constraints.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_container.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_data_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_data_types.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_http.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_indexes.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_limits.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_references.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_schema.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_space.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_types.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_view_filter.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_view_property.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/dms/_views.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/entities/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/entities/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/entities/_constants.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/entities/_data_types.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/entities/_identifiers.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/models/entities/_parser.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/validation/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/validation/dms/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/validation/dms/_ai_readiness.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/validation/dms/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/validation/dms/_connections.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/validation/dms/_consistency.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/validation/dms/_containers.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/validation/dms/_limits.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/validation/dms/_orchestrator.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_data_model/validation/dms/_views.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_exceptions.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_issues.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_html/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_html/_render.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_html/static/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_html/static/deployment.css +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_html/static/deployment.js +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_html/static/issues.css +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_html/static/issues.js +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_html/static/shared.css +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_html/templates/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_html/templates/deployment.html +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_html/templates/issues.html +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_issues.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_physical.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_result/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_result/_deployment/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_result/_deployment/_physical/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_result/_deployment/_physical/_changes.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_result/_deployment/_physical/_statistics.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_result/_deployment/_physical/serializer.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_result/_result.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_session.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_usage_analytics/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_usage_analytics/_collector.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_usage_analytics/_constants.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_usage_analytics/_storage.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_session/_wrappers.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_state_machine/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_state_machine/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_state_machine/_states.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_store/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_store/_provenance.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_store/_store.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/_reader.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/auxiliary.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/collection.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/http_client/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/http_client/_config.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/http_client/_tracker.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/repo.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/text.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/useful_types.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/validation.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/_api/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/_api/data_modeling_loaders.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/_api/neat_instances.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/_api/schema.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/_api/statistics.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/_api_client.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/data_classes/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/data_classes/data_modeling.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/data_classes/neat_sequence.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/data_classes/schema.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/data_classes/statistics.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_client/testing.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_config.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_constants.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/_constants.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/_shared.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/analysis/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/analysis/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/catalog/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/catalog/classic_model.xlsx +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/catalog/conceptual-imf-data-model.xlsx +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/catalog/hello_world_pump.xlsx +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/exporters/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/exporters/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/exporters/_data_model2dms.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/exporters/_data_model2excel.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/exporters/_data_model2instance_template.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/exporters/_data_model2semantic_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/exporters/_data_model2yaml.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/_base_file_reader.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/_dict2data_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/_dms2data_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/_graph2data_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/_rdf/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/_rdf/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/_rdf/_inference2rdata_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/_rdf/_owl2data_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/_rdf/_shared.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/importers/_spreadsheet2data_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/_base_unverified.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/_base_verified.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/_import_contexts.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/_types.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/conceptual/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/conceptual/_unverified.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/conceptual/_validation.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/conceptual/_verified.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/data_types.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/entities/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/entities/_constants.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/entities/_loaders.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/entities/_multi_value.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/entities/_restrictions.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/entities/_single_value.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/entities/_types.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/entities/_wrapped.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/mapping/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/mapping/_classic2core.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/mapping/_classic2core.yaml +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/physical/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/physical/_exporter.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/physical/_unverified.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/physical/_validation.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/models/physical/_verified.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/transformers/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/transformers/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/transformers/_converters.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/transformers/_mapping.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/transformers/_union_conceptual.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_data_model/transformers/_verification.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/_shared.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/_tracking/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/_tracking/base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/_tracking/log.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/examples/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_classic.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_data_sets.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_relationships.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_sequences.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_dict.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_dms.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_dms_graph.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_raw.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/extractors/_rdf_file.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/loaders/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/loaders/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/loaders/_rdf2dms.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/loaders/_rdf_to_instance_space.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/queries/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/queries/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/queries/_queries.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/queries/_select.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/queries/_update.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/transformers/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/transformers/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/transformers/_classic_cdf.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/transformers/_prune_graph.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/transformers/_rdfpath.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_instances/transformers/_value_type.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/_contextmanagers.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/_factory.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/errors/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/errors/_external.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/errors/_general.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/errors/_properties.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/errors/_resources.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/errors/_wrapper.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/formatters.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/warnings/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/warnings/_external.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/warnings/_general.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/warnings/_models.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/warnings/_properties.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/warnings/_resources.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_issues/warnings/user_modeling.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_shared.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_store/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_store/_data_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_store/_instance.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_store/_provenance.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_store/exceptions.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/auth.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/auxiliary.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/collection_.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/graph_transformations_report.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/io_.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/rdf_.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/reader/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/reader/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/spreadsheet.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/tarjan.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/text.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/time_.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/upload.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/core/_utils/xml_.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/engine/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/engine/_import.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/engine/_interface.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/engine/_load.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/plugins/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/plugins/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/plugins/_data_model.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/plugins/_issues.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/plugins/_manager.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/__init__.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_base.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_collector.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_diff.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_drop.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_experimental.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_explore.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_fix.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_inspect.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_mapping.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_plugin.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_prepare.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_read.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_set.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_show.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_state/README.md +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_state.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_subset.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_template.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_to.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/_wizard.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_v0/session/exceptions.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/legacy.py +0 -0
- {cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognite-neat
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.26
|
|
4
4
|
Summary: Knowledge graph transformation
|
|
5
5
|
Author: Nikola Vasiljevic, Anders Albert
|
|
6
6
|
Author-email: Nikola Vasiljevic <nikola.vasiljevic@cognite.com>, Anders Albert <anders.albert@cognite.com>
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from collections.abc import Iterable, Sequence
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any, Generic, Literal, TypeAlias, TypeVar
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, JsonValue, TypeAdapter
|
|
7
|
+
|
|
8
|
+
from cognite.neat._client.config import NeatClientConfig
|
|
9
|
+
from cognite.neat._data_model.models.dms._base import T_Resource, T_Response
|
|
10
|
+
from cognite.neat._utils.collection import chunker_sequence
|
|
11
|
+
from cognite.neat._utils.http_client import HTTPClient, ParametersRequest, SimpleBodyRequest, SuccessResponse
|
|
12
|
+
from cognite.neat._utils.useful_types import T_Reference
|
|
13
|
+
|
|
14
|
+
from .data_classes import PagedResponse
|
|
15
|
+
|
|
16
|
+
_T_BaseModel = TypeVar("_T_BaseModel", bound=BaseModel)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@dataclass(frozen=True)
|
|
20
|
+
class Endpoint:
|
|
21
|
+
method: Literal["GET", "POST"]
|
|
22
|
+
path: str
|
|
23
|
+
item_limit: int
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
APIMethod: TypeAlias = Literal["apply", "retrieve", "delete", "list"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class NeatAPI(Generic[T_Reference, T_Resource, T_Response], ABC):
|
|
30
|
+
def __init__(
|
|
31
|
+
self, neat_config: NeatClientConfig, http_client: HTTPClient, endpoint_map: dict[APIMethod, Endpoint]
|
|
32
|
+
) -> None:
|
|
33
|
+
self._config = neat_config
|
|
34
|
+
self._http_client = http_client
|
|
35
|
+
self._method_endpoint_map = endpoint_map
|
|
36
|
+
|
|
37
|
+
@abstractmethod
|
|
38
|
+
def _validate_page_response(self, response: SuccessResponse) -> PagedResponse[T_Response]:
|
|
39
|
+
"""Parse a single item response."""
|
|
40
|
+
raise NotImplementedError()
|
|
41
|
+
|
|
42
|
+
@abstractmethod
|
|
43
|
+
def _validate_id_response(self, response: SuccessResponse) -> list[T_Reference]:
|
|
44
|
+
"""Parse a single item response."""
|
|
45
|
+
raise NotImplementedError()
|
|
46
|
+
|
|
47
|
+
def _make_url(self, path: str = "") -> str:
|
|
48
|
+
"""Create the full URL for this resource endpoint."""
|
|
49
|
+
return self._config.create_api_url(path)
|
|
50
|
+
|
|
51
|
+
def _request_item_response(
|
|
52
|
+
self,
|
|
53
|
+
items: Sequence[BaseModel],
|
|
54
|
+
method: APIMethod,
|
|
55
|
+
extra_body: dict[str, Any] | None = None,
|
|
56
|
+
) -> list[T_Response]:
|
|
57
|
+
response_items: list[T_Response] = []
|
|
58
|
+
for response in self._chunk_requests(items, method, extra_body):
|
|
59
|
+
response_items.extend(self._validate_page_response(response).items)
|
|
60
|
+
return response_items
|
|
61
|
+
|
|
62
|
+
def _request_id_response(
|
|
63
|
+
self,
|
|
64
|
+
items: Sequence[BaseModel],
|
|
65
|
+
method: APIMethod,
|
|
66
|
+
extra_body: dict[str, Any] | None = None,
|
|
67
|
+
) -> list[T_Reference]:
|
|
68
|
+
response_items: list[T_Reference] = []
|
|
69
|
+
for response in self._chunk_requests(items, method, extra_body):
|
|
70
|
+
response_items.extend(self._validate_id_response(response))
|
|
71
|
+
return response_items
|
|
72
|
+
|
|
73
|
+
def _chunk_requests(
|
|
74
|
+
self,
|
|
75
|
+
items: Sequence[_T_BaseModel],
|
|
76
|
+
method: APIMethod,
|
|
77
|
+
extra_body: dict[str, Any] | None = None,
|
|
78
|
+
) -> Iterable[SuccessResponse]:
|
|
79
|
+
"""Send requests in chunks and yield responses.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
items: The items to process.
|
|
83
|
+
method: The API method to use. This is used ot look the up the endpoint.
|
|
84
|
+
extra_body: Optional extra body content to include in the request.
|
|
85
|
+
|
|
86
|
+
Yields:
|
|
87
|
+
The successful responses from the API.
|
|
88
|
+
"""
|
|
89
|
+
# Filter out None
|
|
90
|
+
endpoint = self._method_endpoint_map[method]
|
|
91
|
+
|
|
92
|
+
for chunk in chunker_sequence(items, endpoint.item_limit):
|
|
93
|
+
request = SimpleBodyRequest(
|
|
94
|
+
endpoint_url=self._make_url(endpoint.path),
|
|
95
|
+
method=endpoint.method,
|
|
96
|
+
body=TypeAdapter(dict[str, JsonValue]).dump_json(
|
|
97
|
+
{
|
|
98
|
+
"items": [item.model_dump(by_alias=True) for item in chunk],
|
|
99
|
+
**(extra_body or {}),
|
|
100
|
+
},
|
|
101
|
+
),
|
|
102
|
+
)
|
|
103
|
+
response = self._http_client.request_with_retries(request)
|
|
104
|
+
response.raise_for_status()
|
|
105
|
+
yield response.success_response
|
|
106
|
+
|
|
107
|
+
@classmethod
|
|
108
|
+
def _filter_out_none_values(cls, params: dict[str, Any] | None) -> dict[str, Any] | None:
|
|
109
|
+
request_params: dict[str, Any] | None = None
|
|
110
|
+
if params:
|
|
111
|
+
request_params = {k: v for k, v in params.items() if v is not None}
|
|
112
|
+
return request_params
|
|
113
|
+
|
|
114
|
+
def _paginate(
|
|
115
|
+
self,
|
|
116
|
+
limit: int,
|
|
117
|
+
cursor: str | None = None,
|
|
118
|
+
params: dict[str, Any] | None = None,
|
|
119
|
+
) -> PagedResponse[T_Response]:
|
|
120
|
+
"""Fetch a single page of resources.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
params: Query parameters for the request. Supported parameters depend on
|
|
124
|
+
the resource type but typically include:
|
|
125
|
+
- cursor: Cursor for pagination
|
|
126
|
+
- limit: Maximum number of items (defaults to list limit)
|
|
127
|
+
- space: Filter by space
|
|
128
|
+
- includeGlobal: Whether to include global resources
|
|
129
|
+
limit: Maximum number of items to return in the page.
|
|
130
|
+
cursor: Cursor for pagination.
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
A Page containing the items and the cursor for the next page.
|
|
134
|
+
"""
|
|
135
|
+
endpoint = self._method_endpoint_map["list"]
|
|
136
|
+
if not (0 < limit <= endpoint.item_limit):
|
|
137
|
+
raise ValueError(f"Limit must be between 1 and {endpoint.item_limit}, got {limit}.")
|
|
138
|
+
if endpoint.method != "GET":
|
|
139
|
+
raise NotImplementedError(f"Pagination not implemented for method {endpoint.method}.")
|
|
140
|
+
request_params = self._filter_out_none_values(params) or {}
|
|
141
|
+
request_params["limit"] = limit
|
|
142
|
+
if cursor is not None:
|
|
143
|
+
request_params["cursor"] = cursor
|
|
144
|
+
request = ParametersRequest(
|
|
145
|
+
endpoint_url=self._make_url(endpoint.path),
|
|
146
|
+
method=endpoint.method,
|
|
147
|
+
parameters=request_params,
|
|
148
|
+
)
|
|
149
|
+
result = self._http_client.request_with_retries(request)
|
|
150
|
+
result.raise_for_status()
|
|
151
|
+
return self._validate_page_response(result.success_response)
|
|
152
|
+
|
|
153
|
+
def _iterate(
|
|
154
|
+
self,
|
|
155
|
+
limit: int | None = None,
|
|
156
|
+
cursor: str | None = None,
|
|
157
|
+
params: dict[str, Any] | None = None,
|
|
158
|
+
) -> Iterable[list[T_Response]]:
|
|
159
|
+
"""Iterate over all resources, handling pagination automatically."""
|
|
160
|
+
next_cursor = cursor
|
|
161
|
+
total = 0
|
|
162
|
+
endpoint = self._method_endpoint_map["list"]
|
|
163
|
+
while True:
|
|
164
|
+
page_limit = endpoint.item_limit if limit is None else min(limit - total, endpoint.item_limit)
|
|
165
|
+
page = self._paginate(limit=page_limit, cursor=next_cursor, params=params)
|
|
166
|
+
yield page.items
|
|
167
|
+
total += len(page.items)
|
|
168
|
+
if page.next_cursor is None or (limit is not None and total >= limit):
|
|
169
|
+
break
|
|
170
|
+
next_cursor = page.next_cursor
|
|
171
|
+
|
|
172
|
+
def _list(
|
|
173
|
+
self,
|
|
174
|
+
limit: int | None = None,
|
|
175
|
+
params: dict[str, Any] | None = None,
|
|
176
|
+
) -> list[T_Response]:
|
|
177
|
+
"""List all resources, handling pagination automatically."""
|
|
178
|
+
return [item for batch in self._iterate(limit=limit, params=params) for item in batch]
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
from collections.abc import Sequence
|
|
2
|
+
|
|
3
|
+
from cognite.neat._data_model.models.dms import ContainerReference, ContainerRequest, ContainerResponse
|
|
4
|
+
from cognite.neat._utils.http_client import HTTPClient, SuccessResponse
|
|
5
|
+
|
|
6
|
+
from .api import Endpoint, NeatAPI
|
|
7
|
+
from .config import NeatClientConfig
|
|
8
|
+
from .data_classes import PagedResponse
|
|
9
|
+
from .filters import ContainerFilter
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ContainersAPI(NeatAPI):
|
|
13
|
+
def __init__(self, neat_config: NeatClientConfig, http_client: HTTPClient) -> None:
|
|
14
|
+
super().__init__(
|
|
15
|
+
neat_config,
|
|
16
|
+
http_client,
|
|
17
|
+
endpoint_map={
|
|
18
|
+
"apply": Endpoint("POST", "models/containers", item_limit=100),
|
|
19
|
+
"retrieve": Endpoint("POST", "models/containers/byids", item_limit=100),
|
|
20
|
+
"delete": Endpoint("POST", "models/containers/delete", item_limit=100),
|
|
21
|
+
"list": Endpoint("GET", "models/containers", item_limit=1000),
|
|
22
|
+
},
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def _validate_page_response(self, response: SuccessResponse) -> PagedResponse[ContainerResponse]:
|
|
26
|
+
return PagedResponse[ContainerResponse].model_validate_json(response.body)
|
|
27
|
+
|
|
28
|
+
def _validate_id_response(self, response: SuccessResponse) -> list[ContainerReference]:
|
|
29
|
+
return PagedResponse[ContainerReference].model_validate_json(response.body).items
|
|
30
|
+
|
|
31
|
+
def apply(self, items: Sequence[ContainerRequest]) -> list[ContainerResponse]:
|
|
32
|
+
"""Apply (create or update) containers in CDF.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
items: List of ContainerRequest objects to apply.
|
|
36
|
+
Returns:
|
|
37
|
+
List of ContainerResponse objects.
|
|
38
|
+
"""
|
|
39
|
+
return self._request_item_response(items, "apply")
|
|
40
|
+
|
|
41
|
+
def retrieve(self, items: list[ContainerReference]) -> list[ContainerResponse]:
|
|
42
|
+
"""Retrieve containers by their identifiers.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
items: List of (space, external_id) tuples identifying the containers to retrieve.
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
List of ContainerResponse objects.
|
|
49
|
+
"""
|
|
50
|
+
return self._request_item_response(items, "retrieve")
|
|
51
|
+
|
|
52
|
+
def delete(self, items: list[ContainerReference]) -> list[ContainerReference]:
|
|
53
|
+
"""Delete containers by their identifiers.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
items: List of ContainerReference objects identifying the containers to delete.
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
List of ContainerReference objects representing the deleted containers.
|
|
60
|
+
"""
|
|
61
|
+
return self._request_id_response(items, "delete")
|
|
62
|
+
|
|
63
|
+
def list(
|
|
64
|
+
self, space: str | None = None, include_global: bool = False, limit: int | None = 10
|
|
65
|
+
) -> list[ContainerResponse]:
|
|
66
|
+
"""List containers in CDF Project.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
space: If specified, only containers in this space are returned.
|
|
70
|
+
include_global: If True, include global containers.
|
|
71
|
+
limit: Maximum number of containers to return. If None, return all containers.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
List of ContainerResponse objects.
|
|
75
|
+
"""
|
|
76
|
+
filter = ContainerFilter(space=space, include_global=include_global)
|
|
77
|
+
return self._list(limit=limit, params=filter.dump())
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
from collections.abc import Sequence
|
|
2
|
+
|
|
3
|
+
from cognite.neat._data_model.models.dms import DataModelReference, DataModelRequest, DataModelResponse
|
|
4
|
+
from cognite.neat._utils.http_client import HTTPClient, SuccessResponse
|
|
5
|
+
|
|
6
|
+
from .api import Endpoint, NeatAPI
|
|
7
|
+
from .config import NeatClientConfig
|
|
8
|
+
from .data_classes import PagedResponse
|
|
9
|
+
from .filters import DataModelFilter
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class DataModelsAPI(NeatAPI):
|
|
13
|
+
def __init__(self, neat_config: NeatClientConfig, http_client: HTTPClient) -> None:
|
|
14
|
+
super().__init__(
|
|
15
|
+
neat_config,
|
|
16
|
+
http_client,
|
|
17
|
+
endpoint_map={
|
|
18
|
+
"apply": Endpoint("POST", "/models/datamodels", item_limit=100),
|
|
19
|
+
"retrieve": Endpoint("POST", "/models/datamodels/byids", item_limit=100),
|
|
20
|
+
"delete": Endpoint("POST", "/models/datamodels/delete", item_limit=100),
|
|
21
|
+
"list": Endpoint("GET", "/models/datamodels", item_limit=1000),
|
|
22
|
+
},
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def _validate_page_response(self, response: SuccessResponse) -> PagedResponse[DataModelResponse]:
|
|
26
|
+
return PagedResponse[DataModelResponse].model_validate_json(response.body)
|
|
27
|
+
|
|
28
|
+
def _validate_id_response(self, response: SuccessResponse) -> list[DataModelReference]:
|
|
29
|
+
return PagedResponse[DataModelReference].model_validate_json(response.body).items
|
|
30
|
+
|
|
31
|
+
def apply(self, data_models: Sequence[DataModelRequest]) -> list[DataModelResponse]:
|
|
32
|
+
"""Apply (create or update) data models in CDF.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
data_models: List of DataModelRequest objects to apply.
|
|
36
|
+
Returns:
|
|
37
|
+
List of DataModelResponse objects.
|
|
38
|
+
"""
|
|
39
|
+
return self._request_item_response(data_models, "apply")
|
|
40
|
+
|
|
41
|
+
def retrieve(self, items: list[DataModelReference]) -> list[DataModelResponse]:
|
|
42
|
+
"""Retrieve data models by their identifiers.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
items: List of data models references identifying the data models to retrieve.
|
|
46
|
+
Returns:
|
|
47
|
+
List of DataModelResponse objects.
|
|
48
|
+
"""
|
|
49
|
+
return self._request_item_response(items, "retrieve")
|
|
50
|
+
|
|
51
|
+
def delete(self, items: list[DataModelReference]) -> list[DataModelReference]:
|
|
52
|
+
"""Delete data models by their identifiers.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
items: List of data model references identifying the data models to delete.
|
|
56
|
+
Returns:
|
|
57
|
+
List of DataModelReference objects representing the deleted data models.
|
|
58
|
+
"""
|
|
59
|
+
return self._request_id_response(items, "delete")
|
|
60
|
+
|
|
61
|
+
def list(
|
|
62
|
+
self,
|
|
63
|
+
space: str | None = None,
|
|
64
|
+
all_versions: bool = False,
|
|
65
|
+
inline_views: bool = False,
|
|
66
|
+
include_global: bool = False,
|
|
67
|
+
limit: int | None = 10,
|
|
68
|
+
) -> list[DataModelResponse]:
|
|
69
|
+
"""List data models in CDF Project.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
space: If specified, only data models in this space are returned.
|
|
73
|
+
all_versions: If True, return all versions. If False, only return the latest version.
|
|
74
|
+
inline_views: If True, include views inline in the response.
|
|
75
|
+
include_global: If True, include global data models.
|
|
76
|
+
limit: Maximum number of data models to return. If None, return all data models.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
List of DataModelResponse objects.
|
|
80
|
+
"""
|
|
81
|
+
filter = DataModelFilter(
|
|
82
|
+
space=space,
|
|
83
|
+
all_versions=all_versions,
|
|
84
|
+
inline_views=inline_views,
|
|
85
|
+
include_global=include_global,
|
|
86
|
+
)
|
|
87
|
+
return self._list(limit=limit, params=filter.dump())
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from typing import Any, Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, ConfigDict
|
|
4
|
+
from pydantic.alias_generators import to_camel
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class BaseModelRequest(BaseModel):
|
|
8
|
+
"""Base class for all object. This includes resources and nested objects."""
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Filter(BaseModel):
|
|
12
|
+
model_config = ConfigDict(alias_generator=to_camel, extra="ignore", populate_by_name=True)
|
|
13
|
+
|
|
14
|
+
def dump(self, camel_case: bool = True) -> dict[str, Any]:
|
|
15
|
+
"""Dump the object to a dictionary.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
camel_case (bool): Whether to use camelCase for the keys. Default is True.
|
|
19
|
+
|
|
20
|
+
"""
|
|
21
|
+
return self.model_dump(mode="json", by_alias=camel_case, exclude_unset=True)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class DataModelingFilter(Filter):
|
|
25
|
+
space: str | None = None
|
|
26
|
+
include_global: bool | None = None
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ContainerFilter(DataModelingFilter):
|
|
30
|
+
used_for: Literal["node", "edge", "record", "all"] | None = None
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ViewFilter(DataModelingFilter):
|
|
34
|
+
include_inherited_properties: bool | None = None
|
|
35
|
+
all_versions: bool | None = None
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class DataModelFilter(DataModelingFilter):
|
|
39
|
+
inline_views: bool | None = None
|
|
40
|
+
all_versions: bool | None = None
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Sequence
|
|
4
|
+
|
|
5
|
+
from cognite.neat._data_model.models.dms import SpaceRequest, SpaceResponse
|
|
6
|
+
from cognite.neat._data_model.models.dms._references import SpaceReference
|
|
7
|
+
from cognite.neat._utils.http_client import HTTPClient, SuccessResponse
|
|
8
|
+
|
|
9
|
+
from .api import Endpoint, NeatAPI
|
|
10
|
+
from .config import NeatClientConfig
|
|
11
|
+
from .data_classes import PagedResponse
|
|
12
|
+
from .filters import DataModelingFilter
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class SpacesAPI(NeatAPI):
|
|
16
|
+
def __init__(self, neat_config: NeatClientConfig, http_client: HTTPClient) -> None:
|
|
17
|
+
super().__init__(
|
|
18
|
+
neat_config,
|
|
19
|
+
http_client,
|
|
20
|
+
endpoint_map={
|
|
21
|
+
"apply": Endpoint("POST", "/models/spaces", item_limit=100),
|
|
22
|
+
"retrieve": Endpoint("POST", "/models/spaces/byids", item_limit=100),
|
|
23
|
+
"delete": Endpoint("POST", "/models/spaces/delete", item_limit=100),
|
|
24
|
+
"list": Endpoint("GET", "/models/spaces", item_limit=1000),
|
|
25
|
+
},
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
def _validate_page_response(self, response: SuccessResponse) -> PagedResponse[SpaceResponse]:
|
|
29
|
+
return PagedResponse[SpaceResponse].model_validate_json(response.body)
|
|
30
|
+
|
|
31
|
+
def _validate_id_response(self, response: SuccessResponse) -> list[SpaceReference]:
|
|
32
|
+
return PagedResponse[SpaceReference].model_validate_json(response.body).items
|
|
33
|
+
|
|
34
|
+
def apply(self, spaces: Sequence[SpaceRequest]) -> list[SpaceResponse]:
|
|
35
|
+
"""Apply (create or update) spaces in CDF.
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
spaces: List of SpaceRequest objects to apply.
|
|
39
|
+
Returns:
|
|
40
|
+
List of SpaceResponse objects.
|
|
41
|
+
"""
|
|
42
|
+
return self._request_item_response(spaces, "apply")
|
|
43
|
+
|
|
44
|
+
def retrieve(self, spaces: list[SpaceReference]) -> list[SpaceResponse]:
|
|
45
|
+
"""Retrieve spaces by their identifiers.
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
spaces: List of space identifiers to retrieve.
|
|
49
|
+
|
|
50
|
+
Returns:
|
|
51
|
+
List of SpaceResponse objects.
|
|
52
|
+
"""
|
|
53
|
+
return self._request_item_response(spaces, "retrieve")
|
|
54
|
+
|
|
55
|
+
def delete(self, spaces: list[SpaceReference]) -> list[SpaceReference]:
|
|
56
|
+
"""Delete spaces by their identifiers.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
spaces: List of space identifiers to delete.
|
|
60
|
+
Returns:
|
|
61
|
+
List of SpaceReference objects representing the deleted spaces.
|
|
62
|
+
"""
|
|
63
|
+
return self._request_id_response(spaces, "delete")
|
|
64
|
+
|
|
65
|
+
def list(
|
|
66
|
+
self,
|
|
67
|
+
include_global: bool = False,
|
|
68
|
+
limit: int | None = 10,
|
|
69
|
+
) -> list[SpaceResponse]:
|
|
70
|
+
"""List spaces in CDF Project.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
include_global: If True, include global spaces.
|
|
74
|
+
limit: Maximum number of spaces to return. If None, return all spaces.
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
List of SpaceResponse objects.
|
|
78
|
+
"""
|
|
79
|
+
filter = DataModelingFilter(include_global=include_global)
|
|
80
|
+
return self._list(limit=limit, params=filter.dump())
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
from cognite.neat.
|
|
2
|
-
from cognite.neat._client.data_classes import StatisticsResponse
|
|
3
|
-
from cognite.neat._utils.http_client import ParametersRequest
|
|
1
|
+
from cognite.neat._utils.http_client import HTTPClient, ParametersRequest
|
|
4
2
|
|
|
3
|
+
from .config import NeatClientConfig
|
|
4
|
+
from .data_classes import StatisticsResponse
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class StatisticsAPI:
|
|
8
|
+
def __init__(self, neat_config: NeatClientConfig, http_client: HTTPClient) -> None:
|
|
9
|
+
self._config = neat_config
|
|
10
|
+
self._http_client = http_client
|
|
5
11
|
|
|
6
|
-
class StatisticsAPI(NeatAPI):
|
|
7
12
|
def project(self) -> StatisticsResponse:
|
|
8
13
|
"""Retrieve project-wide usage data and limits.
|
|
9
14
|
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Sequence
|
|
4
|
+
|
|
5
|
+
from cognite.neat._data_model.models.dms import ViewReference, ViewRequest, ViewResponse
|
|
6
|
+
from cognite.neat._utils.http_client import HTTPClient, SuccessResponse
|
|
7
|
+
|
|
8
|
+
from .api import Endpoint, NeatAPI
|
|
9
|
+
from .config import NeatClientConfig
|
|
10
|
+
from .data_classes import PagedResponse
|
|
11
|
+
from .filters import ViewFilter
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ViewsAPI(NeatAPI):
|
|
15
|
+
def __init__(self, neat_config: NeatClientConfig, http_client: HTTPClient) -> None:
|
|
16
|
+
super().__init__(
|
|
17
|
+
neat_config,
|
|
18
|
+
http_client,
|
|
19
|
+
endpoint_map={
|
|
20
|
+
"apply": Endpoint("POST", "/models/views", item_limit=100),
|
|
21
|
+
"retrieve": Endpoint("POST", "/models/views/byids", item_limit=100),
|
|
22
|
+
"delete": Endpoint("POST", "/models/views/delete", item_limit=100),
|
|
23
|
+
"list": Endpoint("GET", "/models/views", item_limit=1000),
|
|
24
|
+
},
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
def _validate_page_response(self, response: SuccessResponse) -> PagedResponse[ViewResponse]:
|
|
28
|
+
return PagedResponse[ViewResponse].model_validate_json(response.body)
|
|
29
|
+
|
|
30
|
+
def _validate_id_response(self, response: SuccessResponse) -> list[ViewReference]:
|
|
31
|
+
return PagedResponse[ViewReference].model_validate_json(response.body).items
|
|
32
|
+
|
|
33
|
+
def apply(self, items: Sequence[ViewRequest]) -> list[ViewResponse]:
|
|
34
|
+
"""Create or update views in CDF Project.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
items: List of ViewRequest objects to create or update.
|
|
38
|
+
Returns:
|
|
39
|
+
List of ViewResponse objects.
|
|
40
|
+
"""
|
|
41
|
+
return self._request_item_response(items, "apply")
|
|
42
|
+
|
|
43
|
+
def retrieve(self, items: list[ViewReference], include_inherited_properties: bool = True) -> list[ViewResponse]:
|
|
44
|
+
"""Retrieve views by their identifiers.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
items: List of (space, external_id, version) tuples identifying the views to retrieve.
|
|
48
|
+
include_inherited_properties: If True, include properties inherited from parent views.
|
|
49
|
+
|
|
50
|
+
Returns:
|
|
51
|
+
List of ViewResponse objects.
|
|
52
|
+
"""
|
|
53
|
+
return self._request_item_response(
|
|
54
|
+
items, "retrieve", extra_body={"includeInheritedProperties": include_inherited_properties}
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
def delete(self, items: list[ViewReference]) -> list[ViewReference]:
|
|
58
|
+
"""Delete views by their identifiers.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
items: List of (space, external_id, version) tuples identifying the views to delete.
|
|
62
|
+
|
|
63
|
+
Returns:
|
|
64
|
+
List of ViewReference objects representing the deleted views.
|
|
65
|
+
"""
|
|
66
|
+
return self._request_id_response(items, "delete")
|
|
67
|
+
|
|
68
|
+
def list(
|
|
69
|
+
self,
|
|
70
|
+
space: str | None = None,
|
|
71
|
+
all_versions: bool = False,
|
|
72
|
+
include_inherited_properties: bool = True,
|
|
73
|
+
include_global: bool = False,
|
|
74
|
+
limit: int | None = 10,
|
|
75
|
+
) -> list[ViewResponse]:
|
|
76
|
+
"""List views in CDF Project.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
space: If specified, only views in this space are returned.
|
|
80
|
+
all_versions: If True, return all versions. If False, only return the latest version.
|
|
81
|
+
include_inherited_properties: If True, include properties inherited from parent views.
|
|
82
|
+
include_global: If True, include global views.
|
|
83
|
+
limit: Maximum number of views to return. If None, return all views.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
List of ViewResponse objects.
|
|
87
|
+
"""
|
|
88
|
+
filter = ViewFilter(
|
|
89
|
+
space=space,
|
|
90
|
+
all_versions=all_versions,
|
|
91
|
+
include_inherited_properties=include_inherited_properties,
|
|
92
|
+
include_global=include_global,
|
|
93
|
+
)
|
|
94
|
+
return self._list(limit=limit, params=filter.dump())
|
|
@@ -22,6 +22,9 @@ class WriteableResource(Resource, Generic[T_Resource], ABC):
|
|
|
22
22
|
raise NotImplementedError()
|
|
23
23
|
|
|
24
24
|
|
|
25
|
+
T_Response = TypeVar("T_Response", bound=WriteableResource)
|
|
26
|
+
|
|
27
|
+
|
|
25
28
|
class APIResource(Generic[T_Reference], ABC):
|
|
26
29
|
"""Base class for all API data modeling resources."""
|
|
27
30
|
|
|
@@ -167,7 +167,9 @@ class HTTPClient:
|
|
|
167
167
|
if isinstance(item, BodyRequest):
|
|
168
168
|
data = item.data()
|
|
169
169
|
if not global_config.disable_gzip:
|
|
170
|
-
|
|
170
|
+
if isinstance(data, str):
|
|
171
|
+
data = data.encode("utf-8")
|
|
172
|
+
data = gzip.compress(data)
|
|
171
173
|
return self.session.request(
|
|
172
174
|
method=item.method,
|
|
173
175
|
url=item.endpoint_url,
|
{cognite_neat-1.0.25 → cognite_neat-1.0.26}/cognite/neat/_utils/http_client/_data_classes.py
RENAMED
|
@@ -118,14 +118,14 @@ class BodyRequest(ParametersRequest, ABC):
|
|
|
118
118
|
"""Base class for HTTP request messages with a body"""
|
|
119
119
|
|
|
120
120
|
@abstractmethod
|
|
121
|
-
def data(self) -> str:
|
|
121
|
+
def data(self) -> str | bytes:
|
|
122
122
|
raise NotImplementedError()
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
class SimpleBodyRequest(BodyRequest):
|
|
126
|
-
body: str
|
|
126
|
+
body: str | bytes
|
|
127
127
|
|
|
128
|
-
def data(self) -> str:
|
|
128
|
+
def data(self) -> str | bytes:
|
|
129
129
|
return self.body
|
|
130
130
|
|
|
131
131
|
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
from cognite.neat._client.config import NeatClientConfig
|
|
2
|
-
from cognite.neat._utils.http_client import HTTPClient
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class NeatAPI:
|
|
6
|
-
def __init__(self, neat_config: NeatClientConfig, http_client: HTTPClient) -> None:
|
|
7
|
-
self._config = neat_config
|
|
8
|
-
self._http_client = http_client
|