SSB Dash Framework¶
Documentation¶
The documentation for this project can be found here or in the docs folder.
New to the package? Start with the guide Getting started: build your first app.
Features¶
Dashboard for editing data, includes modules for among other things:
Controls for the data
Visualizations to find outliers
Seeing micro-level information about observations
Requirements¶
TODO
Installation¶
You can install SSB Sirius Dash via pip from PyPI:
pip install ssb-dash-framework
or using poetry:
poetry add ssb-dash-framework
The above will install the latest stable release.
Installing the pre-release version¶
This version contains new features and improvements that are heading to the stable release eventually, but is still subject to changes.
poetry add ssb-dash-framework --allow-prereleases
Installing the development version¶
This is the currently in-development version. Be aware that this is a very unstable version and is subject to rapid breaking changes.
Primarily intended for testing of in-development features.
First make sure this is in your pyproject.toml:
[[tool.poetry.source]]
name = “testpypi”
url = “https://test.pypi.org/simple”
priority = “supplemental”
It can be added manually or using the command below.
poetry source add --priority=supplemental testpypi https://test.pypi.org/simple
If it is in your pyproject.toml, run this command with –allow-prereleases to ensure you get the latest version.
poetry add --source testpypi ssb-dash-framework --allow-prereleases
Usage¶
Please see the Reference Guide for details.
Contributing¶
Contributions are very welcome. To learn more, see the Contributor Guide.
We are following the gitflow workflow, meaning that the main branch is the release version, while development happens on the develop branch. An explanation of how gitflow works can be found here: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
License¶
Distributed under the terms of the MIT license, SSB Dash Framework is free and open source software.
Issues¶
If you encounter any problems, please file an issue along with a detailed description.
Credits¶
This project was generated from Statistics Norway’s SSB PyPI Template.
- Documentation
- Overview
- Guides
- How-to
- What can you find here?
- Known bugs
- DataEditor
- 1.
enable_table_selectoris never acted on, which kills dataview switching - 2. Saving a field can overwrite every field in the form
- 3. Saving is tied to the NØKU data model
- 4. Values with a single quote break saving
- 5. The editing status shows a false error on every load
- 6.
dynamic-listleaks internals and has unstable column order - 7.
get_fieldreturnsNaNinstead ofNonefor NULL values - 8.
get_info_row_fieldsfilters the ident column on the refnr - 9.
get_historyis a stub - 10. Custom support tables only load if
DataEditorSupportTablesis the first button - 11.
DataEditorTablefilters on hardcoded column names - 12. The form name field must be called
altinnskjema - 13. The
tabscomponent requires atabskey that is never used - 14. A
checklistwith more than one option is never saved - 15. The test data has form statuses the DataEditor rejects
- 16. The DataEditor data handler base class is not importable, and has an unclear name
- 1.
- Connections
- ParquetEditor
- Configuration and setup
- DataEditor
- Explanations
- What is the framework?
- Architecture in the package
- General design
- All code a user is expected to interact with should be a top-level import
- Variable selector is responsible for configuring shared states for the app
- In-development features and modules exists in experimental/
- Experimental features and modules should only be imported using ‘from ssb_dash_framework.experimental import ExpModule’
- Module design
- Modules inherit from the common base class ModuleBase
- Modules must not depend on other modules
- Modules communicate through the variable selector
- Modules in the package should be as simple as possible to configure
- Modules in the package should be accessible to all users with a similar use case, not statistic specific
- Read and write operations should be database/backend agnostic
- Modules must be configurable through yaml files
- Recommended test suite
- General design
- Datamodels
- For maintainers
- Glossary
- Norsk
- Reference
- YAML configuration
- Key concepts
- Contents
- Aarsregnskap
- ControlView
- BofInformation
- Canvas
- FigureDisplay
- MapDisplay
- MultiModule
- EditingTable
- AltinnFormParqueditHandler
- StandardDataHandler
- DataEditor
- ContextABC
- DataViewCustom
- DataEditorTable
- DataEditorContactInfo
- DataEditorHelperButton
- DataEditorHistory
- DataEditorSupportTables
- DataEditorInfoRow
- DataEditorSidebarComment
- DataEditorSidebarEditingStatus
- DataEditorTableSelector
- Naeringsspesifikasjon
- NspekControlView
- NspekDashboard
- ParquetEditor
- ParquetEditorChangelog
- SkjemapdfViewer
- VariableSelectorConfig
- DataEditor
- API reference
- Config
- Control
- Control_framework_base
ControlFrameworkBaseControlFrameworkBase.execute_controls()ControlFrameworkBase.find_control_methods()ControlFrameworkBase.generate_update_query()ControlFrameworkBase.get_current_kontroller()ControlFrameworkBase.get_current_kontrollutslag()ControlFrameworkBase.insert_new_records()ControlFrameworkBase.register_all_controls()ControlFrameworkBase.register_control()ControlFrameworkBase.run_all_controls()ControlFrameworkBase.run_control()ControlFrameworkBase.update_existing_records()
register_control()
- Control_framework_base
- Experimental
- Modules
- Building blocks
- Data editor
- Default getter
- Form_cache
- Form_tools_parquedit_handler
- Getter
StandardDataHandlerStandardDataHandler.get_comment()StandardDataHandler.get_contact_info()StandardDataHandler.get_dynamic_list()StandardDataHandler.get_field()StandardDataHandler.get_form_status()StandardDataHandler.get_history()StandardDataHandler.get_info_row_fields()StandardDataHandler.get_refnrs_by_period_ident()StandardDataHandler.get_timeseries()StandardDataHandler.update_field_value()StandardDataHandler.update_form_active_status()StandardDataHandler.update_form_reception_comment()StandardDataHandler.update_form_status()
- Modules
- Editor
- Meta
- Utils
EDITING_CODE_DROPDOWN()EditorSettingsEditorSettings.starting_tableEditorSettings.form_data_tableEditorSettings.form_listEditorSettings.refnr_colEditorSettings.form_name_colEditorSettings.ident_colEditorSettings.field_value_colEditorSettings.field_name_colEditorSettings.period_colEditorSettings.mapping_tableEditorSettings.mapping_match_columnEditorSettings.mapping_result_columnEditorSettings.table_selector_idEditorSettings.form_selector_idEditorSettings.field_name_colEditorSettings.field_value_colEditorSettings.form_data_tableEditorSettings.form_listEditorSettings.form_name_colEditorSettings.form_selector_idEditorSettings.ident_colEditorSettings.mapping_match_columnEditorSettings.mapping_result_columnEditorSettings.mapping_tableEditorSettings.model_configEditorSettings.period_colEditorSettings.refnr_colEditorSettings.starting_tableEditorSettings.table_selector_id
- Default getter
- Nspek
- Nspek
NaeringsspesifikasjonNaeringsspesifikasjon.create_checkbox()Naeringsspesifikasjon.create_dialog()Naeringsspesifikasjon.create_dropdown_card()Naeringsspesifikasjon.create_info_card()Naeringsspesifikasjon.get_edit_log_row_style()Naeringsspesifikasjon.get_row_style_active_comment()Naeringsspesifikasjon.get_row_style_kontrollutslag()Naeringsspesifikasjon.get_row_style_ui_sums()Naeringsspesifikasjon.get_row_style_with_comments()Naeringsspesifikasjon.layout()Naeringsspesifikasjon.module_callbacks()
add_ui_sums()add_update_counts()apply_blank_filter()apply_petroleum_filter()build_column_defs()build_regnskap_dataframe()build_varelager_column_defs()build_varelager_dataframe()clean_whitespace()feltkommentar_ikon_column()fetch_data_by_orgnr()fetch_varelager_values()get_available_years()get_bof_database_path()get_bofinfo()get_constructed_sequences()get_default_version()get_konstruert()get_latest_field_comments()get_post_number()get_skjoennslignet()get_value()get_versions()get_virksomhetsinfo()handle_regnskap_edit()has_data()is_negative()orgnr_exists_in_bof()post_description_data()save_regnskap_value()trigger_refresh()validate_aar()validate_numeric_input()validate_orgnr()
- Nspek_control_config
- Nspek_control_engine
add_active_status()enrich_with_bof()evaluate_sum_rule()filter_scope_by_virksomhetstype()get_active_versions()get_bofinfo_for_idents()get_regnskaps_data()get_scope_for_sekvensnummer()get_versions()insert_batches()make_kontroller_df()run_all_controls()run_all_controls_for_sekvensnummer()run_all_controls_for_year()run_controls_changed_fields_for_sekvensnummer()run_controls_for_changed_fields()save_full_control_db()save_incremental_control_db()sql_value()
- Nspek_control_view
- Nspek_controls
- Nspek_dashboard
NspekDashboardNspekDashboard.create_checkbox()NspekDashboard.create_development_figure()NspekDashboard.create_development_table()NspekDashboard.create_dialog()NspekDashboard.create_distribution_figure()NspekDashboard.create_distribution_table()NspekDashboard.create_dropdown_card()NspekDashboard.create_info_card()NspekDashboard.create_key_figure()NspekDashboard.create_kpi_card()NspekDashboard.create_kpi_modal()NspekDashboard.create_mini_dialog()NspekDashboard.layout()NspekDashboard.module_callbacks()
construct_sequence()get_bof_database_path()get_nspek_development_data()get_nspek_distribution_data()get_nspek_kpi_modal_data()get_nspek_kpis()orgnr_exists_in_bof()
- Nspek_utils
- Nspek
- Aarsregnskap
AarsregnskapAarsregnskap.module_numberAarsregnskap.module_nameAarsregnskap.labelAarsregnskap.iconAarsregnskap.module_layoutAarsregnskap.iconAarsregnskap.implemented_asAarsregnskap.labelAarsregnskap.layout()Aarsregnskap.module_callbacks()Aarsregnskap.module_idAarsregnskap.module_layoutAarsregnskap.module_nameAarsregnskap.module_number
- Altinn_control_view
- Bofregistry
- Parquet_editor
ParquetEditorParquetEditorChangelogParquetEditorChangelog.iconParquetEditorChangelog.implemented_asParquetEditorChangelog.labelParquetEditorChangelog.layout()ParquetEditorChangelog.module_callbacks()ParquetEditorChangelog.module_idParquetEditorChangelog.module_layoutParquetEditorChangelog.module_nameParquetEditorChangelog.module_number
apply_edits()check_for_bucket_path()export_from_parqueteditor()get_export_log_path()get_log_path()log_as_text()read_jsonl_file_to_string()read_jsonl_log()
- Pi_memorizer
- Skjemapdfviewer
- Setup
- Variableselector
- Set_variables
VariableSelectorConfigVariableSelectorConfig.from_dict()VariableSelectorConfig.from_yaml()VariableSelectorConfig.grouping_variablesVariableSelectorConfig.identVariableSelectorConfig.ignore_alerts_on_varchangeVariableSelectorConfig.model_configVariableSelectorConfig.model_post_init()VariableSelectorConfig.refnrVariableSelectorConfig.secondary_identsVariableSelectorConfig.time_units
apply_config()
- Time_unit
- Variableselector
VariableSelectorVariableSelector.get_all_states()VariableSelector.get_grouping_vars()VariableSelector.get_ident()VariableSelector.get_input()VariableSelector.get_option()VariableSelector.get_output_object()VariableSelector.get_refnr()VariableSelector.get_secondary_ident()VariableSelector.get_state()VariableSelector.get_timevar()VariableSelector.layout()
VariableSelectorOptionset_variables()
- Set_variables
- App_setup
- Main_layout
- Variableselector
- Utils
- Config tools
- Alert_handler
- App_logger
- Base_classes
ModuleBaseModuleBase.labelModuleBase.module_nameModuleBase.module_numberModuleBase.module_idModuleBase.module_layoutModuleBase.implemented_asModuleBase.iconModuleBase.iconModuleBase.implemented_asModuleBase.labelModuleBase.layout()ModuleBase.module_callbacks()ModuleBase.module_idModuleBase.module_layoutModuleBase.module_nameModuleBase.module_numberModuleBase.set_implementation()
- Core_models
InvalidIdentErrorUpdateSkjemadataUpdateSkjemadata.columnUpdateSkjemadata.identUpdateSkjemadata.identifier_columnUpdateSkjemadata.longUpdateSkjemadata.mapping_match_columnUpdateSkjemadata.mapping_result_columnUpdateSkjemadata.mapping_tableUpdateSkjemadata.model_configUpdateSkjemadata.old_valueUpdateSkjemadata.periodUpdateSkjemadata.refnrUpdateSkjemadata.skjemaUpdateSkjemadata.tableUpdateSkjemadata.time_unitsUpdateSkjemadata.to_alert()UpdateSkjemadata.update_ibis()UpdateSkjemadata.valueUpdateSkjemadata.variable
UpdateSkjemamottakUpdateSkjemamottakAktivUpdateSkjemamottakKommentar
- Core_query_functions
- Datahelper
- Debugger_modal
- Functions
- Implementations
TabImplementationTabModuleWindowImplementationWindowImplementation.labelWindowImplementation.module_nameWindowImplementation.module_layoutWindowImplementation.get_module_layout()WindowImplementation.labelWindowImplementation.layout()WindowImplementation.module_layoutWindowImplementation.module_nameWindowImplementation.window_callbacks()
WindowModule
- __main__
- YAML configuration
- Contributor Guide
- Code of Conduct
- License
- Changelog