datalens-sdk 0.1.0__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.
- datalens_sdk-0.1.0/.gitignore +63 -0
- datalens_sdk-0.1.0/CHANGELOG.md +14 -0
- datalens_sdk-0.1.0/LICENSE +215 -0
- datalens_sdk-0.1.0/PKG-INFO +256 -0
- datalens_sdk-0.1.0/README.md +226 -0
- datalens_sdk-0.1.0/noxfile.py +248 -0
- datalens_sdk-0.1.0/pyproject.toml +104 -0
- datalens_sdk-0.1.0/scripts/check_artifacts.py +185 -0
- datalens_sdk-0.1.0/scripts/check_generated.py +33 -0
- datalens_sdk-0.1.0/scripts/check_release.py +28 -0
- datalens_sdk-0.1.0/scripts/generate_sdk.py +28 -0
- datalens_sdk-0.1.0/scripts/update_specs.py +141 -0
- datalens_sdk-0.1.0/scripts/validate_publish_ref.py +105 -0
- datalens_sdk-0.1.0/spec/enterprise.json +35794 -0
- datalens_sdk-0.1.0/spec/yacloud.json +35828 -0
- datalens_sdk-0.1.0/src/datalens_sdk/__init__.py +347 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_generated/__init__.py +0 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_generated/builders/__init__.py +0 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_generated/builders/charts.py +2020 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_generated/builders/dataset_sources.py +625 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_generated/builders/enterprise.py +785 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_generated/builders/yacloud.py +1280 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_generated/dto.py +1521 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_generated/installations.json +4543 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_runtime/__init__.py +1 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_runtime/builder_base.py +120 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_runtime/chart_builder_base.py +946 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_runtime/chart_constants.py +94 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_runtime/chart_mutations.py +218 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_runtime/chart_wire.py +207 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_runtime/method_specs.py +364 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_runtime/validators.py +5 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_runtime/viz_specs.py +1967 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_runtime/wizard_field_references.py +463 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_runtime/wizard_visualization_transitions.py +59 -0
- datalens_sdk-0.1.0/src/datalens_sdk/_wizard_encodings.py +31 -0
- datalens_sdk-0.1.0/src/datalens_sdk/api/__init__.py +1 -0
- datalens_sdk-0.1.0/src/datalens_sdk/api/chart.py +482 -0
- datalens_sdk-0.1.0/src/datalens_sdk/api/collection.py +116 -0
- datalens_sdk-0.1.0/src/datalens_sdk/api/connection.py +181 -0
- datalens_sdk-0.1.0/src/datalens_sdk/api/dashboard.py +250 -0
- datalens_sdk-0.1.0/src/datalens_sdk/api/dataset.py +265 -0
- datalens_sdk-0.1.0/src/datalens_sdk/api/entries.py +122 -0
- datalens_sdk-0.1.0/src/datalens_sdk/api/folder.py +171 -0
- datalens_sdk-0.1.0/src/datalens_sdk/api/license.py +105 -0
- datalens_sdk-0.1.0/src/datalens_sdk/api/navigation.py +196 -0
- datalens_sdk-0.1.0/src/datalens_sdk/api/workbook.py +116 -0
- datalens_sdk-0.1.0/src/datalens_sdk/auth.py +275 -0
- datalens_sdk-0.1.0/src/datalens_sdk/client.py +780 -0
- datalens_sdk-0.1.0/src/datalens_sdk/codegen.py +2445 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/__init__.py +1 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/_dataset_policy.py +15 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/_navigation.py +27 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/_utils.py +17 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/collection.py +147 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/connection.py +208 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/dashboard.py +533 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/dashboard_apply.py +909 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/dashboard_apply_layout.py +345 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/dashboard_control.py +315 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/dashboard_items.py +209 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/dataset.py +482 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/editor_chart.py +392 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/entry.py +60 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/folder.py +122 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/license.py +197 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/navigation.py +505 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/ql_chart.py +343 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/raw/__init__.py +35 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/raw/chart.py +104 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/raw/connection.py +44 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/raw/dashboard.py +54 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/raw/dataset.py +46 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard/__init__.py +21 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard/_assemble.py +129 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard/_autofix.py +128 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard/_colors.py +442 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard/_common.py +61 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard/_decorations.py +409 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard/_layers.py +194 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard/_normalizer.py +99 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard/_placeholders.py +123 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard/_update.py +637 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard/converter.py +223 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/wizard_chart.py +21 -0
- datalens_sdk-0.1.0/src/datalens_sdk/converter/workbook.py +155 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/__init__.py +224 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/chart.py +130 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/chart_types.py +95 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/collection.py +184 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/connection.py +171 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard.py +486 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_create.py +443 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_layout.py +296 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_tab.py +649 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_tab_charts.py +135 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_tab_layout.py +243 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_tab_selectors.py +276 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_types.py +244 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_update.py +645 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_update_adders.py +647 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_update_layout.py +190 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_update_support.py +158 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_update_wiring.py +319 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dashboard_validate.py +275 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dataset.py +609 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dataset_types.py +503 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/dataset_update.py +641 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/editor_chart.py +131 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/entry_location.py +150 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/entry_types.py +12 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/fields.py +147 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/folder.py +165 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/license.py +82 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/navigation.py +271 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/ports.py +375 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/ql_chart.py +375 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/raw_dashboard.py +84 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/raw_resource.py +404 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/specs/__init__.py +26 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/specs/collection.py +25 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/specs/connection.py +34 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/specs/dashboard.py +578 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/specs/dataset.py +54 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/specs/editor_chart.py +24 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/specs/folder.py +23 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/specs/ql_chart.py +41 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/specs/raw_resource.py +22 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/specs/wizard_chart.py +54 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/specs/workbook.py +25 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/wizard_chart.py +175 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/wizard_chart_update.py +619 -0
- datalens_sdk-0.1.0/src/datalens_sdk/domain/workbook.py +187 -0
- datalens_sdk-0.1.0/src/datalens_sdk/error_transformers.py +101 -0
- datalens_sdk-0.1.0/src/datalens_sdk/errors.py +125 -0
- datalens_sdk-0.1.0/src/datalens_sdk/http.py +416 -0
- datalens_sdk-0.1.0/src/datalens_sdk/py.typed +0 -0
- datalens_sdk-0.1.0/src/datalens_sdk/raw.py +530 -0
- datalens_sdk-0.1.0/src/datalens_sdk/recipes/__init__.py +11 -0
- datalens_sdk-0.1.0/src/datalens_sdk/recipes/dashboard_export.py +210 -0
- datalens_sdk-0.1.0/src/datalens_sdk/recipes/dashboards.py +307 -0
- datalens_sdk-0.1.0/src/datalens_sdk/runtime.py +26 -0
- datalens_sdk-0.1.0/src/datalens_sdk/serialization/__init__.py +4 -0
- datalens_sdk-0.1.0/src/datalens_sdk/serialization/artifacts.py +381 -0
- datalens_sdk-0.1.0/src/datalens_sdk/serialization/connection.py +121 -0
- datalens_sdk-0.1.0/src/datalens_sdk/serialization/editor_tabs.py +27 -0
- datalens_sdk-0.1.0/src/datalens_sdk/serialization/json_io.py +163 -0
- datalens_sdk-0.1.0/src/datalens_sdk/serialization/json_types.py +81 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/dashboard_create/full_scenario_payload.json +201 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/dashboard_update/full_scenario_payload.json +596 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/dashboards/README.md +30 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/dashboards/global_items_shared_selectors.json +1088 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/dashboards/group_control_dataset.json +487 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/dashboards/group_control_manual.json +551 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/dashboards/items_features.json +198 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/dashboards/selectors_dataset.json +346 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/dashboards/selectors_manual_two_tabs.json +470 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/dashboards/simple.json +108 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/3s1btw4bm5kom.json +241 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/4t2b4ovay396n.json +242 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/6v4dfzzem2fep.json +219 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/az8z6uyjoz3qt.json +242 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/b09if04n0iucu.json +241 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/d2bkncoeml94w.json +223 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/fez420cyep644.json +239 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/h6eyoxeihu8c0.json +150 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/h6eyw78tblag0.json +175 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/h6f6f1v2h1h40.json +275 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/j8g0jgv2jec42.json +154 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/peneqc6d42t88.json +230 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/ql/vks9wrtzto8ke.json +297 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/35prkj7b9xnun.json +1690 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/5ktk0gab36rip.json +2110 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/6lul1r2vkr5kq.json +2042 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/7mv82x84lga6r.json +1878 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/guz2i7a315cg0.json +1964 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/iw14j1bzsvf02.json +1960 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/kz8zd49v19704.json +1983 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/lz47d8gnsa4q5.json +2117 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/n1zb75lpkoq27.json +2015 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/p4d4ls7744xi9.json +1913 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/p4dqkd01l3ty9.json +1881 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/snh82x2nbnx8k.json +1065 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/snh83szp2up8k.json +497 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/vajai7xrxaa6f.json +2015 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/vajaiz1nh2daf.json +2033 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/ydmdqvu9s34si.json +2017 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/reference_charts/wizard/zenewka5dvwij.json +2318 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/area.json +79 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/area100p.json +80 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/bar.json +75 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/bar100p.json +74 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/column.json +78 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/column100p.json +84 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/combined-chart.json +243 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/donut.json +61 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/flatTable.json +31 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/funnel.json +48 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/geolayer.json +494 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/line.json +108 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/metric.json +44 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/pie.json +59 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/pivotTable.json +46 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/scatter.json +115 -0
- datalens_sdk-0.1.0/tests/contract/fixtures/viz_specs/treemap.json +56 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_builder_helpers.py +1754 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_capacity_validation.py +192 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_constants.py +79 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_create_payload_snapshot.py +470 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_dto_invariants.py +110 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_factory_names.py +111 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_field_reference_mutations.py +393 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_hierarchy_update.py +295 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_labels_update.py +187 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_layers_and_update.py +748 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_local_fields_update.py +340 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_payload_golden.py +136 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_pipeline_unit.py +211 -0
- datalens_sdk-0.1.0/tests/contract/test_chart_sdk_layer.py +497 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_builder.py +299 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_compact_layout.py +148 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_create_converter.py +740 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_create_payload_snapshot.py +90 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_dto.py +164 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_fixtures_roundtrip.py +152 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_fixtures_smoke.py +67 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_json_export.py +587 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_layout_dsl.py +368 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_layout_geometry.py +181 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_layout_scenarios.py +114 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_read_model.py +445 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_sdk_layer.py +519 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_selector_types.py +160 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_selector_wire.py +262 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_tab.py +838 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_update_apply.py +475 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_update_builder.py +186 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_update_layout_auto.py +160 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_update_layout_ops.py +448 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_update_ops.py +631 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_update_payload_snapshot.py +82 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_update_sdk_layer.py +261 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_update_structural.py +1067 -0
- datalens_sdk-0.1.0/tests/contract/test_dashboard_validate.py +424 -0
- datalens_sdk-0.1.0/tests/contract/test_dataset_field_hashability.py +114 -0
- datalens_sdk-0.1.0/tests/contract/test_editor_chart.py +479 -0
- datalens_sdk-0.1.0/tests/contract/test_method_specs.py +514 -0
- datalens_sdk-0.1.0/tests/contract/test_ql_chart.py +1115 -0
- datalens_sdk-0.1.0/tests/contract/test_recipes_dashboards.py +347 -0
- datalens_sdk-0.1.0/tests/contract/test_reference_chart_shapes.py +362 -0
- datalens_sdk-0.1.0/tests/contract/test_visualization_id_canonical.py +203 -0
- datalens_sdk-0.1.0/tests/contract/test_viz_spec_matches_golden.py +138 -0
- datalens_sdk-0.1.0/tests/contract/test_wizard_update_fail_closed.py +188 -0
- datalens_sdk-0.1.0/tests/test_action_types.py +349 -0
- datalens_sdk-0.1.0/tests/test_auth_and_clients.py +616 -0
- datalens_sdk-0.1.0/tests/test_chart_raw_serialization.py +1301 -0
- datalens_sdk-0.1.0/tests/test_ci_invariants.py +512 -0
- datalens_sdk-0.1.0/tests/test_connection_raw_serialization.py +703 -0
- datalens_sdk-0.1.0/tests/test_dashboard_raw_serialization.py +696 -0
- datalens_sdk-0.1.0/tests/test_dataset_parity.py +1134 -0
- datalens_sdk-0.1.0/tests/test_dataset_raw_serialization.py +686 -0
- datalens_sdk-0.1.0/tests/test_entry_mutations.py +473 -0
- datalens_sdk-0.1.0/tests/test_error_transformers.py +64 -0
- datalens_sdk-0.1.0/tests/test_http.py +570 -0
- datalens_sdk-0.1.0/tests/test_license.py +258 -0
- datalens_sdk-0.1.0/tests/test_navigation.py +362 -0
- datalens_sdk-0.1.0/tests/test_object_crud.py +400 -0
- datalens_sdk-0.1.0/tests/test_publish_workflow.py +127 -0
- datalens_sdk-0.1.0/tests/test_sdk_layer.py +1213 -0
- datalens_sdk-0.1.0/tests/test_serialization_json.py +276 -0
- datalens_sdk-0.1.0/tests/test_smoke.py +7 -0
- datalens_sdk-0.1.0/tests/test_source_builder.py +302 -0
- datalens_sdk-0.1.0/tests/test_typing_completion.py +789 -0
- datalens_sdk-0.1.0/tests/test_validate_source.py +229 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
|
|
7
|
+
# Distribution / packaging
|
|
8
|
+
build/
|
|
9
|
+
dist/
|
|
10
|
+
sdist/
|
|
11
|
+
wheels/
|
|
12
|
+
*.egg-info/
|
|
13
|
+
*.egg
|
|
14
|
+
*.egg-link
|
|
15
|
+
pip-wheel-metadata/
|
|
16
|
+
MANIFEST
|
|
17
|
+
|
|
18
|
+
# Virtual environments
|
|
19
|
+
.venv/
|
|
20
|
+
venv/
|
|
21
|
+
env/
|
|
22
|
+
__pypackages__/
|
|
23
|
+
|
|
24
|
+
# Tooling caches
|
|
25
|
+
.mypy_cache/
|
|
26
|
+
.dmypy.json
|
|
27
|
+
dmypy.json
|
|
28
|
+
.ruff_cache/
|
|
29
|
+
.pytest_cache/
|
|
30
|
+
.nox/
|
|
31
|
+
.tox/
|
|
32
|
+
.hypothesis/
|
|
33
|
+
|
|
34
|
+
# Coverage
|
|
35
|
+
.coverage
|
|
36
|
+
.coverage.*
|
|
37
|
+
htmlcov/
|
|
38
|
+
coverage.xml
|
|
39
|
+
*.cover
|
|
40
|
+
|
|
41
|
+
# Documentation builds
|
|
42
|
+
docs/_build/
|
|
43
|
+
site/
|
|
44
|
+
|
|
45
|
+
# Secrets / local environment
|
|
46
|
+
.env
|
|
47
|
+
.env.*
|
|
48
|
+
!.env.example
|
|
49
|
+
.envrc
|
|
50
|
+
|
|
51
|
+
# IDE / editors
|
|
52
|
+
.idea/
|
|
53
|
+
.vscode/
|
|
54
|
+
*.swp
|
|
55
|
+
*.swo
|
|
56
|
+
*~
|
|
57
|
+
.sublime-project
|
|
58
|
+
.sublime-workspace
|
|
59
|
+
|
|
60
|
+
# OS
|
|
61
|
+
.DS_Store
|
|
62
|
+
Thumbs.db
|
|
63
|
+
desktop.ini
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 - 2026-07-29
|
|
4
|
+
|
|
5
|
+
Initial alpha release of the public DataLens Python SDK:
|
|
6
|
+
|
|
7
|
+
- Typed clients for Yandex Cloud DataLens and DataLens Enterprise.
|
|
8
|
+
- Typed APIs for connections, datasets, charts, dashboards, collections,
|
|
9
|
+
workbooks, folders, navigation, and licenses where supported.
|
|
10
|
+
- Generated builders and DTOs backed by the public API specifications.
|
|
11
|
+
- Authentication, transport, serialization, and dashboard export helpers.
|
|
12
|
+
- Action-first deferred raw JSON mutation builders under `client.raw.create`
|
|
13
|
+
and `client.raw.replace`, kept separate from typed workflows.
|
|
14
|
+
- Runnable resource-creating examples that leave their output in place for inspection.
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
Copyright 2026 YANDEX LLC
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
14
|
+
|
|
15
|
+
Apache License
|
|
16
|
+
Version 2.0, January 2004
|
|
17
|
+
http://www.apache.org/licenses/
|
|
18
|
+
|
|
19
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
20
|
+
|
|
21
|
+
1. Definitions.
|
|
22
|
+
|
|
23
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
24
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
25
|
+
|
|
26
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
27
|
+
the copyright owner that is granting the License.
|
|
28
|
+
|
|
29
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
30
|
+
other entities that control, are controlled by, or are under common
|
|
31
|
+
control with that entity. For the purposes of this definition,
|
|
32
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
33
|
+
direction or management of such entity, whether by contract or
|
|
34
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
35
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
36
|
+
|
|
37
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
38
|
+
exercising permissions granted by this License.
|
|
39
|
+
|
|
40
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
41
|
+
including but not limited to software source code, documentation
|
|
42
|
+
source, and configuration files.
|
|
43
|
+
|
|
44
|
+
"Object" form shall mean any form resulting from mechanical
|
|
45
|
+
transformation or translation of a Source form, including but
|
|
46
|
+
not limited to compiled object code, generated documentation,
|
|
47
|
+
and conversions to other media types.
|
|
48
|
+
|
|
49
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
50
|
+
Object form, made available under the License, as indicated by a
|
|
51
|
+
copyright notice that is included in or attached to the work
|
|
52
|
+
(an example is provided in the Appendix below).
|
|
53
|
+
|
|
54
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
55
|
+
form, that is based on (or derived from) the Work and for which the
|
|
56
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
57
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
58
|
+
of this License, Derivative Works shall not include works that remain
|
|
59
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
60
|
+
the Work and Derivative Works thereof.
|
|
61
|
+
|
|
62
|
+
"Contribution" shall mean any work of authorship, including
|
|
63
|
+
the original version of the Work and any modifications or additions
|
|
64
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
65
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
66
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
67
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
68
|
+
means any form of electronic, verbal, or written communication sent
|
|
69
|
+
to the Licensor or its representatives, including but not limited to
|
|
70
|
+
communication on electronic mailing lists, source code control systems,
|
|
71
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
72
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
73
|
+
excluding communication that is conspicuously marked or otherwise
|
|
74
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
75
|
+
|
|
76
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
77
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
78
|
+
subsequently incorporated within the Work.
|
|
79
|
+
|
|
80
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
81
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
82
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
83
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
84
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
85
|
+
Work and such Derivative Works in Source or Object form.
|
|
86
|
+
|
|
87
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
88
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
89
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
90
|
+
(except as stated in this section) patent license to make, have made,
|
|
91
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
92
|
+
where such license applies only to those patent claims licensable
|
|
93
|
+
by such Contributor that are necessarily infringed by their
|
|
94
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
95
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
96
|
+
institute patent litigation against any entity (including a
|
|
97
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
98
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
99
|
+
or contributory patent infringement, then any patent licenses
|
|
100
|
+
granted to You under this License for that Work shall terminate
|
|
101
|
+
as of the date such litigation is filed.
|
|
102
|
+
|
|
103
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
104
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
105
|
+
modifications, and in Source or Object form, provided that You
|
|
106
|
+
meet the following conditions:
|
|
107
|
+
|
|
108
|
+
(a) You must give any other recipients of the Work or
|
|
109
|
+
Derivative Works a copy of this License; and
|
|
110
|
+
|
|
111
|
+
(b) You must cause any modified files to carry prominent notices
|
|
112
|
+
stating that You changed the files; and
|
|
113
|
+
|
|
114
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
115
|
+
that You distribute, all copyright, patent, trademark, and
|
|
116
|
+
attribution notices from the Source form of the Work,
|
|
117
|
+
excluding those notices that do not pertain to any part of
|
|
118
|
+
the Derivative Works; and
|
|
119
|
+
|
|
120
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
121
|
+
distribution, then any Derivative Works that You distribute must
|
|
122
|
+
include a readable copy of the attribution notices contained
|
|
123
|
+
within such NOTICE file, excluding those notices that do not
|
|
124
|
+
pertain to any part of the Derivative Works, in at least one
|
|
125
|
+
of the following places: within a NOTICE text file distributed
|
|
126
|
+
as part of the Derivative Works; within the Source form or
|
|
127
|
+
documentation, if provided along with the Derivative Works; or,
|
|
128
|
+
within a display generated by the Derivative Works, if and
|
|
129
|
+
wherever such third-party notices normally appear. The contents
|
|
130
|
+
of the NOTICE file are for informational purposes only and
|
|
131
|
+
do not modify the License. You may add Your own attribution
|
|
132
|
+
notices within Derivative Works that You distribute, alongside
|
|
133
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
134
|
+
that such additional attribution notices cannot be construed
|
|
135
|
+
as modifying the License.
|
|
136
|
+
|
|
137
|
+
You may add Your own copyright statement to Your modifications and
|
|
138
|
+
may provide additional or different license terms and conditions
|
|
139
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
140
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
141
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
142
|
+
the conditions stated in this License.
|
|
143
|
+
|
|
144
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
145
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
146
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
147
|
+
this License, without any additional terms or conditions.
|
|
148
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
149
|
+
the terms of any separate license agreement you may have executed
|
|
150
|
+
with Licensor regarding such Contributions.
|
|
151
|
+
|
|
152
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
153
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
154
|
+
except as required for reasonable and customary use in describing the
|
|
155
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
156
|
+
|
|
157
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
158
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
159
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
160
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
161
|
+
implied, including, without limitation, any warranties or conditions
|
|
162
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
163
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
164
|
+
appropriateness of using or redistributing the Work and assume any
|
|
165
|
+
risks associated with Your exercise of permissions under this License.
|
|
166
|
+
|
|
167
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
168
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
169
|
+
unless required by applicable law (such as deliberate and grossly
|
|
170
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
171
|
+
liable to You for damages, including any direct, indirect, special,
|
|
172
|
+
incidental, or consequential damages of any character arising as a
|
|
173
|
+
result of this License or out of the use or inability to use the
|
|
174
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
175
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
176
|
+
other commercial damages or losses), even if such Contributor
|
|
177
|
+
has been advised of the possibility of such damages.
|
|
178
|
+
|
|
179
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
180
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
181
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
182
|
+
or other liability obligations and/or rights consistent with this
|
|
183
|
+
License. However, in accepting such obligations, You may act only
|
|
184
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
185
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
186
|
+
defend, and hold each Contributor harmless for any liability
|
|
187
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
188
|
+
of your accepting any such warranty or additional liability.
|
|
189
|
+
|
|
190
|
+
END OF TERMS AND CONDITIONS
|
|
191
|
+
|
|
192
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
193
|
+
|
|
194
|
+
To apply the Apache License to your work, attach the following
|
|
195
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
196
|
+
replaced with your own identifying information. (Don't include
|
|
197
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
198
|
+
comment syntax for the file format. We also recommend that a
|
|
199
|
+
file or class name and description of purpose be included on the
|
|
200
|
+
same "printed page" as the copyright notice for easier
|
|
201
|
+
identification within third-party archives.
|
|
202
|
+
|
|
203
|
+
Copyright [yyyy] [name of copyright owner]
|
|
204
|
+
|
|
205
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
206
|
+
you may not use this file except in compliance with the License.
|
|
207
|
+
You may obtain a copy of the License at
|
|
208
|
+
|
|
209
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
210
|
+
|
|
211
|
+
Unless required by applicable law or agreed to in writing, software
|
|
212
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
213
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
214
|
+
See the License for the specific language governing permissions and
|
|
215
|
+
limitations under the License.
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: datalens-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for the DataLens API
|
|
5
|
+
Project-URL: Homepage, https://datalens.ru/
|
|
6
|
+
Project-URL: Documentation, https://github.com/datalens-tech/datalens-sdk#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/datalens-tech/datalens-sdk
|
|
8
|
+
Project-URL: Issues, https://github.com/datalens-tech/datalens-sdk/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/datalens-tech/datalens-sdk/blob/main/CHANGELOG.md
|
|
10
|
+
Author-email: DataLens Team <datalens-opensource@yandex-team.ru>
|
|
11
|
+
License-Expression: Apache-2.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: analytics,business-intelligence,datalens,sdk
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Requires-Dist: httpx>=0.27
|
|
26
|
+
Requires-Dist: pydantic<3,>=2
|
|
27
|
+
Requires-Dist: pyjwt[crypto]<3,>=2.10
|
|
28
|
+
Requires-Dist: typing-extensions>=4.12
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# DataLens Python SDK
|
|
32
|
+
|
|
33
|
+
`datalens-sdk` is the typed Python SDK for the [DataLens](https://datalens.ru/promo) API. It provides clients and
|
|
34
|
+
domain models for working with connections, datasets, charts, dashboards, collections, workbooks, folders, and
|
|
35
|
+
navigation in Yandex Cloud DataLens and DataLens Enterprise.
|
|
36
|
+
|
|
37
|
+
## Requirements
|
|
38
|
+
|
|
39
|
+
- Python 3.10 or newer
|
|
40
|
+
- A Yandex Cloud organization with DataLens enabled, or a DataLens Enterprise installation
|
|
41
|
+
|
|
42
|
+
## Project status
|
|
43
|
+
|
|
44
|
+
The `0.1` series is an alpha release. Until `1.0`, breaking API changes may be
|
|
45
|
+
made in minor releases.
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
The package is available from PyPI:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install datalens-sdk
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Quick start
|
|
56
|
+
|
|
57
|
+
`DataLensClientYC` uses the active [`yc` CLI](https://yandex.cloud/en/docs/cli/quickstart) profile by default. Configure
|
|
58
|
+
the organization once; the SDK will then obtain and refresh IAM tokens automatically:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
yc config set organization-id <organization-id>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Use clients as context managers so their HTTP connections are closed promptly:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from datalens_sdk import DataLensClientYC
|
|
68
|
+
|
|
69
|
+
with DataLensClientYC() as client:
|
|
70
|
+
dataset = client.get.dataset(by_id="<dataset-id>")
|
|
71
|
+
print(dataset.name)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For DataLens Enterprise, provide the installation's API base URL:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from datalens_sdk import DataLensClientEnterprise
|
|
78
|
+
|
|
79
|
+
with DataLensClientEnterprise(base_url="https://datalens.example.com") as client:
|
|
80
|
+
workbook = client.get.workbook(by_id="<workbook-id>")
|
|
81
|
+
print(workbook.name)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Authentication
|
|
85
|
+
|
|
86
|
+
Yandex Cloud users can choose among the following providers:
|
|
87
|
+
|
|
88
|
+
- `YCIAMAuthProvider` uses a `yc` CLI profile and refreshes IAM tokens automatically. This is the default for `DataLensClientYC`.
|
|
89
|
+
- `YCServiceAccountCredentialsAuthProvider` exchanges service-account credentials for refreshable IAM tokens.
|
|
90
|
+
- `StaticYCIAMAuthProvider` accepts an existing IAM token and organization ID.
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
import os
|
|
94
|
+
|
|
95
|
+
from datalens_sdk import StaticYCIAMAuthProvider, DataLensClientYC
|
|
96
|
+
|
|
97
|
+
auth = StaticYCIAMAuthProvider(
|
|
98
|
+
org_id="<organization-id>",
|
|
99
|
+
token=os.getenv("_MY_IAM_TOKEN"),
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
with DataLensClientYC(auth=auth) as client:
|
|
103
|
+
dashboard = client.get.dashboard(by_id="<dashboard-id>")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Pass `auth=None` explicitly for access without authentication.
|
|
107
|
+
|
|
108
|
+
## Core concepts
|
|
109
|
+
|
|
110
|
+
The client groups operations by intent:
|
|
111
|
+
|
|
112
|
+
- `client.get` loads resources such as datasets, charts, and dashboards.
|
|
113
|
+
- `client.create` exposes typed builders. Configure a builder fluently and call `.build()` to send it.
|
|
114
|
+
- Returned resources provide operations such as `.rename()`, `.update`, and `.delete()`.
|
|
115
|
+
- `EntryLocation` identifies a destination path, workbook, or collection.
|
|
116
|
+
|
|
117
|
+
For example, create a workbook and use the returned object directly as a destination:
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
from datalens_sdk import DataLensClientYC
|
|
121
|
+
|
|
122
|
+
with DataLensClientYC() as client:
|
|
123
|
+
workbook = client.create.workbook(name="SDK workbook").build()
|
|
124
|
+
dataset = client.create.dataset(name="SDK dataset", location=workbook).build()
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Examples
|
|
128
|
+
|
|
129
|
+
Runnable Yandex Cloud examples are available in [`examples/`](examples/):
|
|
130
|
+
|
|
131
|
+
| Example | What it demonstrates |
|
|
132
|
+
| --- | --- |
|
|
133
|
+
| [`get_dataset.py`](examples/get_dataset.py) | Load and inspect a dataset |
|
|
134
|
+
| [`collection_workbook_lifecycle.py`](examples/collection_workbook_lifecycle.py) | Collection and workbook create, update, and read |
|
|
135
|
+
| [`clickhouse_dashboard.py`](examples/clickhouse_dashboard.py) | Create a ClickHouse connection, dataset, chart, and dashboard |
|
|
136
|
+
|
|
137
|
+
Inspect an example's configuration before running it:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
python examples/clickhouse_dashboard.py --help
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Resource-creating examples leave their output in place for inspection.
|
|
144
|
+
|
|
145
|
+
## Raw JSON artifacts
|
|
146
|
+
|
|
147
|
+
`to_file(parent)` writes a resource's exact server snapshot below an existing
|
|
148
|
+
parent directory. Artifacts require the resource name and id and use
|
|
149
|
+
`<sanitized name> [<sanitized id>]`; export does not synthesize missing
|
|
150
|
+
identity fields or mutate the resource model.
|
|
151
|
+
|
|
152
|
+
Raw JSON mutations live under `client.raw`; typed create and update builders
|
|
153
|
+
do not accept raw snapshots. Create from a response snapshot with
|
|
154
|
+
`client.raw.create.<resource>(response_snapshot=raw, name=..., location=...).build()`
|
|
155
|
+
or from an exported artifact directory with
|
|
156
|
+
`client.raw.create.<resource>.from_file(path, name=..., location=...).build()`.
|
|
157
|
+
Replace an existing resource with
|
|
158
|
+
`client.raw.replace.<resource>(target=..., response_snapshot=raw).execute(...)` or
|
|
159
|
+
`client.raw.replace.<resource>.from_file(path, target=...).execute(...)`.
|
|
160
|
+
Dashboard replace requires `publish=` on `execute()`; chart replace can select
|
|
161
|
+
`.mode("save")` or `.mode("publish")` before `execute()`.
|
|
162
|
+
Replace overwrites the supported mutable content and is last-write-wins: it
|
|
163
|
+
does not fetch, merge, or check for concurrent changes. Each `build()` or
|
|
164
|
+
`execute()` call performs a new mutation and has no idempotency guarantee.
|
|
165
|
+
|
|
166
|
+
`Dashboard.to_file(parent, with_dependencies=True)` adds Charts and Datasets
|
|
167
|
+
discovered only through the relations API. It never calls `getEntries`;
|
|
168
|
+
relation wire types select the specialized Wizard, Editor, or QL getter, and
|
|
169
|
+
relation `workbookId` values are forwarded without forcing a branch or
|
|
170
|
+
revision. The resulting bundle therefore does not promise cross-resource
|
|
171
|
+
revision consistency.
|
|
172
|
+
|
|
173
|
+
The Dashboard, Charts, and Datasets are validated before the whole bundle is
|
|
174
|
+
published with one atomic no-replace rename. Connections are not included.
|
|
175
|
+
The `charts/` and `datasets/` directories are export-only:
|
|
176
|
+
`client.raw.create.dashboard.from_file(...)` and
|
|
177
|
+
`client.raw.replace.dashboard.from_file(...)` read only `dashboard.json` and
|
|
178
|
+
do not import or remap dependencies.
|
|
179
|
+
|
|
180
|
+
## Development
|
|
181
|
+
|
|
182
|
+
The project uses [Nox](https://nox.thea.codes/) for every development check:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
pip install nox
|
|
186
|
+
|
|
187
|
+
nox -s check # complete local PR gate, including every supported Python
|
|
188
|
+
nox # same checks as `nox -s check`
|
|
189
|
+
nox -s lint # Ruff lint
|
|
190
|
+
nox -s format # format Python and JSON and apply safe lint fixes
|
|
191
|
+
nox -s format-check # check formatting without modifying files
|
|
192
|
+
nox -s typecheck # strict mypy
|
|
193
|
+
nox -s dependency-lower-bounds # verify the dependency versions declared as minimums
|
|
194
|
+
nox -s tests-3.13 # test with a specific supported interpreter
|
|
195
|
+
nox -s update-specs # update the default public API specification
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Pass installation names after `--` to update selected specifications:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
nox -s update-specs -- yacloud
|
|
202
|
+
nox -s update-specs -- enterprise
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Specification updates do not regenerate SDK sources. Review the specification diff, then run `nox -s generate`
|
|
206
|
+
and the complete `nox` gate.
|
|
207
|
+
|
|
208
|
+
## Maintainer release process
|
|
209
|
+
|
|
210
|
+
Every stable minor line is published from a protected `release/X.Y` branch.
|
|
211
|
+
Production tags have the exact `vX.Y.Z` form and must point to a commit on the
|
|
212
|
+
matching release branch. The publish workflow rejects a tag from any other
|
|
213
|
+
branch, runs the complete quality and Python-version matrix, builds and
|
|
214
|
+
validates one wheel and sdist, publishes those exact files, and attaches them
|
|
215
|
+
to the GitHub Release.
|
|
216
|
+
|
|
217
|
+
To start a new minor line:
|
|
218
|
+
|
|
219
|
+
1. Open a release PR against `main` that sets the final version and adds its
|
|
220
|
+
dated changelog section.
|
|
221
|
+
2. Merge the PR after every required check passes.
|
|
222
|
+
3. Create `release/X.Y` from that merge commit and wait for the release-branch
|
|
223
|
+
CI run to pass.
|
|
224
|
+
4. Create and push an annotated `vX.Y.Z` tag at that commit.
|
|
225
|
+
5. Approve the `pypi` deployment, then verify the published metadata,
|
|
226
|
+
provenance, hashes, installation, and a read-only call.
|
|
227
|
+
|
|
228
|
+
For a patch on an older line, fix the defect on `main` first when it still
|
|
229
|
+
applies there. Open a PR against `release/X.Y` using `git cherry-pick -x`,
|
|
230
|
+
adapt the change if that line has diverged, update the patch version and
|
|
231
|
+
changelog, and tag the merged release-branch commit. A fix that no longer
|
|
232
|
+
applies to `main` may target only the release branch with the reason recorded
|
|
233
|
+
in the PR.
|
|
234
|
+
|
|
235
|
+
TestPyPI is separate: manually run the `Publish` workflow from `main`. It
|
|
236
|
+
executes the same complete verification and build path but requires approval
|
|
237
|
+
of the `testpypi` environment and does not create a tag or GitHub Release.
|
|
238
|
+
|
|
239
|
+
Tags and published files are immutable. If a release is unusable, yank it
|
|
240
|
+
where supported and publish a new patch version. Repository rulesets,
|
|
241
|
+
deployment environments, and trusted publishers are configured outside the
|
|
242
|
+
source tree by repository administrators.
|
|
243
|
+
|
|
244
|
+
## Project policies
|
|
245
|
+
|
|
246
|
+
- Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.
|
|
247
|
+
- Report vulnerabilities privately according to [SECURITY.md](SECURITY.md).
|
|
248
|
+
- Participation is governed by [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
|
|
249
|
+
- User-visible changes are recorded in [CHANGELOG.md](CHANGELOG.md).
|
|
250
|
+
|
|
251
|
+
For general project questions, use
|
|
252
|
+
[GitHub Issues](https://github.com/datalens-tech/datalens-sdk/issues).
|
|
253
|
+
|
|
254
|
+
## License
|
|
255
|
+
|
|
256
|
+
Licensed under the Apache License 2.0. See [LICENSE](LICENSE).
|