gov-uk-dashboards 23.1.0__py3-none-any.whl → 24.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gov_uk_dashboards/axes.py CHANGED
@@ -5,17 +5,18 @@ Contains:
5
5
  axis is at the origin or the lowest negative value in the column, whichever
6
6
  is lower.
7
7
  """
8
- from math import floor, ceil
9
- import pandas as pd
8
+ # from math import floor, ceil
10
9
 
10
+ # import pandas as pd
11
11
 
12
- def calc_axis_range(dataframe: pd.DataFrame, column: str) -> list:
13
- """Show origin on dashboard axis or negative value for numeric type column"""
14
- range_multiplier = 1.01
15
- axis_range = [
16
- floor(dataframe[[column]].min().iloc[0] * range_multiplier),
17
- ceil(dataframe[[column]].max().iloc[0] * range_multiplier),
18
- ]
19
- if axis_range[0] < 0:
20
- return axis_range
21
- return [0, axis_range[1]]
12
+
13
+ # def calc_axis_range(dataframe: pd.DataFrame, column: str) -> list:
14
+ # """Show origin on dashboard axis or negative value for numeric type column"""
15
+ # range_multiplier = 1.01
16
+ # axis_range = [
17
+ # floor(dataframe[[column]].min().iloc[0] * range_multiplier),
18
+ # ceil(dataframe[[column]].max().iloc[0] * range_multiplier),
19
+ # ]
20
+ # if axis_range[0] < 0:
21
+ # return axis_range
22
+ # return [0, axis_range[1]]
@@ -52,7 +52,6 @@ Contains:
52
52
  - phase_banner_with_feedback: Return a phase banner with a feedback link,
53
53
  which can be specified.
54
54
  - row_component: Returns a horizontal row used to contain cards.
55
- - table_from_dataframe: Return a html table created from a pandas DataFrame.
56
55
  - tooltip_title: Return a tooltip component for explaining details.
57
56
  - format_visualisation_commentary: Return paragraph styling commentary.
58
57
  - format_visualisation_title: Return a default formatted title for a
@@ -84,7 +83,6 @@ from .paragraph import paragraph, ParagraphSizes
84
83
  from .phase_banner import phase_banner_with_feedback
85
84
  from .row_component import row_component
86
85
  from .side_navbar import side_navbar
87
- from .table import table_from_dataframe
88
86
  from .tooltip_title import tooltip_title
89
87
  from .visualisation_commentary import format_visualisation_commentary
90
88
  from .visualisation_title import format_visualisation_title
@@ -1,109 +1,14 @@
1
1
  """Function for creating a table component from a dataframe"""
2
2
  from typing import Optional
3
- from pandas import DataFrame
3
+ import polars as pl
4
4
  from dash import html, dcc
5
5
  from gov_uk_dashboards.components.dash.card import card
6
6
  from gov_uk_dashboards.components.dash.paragraph import paragraph
7
-
8
- # from gov_uk_dashboards.components.plotly.row_component import row_component
9
-
10
-
11
- def table_from_dataframe(
12
- dataframe: DataFrame,
13
- title: Optional[str] = None,
14
- first_column_is_header: bool = True,
15
- title_is_subtitle: bool = False,
16
- short_table: bool = True,
17
- last_row_unbolded: bool = False,
18
- format_column_headers_as_markdown: bool = False,
19
- **table_properties,
20
- ): # pylint: disable=too-many-arguments
21
- # pylint: disable=too-many-positional-arguments
22
- """
23
- Displays a pandas DataFrame as a table formatted in the Gov.UK style
24
-
25
- Part of the Gov.UK Design System:
26
- https://design-system.service.gov.uk/components/table/
27
-
28
-
29
- Args:
30
- dataframe (DataFrame): Dataframe containing formatted data to display.
31
- title (str, optional): Title to display above the table. Defaults to None.
32
- first_column_is_header (bool, optional): Sets if the first column is a header column.
33
- Defaults to True.
34
- title_is_subtitle (bool, optional): Sets if the title should be displayed as a subtitle
35
- or full title. Defaults to False.
36
- short_table: (bool, optional): if False the header of the table will scroll with window.
37
- last_row_unbolded: (bool, optional): Sets if the last row should not be bolded if
38
- first_column_is_header is True. Defaults to False.
39
- format_column_headers_as_markdown: (bool, optional): Sets if the column headers should
40
- be formatted as markdown. Defaults to False.
41
- **table_properties: Any additional arguments for the html.Table object,
42
- such as setting a width or id.
43
-
44
- Returns:
45
- html.Table: The dash HTML object for the table.
46
- """
47
- table_contents = []
48
-
49
- if title:
50
- table_contents.append(
51
- html.Caption(
52
- title,
53
- className="govuk-table__caption govuk-table__caption--s"
54
- if title_is_subtitle
55
- else "govuk-table__caption govuk-table__caption--m",
56
- )
57
- )
58
-
59
- table_contents.append(
60
- html.Thead(
61
- html.Tr(
62
- [
63
- html.Th(
64
- dcc.Markdown(header),
65
- scope="col",
66
- className="govuk-table__header",
67
- )
68
- if format_column_headers_as_markdown
69
- else html.Th(header, scope="col", className="govuk-table__header")
70
- for header in dataframe.columns
71
- ],
72
- className="govuk-table__row",
73
- ),
74
- className="govuk-table__head-short" if short_table else "govuk-table__head",
75
- )
76
- )
77
-
78
- last_row_index = len(dataframe) - 1 if last_row_unbolded else len(dataframe)
79
- table_contents.append(
80
- html.Tbody(
81
- [
82
- html.Tr(
83
- [html.Th(row.iloc[0], scope="row", className="govuk-table__header")]
84
- + [html.Td(cell, className="govuk-table__cell") for cell in row[1:]]
85
- )
86
- if first_column_is_header and index != last_row_index
87
- else html.Tr(
88
- [html.Td(cell, className="govuk-table__cell") for cell in row]
89
- )
90
- for index, row in dataframe.iterrows()
91
- ],
92
- className="govuk-table__body",
93
- )
94
- )
95
-
96
- return html.Table(
97
- table_contents,
98
- className="govuk-table",
99
- id="table",
100
- role="table",
101
- **table_properties,
102
- )
7
+ from gov_uk_dashboards.formatting.text_functions import create_id_from_string
103
8
 
104
9
 
105
10
  def table_from_polars_dataframe(
106
- dataframe: DataFrame,
11
+ dataframe: pl.DataFrame,
107
12
  title: Optional[str] = None,
108
13
  subtitle: Optional[str] = None,
109
14
  first_column_is_header: bool = True,
@@ -112,6 +17,7 @@ def table_from_polars_dataframe(
112
17
  format_column_headers_as_markdown: bool = False,
113
18
  sortable_headers: bool = False,
114
19
  table_id: str = "table",
20
+ assign_ids_to_rows: bool = False,
115
21
  table_footer: str = None,
116
22
  column_widths: Optional[list[str]] = None,
117
23
  columns_to_right_align: Optional[list[str]] = None,
@@ -144,6 +50,7 @@ def table_from_polars_dataframe(
144
50
  sortable_headers: (bool, optional): Sets if the column headers should be sortable. Defaults
145
51
  to False.
146
52
  table_id: (str, optional): ID for the table Defaults to "table".
53
+ assign_ids_to_rows: (bool, optional): Adds id's to table rows when True. Defaults to False.
147
54
  table_footer: (str, optional): Text to display underneath table as footer.
148
55
  column_widths: (list[str], optional): Determines width of table columns. Format as a list,
149
56
  "x%". List must be same length as dataframe columns. Defaults to None.
@@ -283,7 +190,14 @@ def table_from_polars_dataframe(
283
190
  else {},
284
191
  )
285
192
  for cell, column_name in zip(row[1:], dataframe.columns[1:])
286
- ]
193
+ ],
194
+ **(
195
+ {
196
+ "id": create_id_from_string(row[0])
197
+ if assign_ids_to_rows and create_id_from_string(row[0])
198
+ else {}
199
+ }
200
+ ),
287
201
  )
288
202
  if first_column_is_header and index != last_row_index
289
203
  else html.Tr(
@@ -296,7 +210,14 @@ def table_from_polars_dataframe(
296
210
  else {},
297
211
  )
298
212
  for cell, column_name in zip(row, dataframe.columns)
299
- ]
213
+ ],
214
+ **(
215
+ {
216
+ "id": create_id_from_string(row[0])
217
+ if assign_ids_to_rows and create_id_from_string(row[0])
218
+ else {}
219
+ }
220
+ ),
300
221
  )
301
222
  )
302
223
  for index, row in enumerate(dataframe.rows())
@@ -13,5 +13,6 @@ Contains:
13
13
  """
14
14
  from . import enums
15
15
  from . import styles
16
- from .chart_data import ChartData
17
- from .line_chart import line_chart
16
+
17
+ # from .chart_data import ChartData
18
+ # from .line_chart import line_chart
@@ -1,24 +1,24 @@
1
1
  """ChartData dataclass"""
2
- from dataclasses import dataclass
3
- from typing import Optional
2
+ # from dataclasses import dataclass
3
+ # from typing import Optional
4
4
 
5
- import pandas as pd
5
+ # import pandas as pd
6
6
 
7
7
 
8
- @dataclass
9
- class ChartData:
10
- """
11
- Dataclass containing standard information useful for plotting charts.
8
+ # @dataclass
9
+ # class ChartData:
10
+ # """
11
+ # Dataclass containing standard information useful for plotting charts.
12
12
 
13
- Attributes:
14
- dataframe (pd.DataFrame): The dataframe containing the data for the chart.
15
- x_column (str): The label of the column containing the x axis values.
16
- y_column (str): The label of the column containing the y axis values.
17
- category_column (str, optional): If there are multiple categories in the data,
18
- this column gives the value to categorize them. Defaults to None.
19
- """
13
+ # Attributes:
14
+ # dataframe (pd.DataFrame): The dataframe containing the data for the chart.
15
+ # x_column (str): The label of the column containing the x axis values.
16
+ # y_column (str): The label of the column containing the y axis values.
17
+ # category_column (str, optional): If there are multiple categories in the data,
18
+ # this column gives the value to categorize them. Defaults to None.
19
+ # """
20
20
 
21
- dataframe: pd.DataFrame
22
- x_column: str
23
- y_column: str
24
- category_column: Optional[str] = None
21
+ # dataframe: pd.DataFrame
22
+ # x_column: str
23
+ # y_column: str
24
+ # category_column: Optional[str] = None
@@ -1,80 +1,80 @@
1
- """Line chart function"""
2
- from typing import Optional
3
- import plotly.express as px
4
- from gov_uk_dashboards.axes import calc_axis_range
5
- from gov_uk_dashboards.colours import ONSAccessibleColours
6
- from .styles import LineStyle
7
- from .chart_data import ChartData
1
+ # """Line chart function"""
2
+ # from typing import Optional
3
+ # import plotly.express as px
4
+ # from gov_uk_dashboards.axes import calc_axis_range
5
+ # from gov_uk_dashboards.colours import ONSAccessibleColours
6
+ # from .styles import LineStyle
7
+ # from .chart_data import ChartData
8
8
 
9
9
 
10
- def line_chart(
11
- data: ChartData,
12
- title: str,
13
- markers: bool = False,
14
- line_styles: Optional[dict[str, LineStyle]] = None,
15
- **px_line_kwargs,
16
- ):
17
- """
18
- Create and return a plotly express line chart with standard formatting.
10
+ # def line_chart(
11
+ # data: ChartData,
12
+ # title: str,
13
+ # markers: bool = False,
14
+ # line_styles: Optional[dict[str, LineStyle]] = None,
15
+ # **px_line_kwargs,
16
+ # ):
17
+ # """
18
+ # Create and return a plotly express line chart with standard formatting.
19
19
 
20
- Dataframe should be sorted so x axis is in the correct order for plotting.
20
+ # Dataframe should be sorted so x axis is in the correct order for plotting.
21
21
 
22
- If no style information provided, lines will be plotted as solid lines
23
- using the ONSAcessibleColours enum for their colours.
22
+ # If no style information provided, lines will be plotted as solid lines
23
+ # using the ONSAcessibleColours enum for their colours.
24
24
 
25
- Args:
26
- data (ChartData): Data for the chart.
27
- title (str): Title to be shown above the chart.
28
- markers (bool, optional): Whether markers should be plotted for each point.
29
- Defaults to False.
30
- line_styles (dict[str, LineStyle], optional): A dictionary with keys that match
31
- the categories in the category column (if supplied), and values that are
32
- LineStyle data objects to set out the style of the corresponding line.
33
- Defaults to None.
34
- **px_line_kwargs: Any other keyword arguments to pass to the plotly express
35
- line graph function.
25
+ # Args:
26
+ # data (ChartData): Data for the chart.
27
+ # title (str): Title to be shown above the chart.
28
+ # markers (bool, optional): Whether markers should be plotted for each point.
29
+ # Defaults to False.
30
+ # line_styles (dict[str, LineStyle], optional): A dictionary with keys that match
31
+ # the categories in the category column (if supplied), and values that are
32
+ # LineStyle data objects to set out the style of the corresponding line.
33
+ # Defaults to None.
34
+ # **px_line_kwargs: Any other keyword arguments to pass to the plotly express
35
+ # line graph function.
36
36
 
37
- Returns:
38
- plotly.Figure: The generated line chart figure object.
39
- """
40
- color_discrete_map = None
41
- line_dash_map = None
42
- labels = None
43
- if line_styles:
44
- color_discrete_map = {
45
- category: line_style.color for category, line_style in line_styles.items()
46
- }
47
- line_dash_map = {
48
- category: line_style.dash_pattern
49
- for category, line_style in line_styles.items()
50
- }
51
- # If line dashes are set, plotly express automatically appends the name of the dash style
52
- # to the label in the legend/hover data.
53
- # As this is normally not desired, labels are set manually to override this.
54
- labels = {category: category for category in line_styles}
37
+ # Returns:
38
+ # plotly.Figure: The generated line chart figure object.
39
+ # """
40
+ # color_discrete_map = None
41
+ # line_dash_map = None
42
+ # labels = None
43
+ # if line_styles:
44
+ # color_discrete_map = {
45
+ # category: line_style.color for category, line_style in line_styles.items()
46
+ # }
47
+ # line_dash_map = {
48
+ # category: line_style.dash_pattern
49
+ # for category, line_style in line_styles.items()
50
+ # }
51
+ # # If line dashes are set, plotly express automatically appends the name of the dash style
52
+ # # to the label in the legend/hover data.
53
+ # # As this is normally not desired, labels are set manually to override this.
54
+ # labels = {category: category for category in line_styles}
55
55
 
56
- linechart = px.line(
57
- data.dataframe,
58
- x=data.x_column,
59
- y=data.y_column,
60
- range_y=calc_axis_range(data.dataframe, data.y_column),
61
- color_discrete_map=color_discrete_map,
62
- line_dash_map=line_dash_map,
63
- line_dash=data.category_column,
64
- color=data.category_column,
65
- labels=labels,
66
- markers=markers,
67
- color_discrete_sequence=[colour.value for colour in ONSAccessibleColours]
68
- if not line_styles
69
- else None,
70
- **px_line_kwargs,
71
- )
56
+ # linechart = px.line(
57
+ # data.dataframe,
58
+ # x=data.x_column,
59
+ # y=data.y_column,
60
+ # range_y=calc_axis_range(data.dataframe, data.y_column),
61
+ # color_discrete_map=color_discrete_map,
62
+ # line_dash_map=line_dash_map,
63
+ # line_dash=data.category_column,
64
+ # color=data.category_column,
65
+ # labels=labels,
66
+ # markers=markers,
67
+ # color_discrete_sequence=[colour.value for colour in ONSAccessibleColours]
68
+ # if not line_styles
69
+ # else None,
70
+ # **px_line_kwargs,
71
+ # )
72
72
 
73
- linechart.update_layout(
74
- title=title,
75
- paper_bgcolor="rgba(0,0,0,0)",
76
- plot_bgcolor="rgba(0,0,0,0)",
77
- xaxis_type="category",
78
- )
73
+ # linechart.update_layout(
74
+ # title=title,
75
+ # paper_bgcolor="rgba(0,0,0,0)",
76
+ # plot_bgcolor="rgba(0,0,0,0)",
77
+ # xaxis_type="category",
78
+ # )
79
79
 
80
- return linechart
80
+ # return linechart
@@ -0,0 +1,11 @@
1
+ """Functions to format text"""
2
+
3
+ import re
4
+
5
+
6
+ def create_id_from_string(string):
7
+ """Function to create an id from a string. Remove non alphanumeric characters and replaces
8
+ spaces with dashes"""
9
+ if string is None:
10
+ return ""
11
+ return re.sub(r"[^a-z0-9]+", "-", string.lower()).strip("-")
@@ -1,109 +1,109 @@
1
1
  """ Returns a dataframe after connecting to CDS, otherwise uses a csv already saved in the file"""
2
- import os
3
- import json
4
- import pandas as pd
5
- import pyodbc
6
- import boto3
2
+ # import os
3
+ # import json
4
+ # import pyodbc
5
+ # import boto3
7
6
 
8
7
 
9
- def get_data_from_cds_or_fallback_to_csv(
10
- cds_sql_query: str, csv_path: str, secret_name: str, cds_server_name: str
11
- ) -> pd.DataFrame:
12
- """Tries to return dataframe from CDS first via Pydash credentials,
13
- otherwise via Amazon WorkSpaces,
14
- otherwise via a file from folder.
15
- Inputs:
16
- cds_sql_query(str): SQL query string
17
- csv_path(str): Filepath for location of csv to fallback to
18
- secret_name(str): AWS Secrets Manager, secret name containing CDS credentials.
19
- cds_server_name(str): CDS Server name used in connection string
20
- Returns:
21
- pd.DataFrame
22
- """
23
- if (
24
- "DATA_FOLDER_LOCATION" in os.environ
25
- and os.environ["DATA_FOLDER_LOCATION"] == "tests/"
26
- ) or ("STAGE" in os.environ and os.environ["STAGE"] == "testing"):
27
- return pd.read_csv(csv_path)
8
+ # def get_data_from_cds_or_fallback_to_csv(
9
+ # cds_sql_query: str, csv_path: str, secret_name: str, cds_server_name: str
10
+ # ) -> pd.DataFrame:
11
+ # """Tries to return dataframe from CDS first via Pydash credentials,
12
+ # otherwise via Amazon WorkSpaces,
13
+ # otherwise via a file from folder.
14
+ # Inputs:
15
+ # cds_sql_query(str): SQL query string
16
+ # csv_path(str): Filepath for location of csv to fallback to
17
+ # secret_name(str): AWS Secrets Manager, secret name containing CDS credentials.
18
+ # cds_server_name(str): CDS Server name used in connection string
19
+ # Returns:
20
+ # pd.DataFrame
21
+ # """
22
+ # if (
23
+ # "DATA_FOLDER_LOCATION" in os.environ
24
+ # and os.environ["DATA_FOLDER_LOCATION"] == "tests/"
25
+ # ) or ("STAGE" in os.environ and os.environ["STAGE"] == "testing"):
26
+ # return pd.read_csv(csv_path)
28
27
 
29
- try:
30
- conn = pyodbc.connect(
31
- _get_pydash_connection_string(secret_name, cds_server_name)
32
- )
33
- print("Dataframe has been loaded from CDS using Pydash credentials")
28
+ # try:
29
+ # conn = pyodbc.connect(
30
+ # _get_pydash_connection_string(secret_name, cds_server_name)
31
+ # )
32
+ # print("Dataframe has been loaded from CDS using Pydash credentials")
34
33
 
35
- return pd.read_sql_query(
36
- cds_sql_query,
37
- conn,
38
- )
34
+ # return pd.read_sql_query(
35
+ # cds_sql_query,
36
+ # conn,
37
+ # )
39
38
 
40
- except Exception as credential_error: # pylint: disable=broad-except
41
- try:
42
- print(
43
- "Failed to load dataframe using Pydash credentials: ", credential_error
44
- )
45
- conn = pyodbc.connect(
46
- "Driver={SQL Server};"
47
- f"Server={cds_server_name};"
48
- "Database=Dashboards;"
49
- "Trusted_Connection=yes;"
50
- )
51
- print(
52
- "Dataframe has been loaded from CDS using Windows login authentication"
53
- )
39
+ # except Exception as credential_error: # pylint: disable=broad-except
40
+ # try:
41
+ # print(
42
+ # "Failed to load dataframe using Pydash credentials: ", credential_error
43
+ # )
44
+ # conn = pyodbc.connect(
45
+ # "Driver={SQL Server};"
46
+ # f"Server={cds_server_name};"
47
+ # "Database=Dashboards;"
48
+ # "Trusted_Connection=yes;"
49
+ # )
50
+ # print(
51
+ # "Dataframe has been loaded from CDS using Windows login authentication"
52
+ # )
54
53
 
55
- return pd.read_sql_query(
56
- cds_sql_query,
57
- conn,
58
- )
54
+ # return pd.read_sql_query(
55
+ # cds_sql_query,
56
+ # conn,
57
+ # )
59
58
 
60
- except pyodbc.Error as conn_error_except:
61
- print(
62
- "Failed to load dataframe using Windows login authentication: ",
63
- conn_error_except,
64
- )
65
- print("Dataframe has been loaded from CSV")
66
- return pd.read_csv(csv_path)
59
+ # except pyodbc.Error as conn_error_except:
60
+ # print(
61
+ # "Failed to load dataframe using Windows login authentication: ",
62
+ # conn_error_except,
63
+ # )
64
+ # print("Dataframe has been loaded from CSV")
65
+ # return pd.read_csv(csv_path)
67
66
 
68
67
 
69
- def _get_pydash_connection_string(secret_name: str, cds_server_name: str):
70
- """
71
- Pydash aka DAP Hosting requires username and password
72
- Inputs:
73
- secret_name(str): AWS Secrets Manager, secret name containing CDS credentials.
74
- cds_server_name(str): CDS Server name used in connection string
75
- """
76
- credentials = _pydash_sql_credentials(secret_name)
77
- conn_string_dap = (
78
- "Driver={/usr/lib/libmsodbcsql-18.so};"
79
- f"Server={cds_server_name};"
80
- "TrustServerCertificate=yes;"
81
- "Database=Dashboards;"
82
- )
83
- return (
84
- f"{conn_string_dap}UID={credentials['username']};PWD={credentials['password']};"
85
- )
68
+ # def _get_pydash_connection_string(secret_name: str, cds_server_name: str):
69
+ # """
70
+ # Pydash aka DAP Hosting requires username and password
71
+ # Inputs:
72
+ # secret_name(str): AWS Secrets Manager, secret name containing CDS credentials.
73
+ # cds_server_name(str): CDS Server name used in connection string
74
+ # """
75
+ # credentials = _pydash_sql_credentials(secret_name)
76
+ # conn_string_dap = (
77
+ # "Driver={/usr/lib/libmsodbcsql-18.so};"
78
+ # f"Server={cds_server_name};"
79
+ # "TrustServerCertificate=yes;"
80
+ # "Database=Dashboards;"
81
+ # )
82
+ # return (
83
+ # f"{conn_string_dap}UID={credentials['username']};PWD={credentials['password']};"
84
+ # )
86
85
 
87
86
 
88
- def _pydash_sql_credentials(secret_name: str):
89
- """
90
- Logging into CDS from Pydash requires user name and password.
91
- This method will return a dictionary containing the keys "username" and "password".
92
- Raises `botocore.exceptions.ClientError` if no credentials could be obtained
93
- Inputs:
94
- secret_name(str): AWS Secrets Manager, secret name containing CDS credentials.
95
- Returns:
96
- dict: a dictionary containing the keys "username" and "password"
97
- """
98
- region_name = "eu-west-1"
99
- # Create a Secrets Manager client
100
- session = boto3.session.Session()
101
- client = session.client(service_name="secretsmanager", region_name=region_name)
102
- # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/secretsmanager.html#SecretsManager.Client.get_secret_value
87
+ # def _pydash_sql_credentials(secret_name: str):
88
+ # """
89
+ # Logging into CDS from Pydash requires user name and password.
90
+ # This method will return a dictionary containing the keys "username" and "password".
91
+ # Raises `botocore.exceptions.ClientError` if no credentials could be obtained
92
+ # Inputs:
93
+ # secret_name(str): AWS Secrets Manager, secret name containing CDS credentials.
94
+ # Returns:
95
+ # dict: a dictionary containing the keys "username" and "password"
96
+ # """
97
+ # region_name = "eu-west-1"
98
+ # # Create a Secrets Manager client
99
+ # session = boto3.session.Session()
100
+ # client = session.client(service_name="secretsmanager", region_name=region_name)
101
+ # # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/secretsmanager
102
+ # .html#SecretsManager.Client.get_secret_value
103
103
 
104
- get_secret_value_response = client.get_secret_value(SecretId=secret_name)
104
+ # get_secret_value_response = client.get_secret_value(SecretId=secret_name)
105
105
 
106
- secret = get_secret_value_response["SecretString"]
106
+ # secret = get_secret_value_response["SecretString"]
107
107
 
108
- credentials = json.loads(secret)
109
- return credentials
108
+ # credentials = json.loads(secret)
109
+ # return credentials
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gov_uk_dashboards
3
- Version: 23.1.0
3
+ Version: 24.1.0
4
4
  Summary: Provides access to functionality common to creating a data dashboard.
5
5
  Author: Department for Levelling Up, Housing and Communities
6
6
  Description-Content-Type: text/markdown
@@ -9,7 +9,6 @@ Requires-Dist: setuptools~=59.8
9
9
  Requires-Dist: dash~=2.0
10
10
  Requires-Dist: numpy>=1.22.0
11
11
  Requires-Dist: dash_bootstrap_components~=1.1
12
- Requires-Dist: pandas>=1.3
13
12
  Requires-Dist: plotly~=5.5
14
13
  Requires-Dist: flask-basicauth~=0.2.0
15
14
  Dynamic: author
@@ -1,5 +1,5 @@
1
1
  gov_uk_dashboards/__init__.py,sha256=4y4hozrL4hzRUna8b22UQwtkZcvvCgeXsAtA6AJww8g,1299
2
- gov_uk_dashboards/axes.py,sha256=Oh8zyWzxwZWq8bQl-vJoXwTANZ7ACZiYPmIXlM62Fvk,712
2
+ gov_uk_dashboards/axes.py,sha256=2sz02JLQ6MnX1RTmeFe3WgHx4s8dAeXj0l-2gsBlqeg,737
3
3
  gov_uk_dashboards/colours.py,sha256=MezFI_3hgEuZ7f8F5TdtgaQO00B3G7ylRTCVq3SlSF4,2371
4
4
  gov_uk_dashboards/constants.py,sha256=O_JyW1XlNg_mHwmT2xfup6mOtfd9x44ky5APReFfOqo,686
5
5
  gov_uk_dashboards/symbols.py,sha256=6_lq8yl1l7sGUlOY29wip_PXeUUoM53_fakKY1omVwY,424
@@ -38,7 +38,7 @@ gov_uk_dashboards/assets/images/oflog/how_to_5_viewing_tables.png,sha256=kC36T6T
38
38
  gov_uk_dashboards/assets/topojson/usa_110m.json,sha256=yX3AZ1tGULJmVFyWwMkb19WdZShJbvpa97uYvldMvTk,49104
39
39
  gov_uk_dashboards/assets/topojson/world_110m.json,sha256=11kV6qMchw32uXLJ5buGkQGXgl8z3P73QPOy9oz_6EM,136642
40
40
  gov_uk_dashboards/components/__init__.py,sha256=19fr4E5-FkG_rXAPwRc2Gh60ncgc7Ho1WdrMV5x9frw,187
41
- gov_uk_dashboards/components/dash/__init__.py,sha256=0Sunv0rmcn-LevR17i90Qr542BLek3EZwmiP_uaJJHA,4830
41
+ gov_uk_dashboards/components/dash/__init__.py,sha256=2jqt8kDFc1slQ7_9eGs0EfMpaadYuIitWs_v41d_iss,4713
42
42
  gov_uk_dashboards/components/dash/apply_and_reset_filters_buttons.py,sha256=I7VoKOS_zIYdQvDP3SkAOntDMxZSQKCxnY80173EVz8,673
43
43
  gov_uk_dashboards/components/dash/banners.py,sha256=TDHdJQSb7mCqtmM6ylSnVh_Qpd2Aec1jSR8RfsjqQoE,958
44
44
  gov_uk_dashboards/components/dash/card.py,sha256=aErz9h536nYvpp9LZsFHo_Rn5rRXXfyGh358VcLksaE,420
@@ -65,7 +65,7 @@ gov_uk_dashboards/components/dash/paragraph.py,sha256=yoWa_B6RLiebBX2QaszY3lyZEx
65
65
  gov_uk_dashboards/components/dash/phase_banner.py,sha256=7XIk_y-kStSaptXnk9yHVu8S0n-ypwWehDqOwjb5l-c,1787
66
66
  gov_uk_dashboards/components/dash/row_component.py,sha256=SdmJqyFJA1Kngyzxy0ooZUegIOiN6Bz1wRq6jGigfII,687
67
67
  gov_uk_dashboards/components/dash/side_navbar.py,sha256=pupA0FdjSbPbzdX9up6wEoIKWIuk3zGRun4opnBieCU,1332
68
- gov_uk_dashboards/components/dash/table.py,sha256=Bd_JaUOnjnaO2fzZZ_HR4QiIr7WGuaiGKrM-w-bPMog,13761
68
+ gov_uk_dashboards/components/dash/table.py,sha256=Jt2dFddWsXBaLBXVdO1QKntrT4MYZeG2GgwYycldi64,11060
69
69
  gov_uk_dashboards/components/dash/tooltip.py,sha256=qTkRWQanhG535Yi4NiaLlEMJqqzjubgRdKJDIhxXzd4,978
70
70
  gov_uk_dashboards/components/dash/tooltip_title.py,sha256=2exMYItzR17yOu3gTL77DyUU4Hi3CIB-ZPS8ftetqZg,874
71
71
  gov_uk_dashboards/components/dash/visualisation_commentary.py,sha256=jBy8qy2DWYqodqDZ8QdDmgOO_USDSwn2Sj5CnL58VMM,648
@@ -85,9 +85,9 @@ gov_uk_dashboards/components/plotly/choropleth_map.py,sha256=U9RmS3MZGloQAt9HoSY
85
85
  gov_uk_dashboards/components/plotly/enums.py,sha256=ebHiFQljA7O4HJxKoslqlNXcAjUZi1askpTSwxKEcYQ,850
86
86
  gov_uk_dashboards/components/plotly/stacked_barchart.py,sha256=AVX9w6_TlAXOkJVmQL_owd60AW5QXSrL4Jb2bwSMElE,14716
87
87
  gov_uk_dashboards/components/plotly/time_series_chart.py,sha256=y6jUZCmJa82PgzeszFJ0-1-JHwB56rwYgY4_e7hHT6A,24842
88
- gov_uk_dashboards/figures/__init__.py,sha256=_snQeNlM81nNKERl4gg9ScH2HYbtwaBjl8yQonccx34,712
89
- gov_uk_dashboards/figures/chart_data.py,sha256=fEsNkQFzXKIQ0h7aLBWq3J1qAxHbxvJeKU23JrVodVc,757
90
- gov_uk_dashboards/figures/line_chart.py,sha256=rEB51_z9cPl7BcT94iA6ZsZXzecnVCnGpQWW_9SNGUY,2813
88
+ gov_uk_dashboards/figures/__init__.py,sha256=ZvgPOh41MS-HqQoLRLXyKcOd_oFlDRLukGaCdsaN6FU,717
89
+ gov_uk_dashboards/figures/chart_data.py,sha256=V_a3oLTRJx5CKvkzHHZq_K1YDtAHlicQmxoCX15kzKg,793
90
+ gov_uk_dashboards/figures/line_chart.py,sha256=3fr5HVwOnuuR6xZ5t0UXB0U2I803yhTjDZMkf1ttstY,2955
91
91
  gov_uk_dashboards/figures/enums/__init__.py,sha256=eX82QkkQI1fp3efmCoClOxNxxzAseKwEi5feMKun-_o,202
92
92
  gov_uk_dashboards/figures/enums/dash_patterns.py,sha256=wEdjOe1UDx2u7tG8p4vN1000XwWMopni3OQIuLW15Nw,300
93
93
  gov_uk_dashboards/figures/styles/__init__.py,sha256=wVa8BU0TvXnanksOUVWN4utFKW4OTLC5q-7J07rPE6Y,215
@@ -97,20 +97,21 @@ gov_uk_dashboards/formatting/human_readable.py,sha256=o5-Xlbm7wP_4wU9mIdsG0ztU5a
97
97
  gov_uk_dashboards/formatting/number_formatting.py,sha256=9LVqKqx0mMQyv8XLI_im1pdASZDJxRjzRWtRN-g6kPs,913
98
98
  gov_uk_dashboards/formatting/round_and_add_prefix_and_suffix.py,sha256=_DboRfdvwb9Y62H9LFDFJ0ju4626z-_oFuwagRgyZDY,1456
99
99
  gov_uk_dashboards/formatting/rounding.py,sha256=Em1yri_j18IYHbZ64d3bhVKX-XEllRSM9FzAUo1o6fU,968
100
+ gov_uk_dashboards/formatting/text_functions.py,sha256=vHstpUo16LnsSk-rzwFDNP1SIAy2npIo-4ims1xNa64,306
100
101
  gov_uk_dashboards/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
101
102
  gov_uk_dashboards/lib/enable_basic_auth.py,sha256=Ul2tnopTJm6_UQ1ljKGwk-Ay3Z8KnPNKNjwiBOf1yd0,749
102
103
  gov_uk_dashboards/lib/http_headers.py,sha256=Hur3R0_hAsWz8PntBhD66w4kgdW6EvwHNNugnA0DIJM,1592
103
104
  gov_uk_dashboards/lib/logging.py,sha256=osLxh5KDsEgAsaGQSM05h8MBJgLG-RFy8gLtWSivEik,354
104
105
  gov_uk_dashboards/lib/dap/__init__.py,sha256=bYga8kJuf9TGkfpnd16SInrD1FcN8iPn4SzcUSHAH48,76
105
106
  gov_uk_dashboards/lib/dap/dap_deployment.py,sha256=ZXixeOAtRNjMsPdGKLwwLNamlo0miZLaKCckKtq8_iI,2313
106
- gov_uk_dashboards/lib/dap/get_dataframe_from_cds.py,sha256=OiusRCgYnkBjK_GZgYLGzNrxOGizYt8CgThiWRCVKK0,3921
107
+ gov_uk_dashboards/lib/dap/get_dataframe_from_cds.py,sha256=6DUaoVBO4YqwiuCXvetE8_t-8mVcO27HnCRKlzz8Hpk,4090
107
108
  gov_uk_dashboards/lib/datetime_functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
109
  gov_uk_dashboards/lib/datetime_functions/datetime_functions.py,sha256=BQgr8I_vFNYwLi-fE4YC6jZ5PpbPea2rnD_2a_lw0YE,12209
109
110
  gov_uk_dashboards/lib/download_functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
110
111
  gov_uk_dashboards/lib/download_functions/convert_fig_to_image_and_download.py,sha256=-dkYbpTL6txftFfAZW-vfW_O9efb6Dse9WJ9MM6mAqw,534
111
112
  gov_uk_dashboards/lib/download_functions/download_csv_with_headers.py,sha256=aLL3UodmilZA_1bQhtjtKi3FoB-4X_MtLOcDw5e1Nwo,4412
112
- gov_uk_dashboards-23.1.0.dist-info/licenses/LICENSE,sha256=GDiD7Y2Gx7JucPV1JfVySJeah-qiSyBPdpJ6RHCEHTc,1126
113
- gov_uk_dashboards-23.1.0.dist-info/METADATA,sha256=CbvbkxjcweduBot0WInnC-x8I7mLKtWrd2xVzV5m9Do,5917
114
- gov_uk_dashboards-23.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
115
- gov_uk_dashboards-23.1.0.dist-info/top_level.txt,sha256=gPaN1P3-H3Rgi2me6tt-fX_cxo19CZfA4PjlZPjGRpo,18
116
- gov_uk_dashboards-23.1.0.dist-info/RECORD,,
113
+ gov_uk_dashboards-24.1.0.dist-info/licenses/LICENSE,sha256=GDiD7Y2Gx7JucPV1JfVySJeah-qiSyBPdpJ6RHCEHTc,1126
114
+ gov_uk_dashboards-24.1.0.dist-info/METADATA,sha256=jreh2sGUUeWLJk_MdHLPT_Fb_CWd-LGTW4uIO-qfpnI,5890
115
+ gov_uk_dashboards-24.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
116
+ gov_uk_dashboards-24.1.0.dist-info/top_level.txt,sha256=gPaN1P3-H3Rgi2me6tt-fX_cxo19CZfA4PjlZPjGRpo,18
117
+ gov_uk_dashboards-24.1.0.dist-info/RECORD,,