squirrels 0.5.0b3__py3-none-any.whl → 0.5.0b4__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.

Potentially problematic release.


This version of squirrels might be problematic. Click here for more details.

Files changed (47) hide show
  1. squirrels/__init__.py +2 -0
  2. squirrels/_api_routes/__init__.py +5 -0
  3. squirrels/_api_routes/auth.py +262 -0
  4. squirrels/_api_routes/base.py +154 -0
  5. squirrels/_api_routes/dashboards.py +142 -0
  6. squirrels/_api_routes/data_management.py +103 -0
  7. squirrels/_api_routes/datasets.py +242 -0
  8. squirrels/_api_routes/oauth2.py +300 -0
  9. squirrels/_api_routes/project.py +214 -0
  10. squirrels/_api_server.py +142 -745
  11. squirrels/_arguments/__init__.py +0 -0
  12. squirrels/_arguments/{_init_time_args.py → init_time_args.py} +5 -0
  13. squirrels/_arguments/{_run_time_args.py → run_time_args.py} +1 -1
  14. squirrels/_auth.py +645 -92
  15. squirrels/_connection_set.py +1 -1
  16. squirrels/_constants.py +6 -0
  17. squirrels/{_dashboards_io.py → _dashboards.py} +87 -6
  18. squirrels/_exceptions.py +9 -37
  19. squirrels/_model_builder.py +1 -1
  20. squirrels/_model_queries.py +1 -1
  21. squirrels/_models.py +13 -12
  22. squirrels/_package_data/base_project/.env +1 -0
  23. squirrels/_package_data/base_project/.env.example +1 -0
  24. squirrels/_package_data/base_project/pyconfigs/parameters.py +84 -76
  25. squirrels/_package_data/base_project/pyconfigs/user.py +30 -2
  26. squirrels/_package_data/templates/dataset_results.html +112 -0
  27. squirrels/_package_data/templates/oauth_login.html +271 -0
  28. squirrels/_parameter_configs.py +1 -1
  29. squirrels/_parameter_sets.py +31 -21
  30. squirrels/_parameters.py +521 -123
  31. squirrels/_project.py +43 -24
  32. squirrels/_py_module.py +3 -2
  33. squirrels/_schemas/__init__.py +0 -0
  34. squirrels/_schemas/auth_models.py +144 -0
  35. squirrels/_schemas/query_param_models.py +67 -0
  36. squirrels/{_api_response_models.py → _schemas/response_models.py} +12 -8
  37. squirrels/_utils.py +34 -2
  38. squirrels/arguments.py +2 -2
  39. squirrels/auth.py +1 -0
  40. squirrels/dashboards.py +1 -1
  41. squirrels/types.py +3 -3
  42. {squirrels-0.5.0b3.dist-info → squirrels-0.5.0b4.dist-info}/METADATA +4 -1
  43. {squirrels-0.5.0b3.dist-info → squirrels-0.5.0b4.dist-info}/RECORD +46 -32
  44. squirrels/_dashboard_types.py +0 -82
  45. {squirrels-0.5.0b3.dist-info → squirrels-0.5.0b4.dist-info}/WHEEL +0 -0
  46. {squirrels-0.5.0b3.dist-info → squirrels-0.5.0b4.dist-info}/entry_points.txt +0 -0
  47. {squirrels-0.5.0b3.dist-info → squirrels-0.5.0b4.dist-info}/licenses/LICENSE +0 -0
@@ -1,82 +0,0 @@
1
- import matplotlib.figure as figure, io, abc, typing
2
-
3
- from . import _constants as c
4
-
5
-
6
- class Dashboard(metaclass=abc.ABCMeta):
7
- """
8
- Abstract parent class for all Dashboard classes.
9
- """
10
-
11
- @property
12
- @abc.abstractmethod
13
- def _content(self) -> bytes | str:
14
- pass
15
-
16
- @property
17
- @abc.abstractmethod
18
- def _format(self) -> str:
19
- pass
20
-
21
-
22
- class PngDashboard(Dashboard):
23
- """
24
- Instantiate a Dashboard in PNG format from a matplotlib figure or bytes
25
- """
26
-
27
- def __init__(self, content: figure.Figure | io.BytesIO | bytes) -> None:
28
- """
29
- Constructor for PngDashboard
30
-
31
- Arguments:
32
- content: The content of the dashboard as a matplotlib.figure.Figure or bytes
33
- """
34
- if isinstance(content, figure.Figure):
35
- buffer = io.BytesIO()
36
- content.savefig(buffer, format=c.PNG)
37
- content = buffer.getvalue()
38
-
39
- if isinstance(content, io.BytesIO):
40
- content = content.getvalue()
41
-
42
- self.__content = content
43
-
44
- @property
45
- def _content(self) -> bytes:
46
- return self.__content
47
-
48
- @property
49
- def _format(self) -> typing.Literal['png']:
50
- return c.PNG
51
-
52
- def _repr_png_(self):
53
- return self._content
54
-
55
-
56
- class HtmlDashboard(Dashboard):
57
- """
58
- Instantiate a Dashboard from an HTML string
59
- """
60
-
61
- def __init__(self, content: io.StringIO | str) -> None:
62
- """
63
- Constructor for HtmlDashboard
64
-
65
- Arguments:
66
- content: The content of the dashboard as HTML string
67
- """
68
- if isinstance(content, io.StringIO):
69
- content = content.getvalue()
70
-
71
- self.__content = content
72
-
73
- @property
74
- def _content(self) -> str:
75
- return self.__content
76
-
77
- @property
78
- def _format(self) -> typing.Literal['html']:
79
- return c.HTML
80
-
81
- def _repr_html_(self):
82
- return self._content