tiferet 1.0.0a19__py3-none-any.whl → 1.0.0b1__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.
Files changed (59) hide show
  1. tiferet/__init__.py +3 -2
  2. tiferet/commands/__init__.py +6 -0
  3. tiferet/commands/app.py +102 -0
  4. tiferet/commands/core.py +124 -0
  5. tiferet/commands/dependencies.py +76 -0
  6. tiferet/commands/settings.py +101 -0
  7. tiferet/configs/__init__.py +3 -67
  8. tiferet/configs/error.py +48 -0
  9. tiferet/configs/settings.py +37 -0
  10. tiferet/contexts/__init__.py +0 -8
  11. tiferet/contexts/app.py +215 -182
  12. tiferet/contexts/cache.py +76 -0
  13. tiferet/contexts/container.py +92 -190
  14. tiferet/contexts/error.py +78 -80
  15. tiferet/contexts/feature.py +122 -83
  16. tiferet/contracts/__init__.py +4 -0
  17. tiferet/contracts/app.py +92 -0
  18. tiferet/contracts/cache.py +70 -0
  19. tiferet/contracts/container.py +147 -0
  20. tiferet/contracts/error.py +177 -0
  21. tiferet/contracts/feature.py +159 -0
  22. tiferet/contracts/settings.py +34 -0
  23. tiferet/data/__init__.py +3 -4
  24. tiferet/data/app.py +71 -208
  25. tiferet/data/container.py +52 -38
  26. tiferet/data/error.py +15 -24
  27. tiferet/data/feature.py +27 -8
  28. tiferet/{domain/core.py → data/settings.py} +36 -96
  29. tiferet/handlers/__init__.py +0 -0
  30. tiferet/handlers/container.py +116 -0
  31. tiferet/handlers/error.py +49 -0
  32. tiferet/handlers/feature.py +94 -0
  33. tiferet/models/__init__.py +4 -0
  34. tiferet/models/app.py +150 -0
  35. tiferet/models/container.py +135 -0
  36. tiferet/{domain → models}/error.py +86 -36
  37. tiferet/{domain → models}/feature.py +107 -47
  38. tiferet/models/settings.py +148 -0
  39. tiferet/proxies/__init__.py +0 -0
  40. tiferet/proxies/yaml/__init__.py +0 -0
  41. tiferet/{repos → proxies/yaml}/app.py +13 -41
  42. tiferet/{repos → proxies/yaml}/container.py +26 -56
  43. tiferet/{repos → proxies/yaml}/error.py +11 -70
  44. tiferet/proxies/yaml/feature.py +92 -0
  45. {tiferet-1.0.0a19.dist-info → tiferet-1.0.0b1.dist-info}/METADATA +12 -3
  46. tiferet-1.0.0b1.dist-info/RECORD +51 -0
  47. {tiferet-1.0.0a19.dist-info → tiferet-1.0.0b1.dist-info}/WHEEL +1 -1
  48. tiferet/commands/container.py +0 -54
  49. tiferet/commands/error.py +0 -21
  50. tiferet/commands/feature.py +0 -90
  51. tiferet/contexts/request.py +0 -110
  52. tiferet/domain/__init__.py +0 -5
  53. tiferet/domain/app.py +0 -131
  54. tiferet/domain/container.py +0 -141
  55. tiferet/repos/__init__.py +0 -7
  56. tiferet/repos/feature.py +0 -151
  57. tiferet-1.0.0a19.dist-info/RECORD +0 -35
  58. {tiferet-1.0.0a19.dist-info → tiferet-1.0.0b1.dist-info/licenses}/LICENSE +0 -0
  59. {tiferet-1.0.0a19.dist-info → tiferet-1.0.0b1.dist-info}/top_level.txt +0 -0
tiferet/repos/feature.py DELETED
@@ -1,151 +0,0 @@
1
- # *** imports
2
-
3
- # ** core
4
- from typing import List
5
-
6
- # ** app
7
- from ..data.feature import FeatureData
8
- from ..domain.feature import Feature
9
- from ..clients import yaml_client
10
-
11
- # *** repository
12
-
13
- # ** interface: feature_repository
14
- class FeatureRepository(object):
15
- '''
16
- Feature repository interface.
17
- '''
18
-
19
- # * method: exists
20
- def exists(self, id: str) -> bool:
21
- '''
22
- Verifies if the feature exists.
23
-
24
- :param id: The feature id.
25
- :type id: str
26
- :return: Whether the feature exists.
27
- :rtype: bool
28
- '''
29
-
30
- # Not implemented.
31
- raise NotImplementedError()
32
-
33
- # * method: get
34
- def get(self, id: str) -> Feature:
35
- '''
36
- Get the feature by id.
37
-
38
- :param id: The feature id.
39
- :type id: str
40
- :return: The feature object.
41
- :rtype: f.Feature
42
- '''
43
-
44
- # Not implemented.
45
- raise NotImplementedError()
46
-
47
- # * method: list
48
- def list(self, group_id: str = None) -> List[Feature]:
49
- '''
50
- List the features.
51
-
52
- :param group_id: The group id.
53
- :type group_id: str
54
- :return: The list of features.
55
- :rtype: list
56
- '''
57
-
58
- # Not implemented.
59
- raise NotImplementedError()
60
-
61
-
62
- # ** repository: yaml_proxy
63
- class YamlProxy(FeatureRepository):
64
- '''
65
- Yaml repository for features.
66
- '''
67
-
68
- # * method: init
69
- def __init__(self, feature_config_file: str):
70
- '''
71
- Initialize the yaml repository.
72
-
73
- :param feature_config_file: The feature configuration file.
74
- :type feature_config_file: str
75
- '''
76
-
77
- # Set the base path.
78
- self.config_file = feature_config_file
79
-
80
- # * method: exists
81
- def exists(self, id: str) -> bool:
82
- '''
83
- Verifies if the feature exists.
84
-
85
- :param id: The feature id.
86
- :type id: str
87
- :return: Whether the feature exists.
88
- :rtype: bool
89
- '''
90
-
91
- # Retrieve the feature by id.
92
- feature = self.get(id)
93
-
94
- # Return whether the feature exists.
95
- return feature is not None
96
-
97
- # * method: get
98
- def get(self, id: str) -> Feature:
99
- '''
100
- Get the feature by id.
101
-
102
- :param id: The feature id.
103
- :type id: str
104
- :return: The feature object.
105
- '''
106
-
107
- # Load feature data from yaml.
108
- _data: FeatureData = yaml_client.load(
109
- self.config_file,
110
- create_data=lambda data: FeatureData.from_data(
111
- id=id,
112
- **data
113
- ),
114
- start_node=lambda data: data.get('features').get(id)
115
- )
116
-
117
- # Return None if feature data is not found.
118
- if not _data:
119
- return None
120
-
121
- # Return feature.
122
- return _data.map()
123
-
124
- # * method: list
125
- def list(self, group_id: str = None) -> List[Feature]:
126
- '''
127
- List the features.
128
-
129
- :param group_id: The group id.
130
- :type group_id: str
131
- :return: The list of features.
132
- :rtype: list
133
- '''
134
-
135
- # Load all feature data from yaml.
136
- features = yaml_client.load(
137
- self.config_file,
138
- create_data=lambda data: [FeatureData.from_data(
139
- id=id,
140
- **feature_data
141
- ) for id, feature_data in data.items()],
142
- start_node=lambda data: data.get('features')
143
- )
144
-
145
- # Filter features by group id.
146
- if group_id:
147
- features = [feature for feature in features if feature.group_id == group_id]
148
-
149
- # Return the list of features.
150
- return [feature.map() for feature in features]
151
-
@@ -1,35 +0,0 @@
1
- tiferet/__init__.py,sha256=1CDYADhNKmHqE4yYf7RgcQcNQm34FTRR2w4WTzbm2Rk,70
2
- tiferet/clients/__init__.py,sha256=hSa_PgXM2jw9iVRrJH_SQUlSVISK-T4tTfgRKnXKkzA,33
3
- tiferet/clients/yaml.py,sha256=790LB7CpaMow_Ng8zB6jGmJnoqz8xjMYbfDLeMd4o3Q,2816
4
- tiferet/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- tiferet/commands/container.py,sha256=L2IKJqEbRglw_LC144oYAkARr2Rixj8IFuC6Ro1jAqA,1789
6
- tiferet/commands/error.py,sha256=ixMYH0yrEWlMAVGDSRke3IGoWaOShfmiXntrUC2b3wY,573
7
- tiferet/commands/feature.py,sha256=tXa-MDf14ByIJqwQFeSUu2QLUjHPdsyvFNhj1XeaQVk,2507
8
- tiferet/configs/__init__.py,sha256=NfT6XFNcJznOLXjMuNmj3XeaOPVWwbc-N4kVWaVjuD0,845
9
- tiferet/contexts/__init__.py,sha256=PvTgdVMav7B4pbKV4vxfNTMSod88DKGSR_0W8reIyC4,235
10
- tiferet/contexts/app.py,sha256=_GiawlFowEbnVvBw6XgUlLjgLu2CwlHuK4ldT_v6a1c,8305
11
- tiferet/contexts/container.py,sha256=Wo_2HENb7XPpIcZSkEikSGh8vWmClpLgkBbSW-jMDK4,6619
12
- tiferet/contexts/error.py,sha256=e6phkdQU5QY9ULrHNvuen0dQYw_XjFN--gexW06BfUE,3431
13
- tiferet/contexts/feature.py,sha256=kVVRpIyjWa3T2QoT2R-T7clOIQEpNMYa8ZJRVxgY_6o,3730
14
- tiferet/contexts/request.py,sha256=EwTyXVYi8z1t1ns_0yDrjY6qICIMPn1UvZpV7ULKReY,2756
15
- tiferet/data/__init__.py,sha256=JKaeCw508WY15-etqdFJxPUUJxMxCAi6ASmA472D1_s,93
16
- tiferet/data/app.py,sha256=dQXcC-A9oDJrwJCqkLSO9KyyldxtUjF7hGmfJqMzEXs,7881
17
- tiferet/data/container.py,sha256=o2HnLN1LasqWGP_S1Ub32CrCqYzehlD3dgXizW9XfU8,6154
18
- tiferet/data/error.py,sha256=Kllt0w62BAyShdVSwATN0LiVTeQHqkyQAN9_HuFg31Q,2339
19
- tiferet/data/feature.py,sha256=cjmm0lkmoFiCs0kyTDLH-OruTxTNJQf4BAkjtFu22Tk,2921
20
- tiferet/domain/__init__.py,sha256=vlZizSMkzaDYAZVHDB_YPaS3mo57vyW53DWaaSZhhkw,196
21
- tiferet/domain/app.py,sha256=CYFK8KqkBqpAWNY45jMN-r_Tf7sell2R6pqquo7cmJg,3242
22
- tiferet/domain/container.py,sha256=wjal73hWAs5EvRO9XbrBBfdpV9nq9J89mAPbd4SH4ws,3666
23
- tiferet/domain/core.py,sha256=fOZeGxTJLGzY2zgAoSJu6rVJySpv-vCycT-WcEMk8kI,5152
24
- tiferet/domain/error.py,sha256=tWoJqg81LtfZfArN5OJRPVaZrAFcET0YUJJs52KHqYA,3853
25
- tiferet/domain/feature.py,sha256=drkCfhuIQhT05m61QzKdscaFdP0f-4K4tqO98lzXOjM,4866
26
- tiferet/repos/__init__.py,sha256=m6YLp90oqqs0cXQKOrDxudcc8P-AbeJ87a8okgoU7uI,171
27
- tiferet/repos/app.py,sha256=VxPanqWw4lGi1VoajTXN3sv9yy_XV6m_95E6DTdMHb8,2900
28
- tiferet/repos/container.py,sha256=n9Tz83QETdAocGAT4oKcvllEGwFp069pYqkXs2-KFFk,3519
29
- tiferet/repos/error.py,sha256=jDze41uioKwKEkAswkzLubVw-bxsVyeUkJwyeO5Es0E,4245
30
- tiferet/repos/feature.py,sha256=GxOV8XHNwz9YY3I8Wch6GaDskvkdi8l1hM9E9fCg1y0,3644
31
- tiferet-1.0.0a19.dist-info/LICENSE,sha256=e8_GutFM0sxbRlgUaeVsGvJ5uE-KvruLApOzIoHy_zU,1513
32
- tiferet-1.0.0a19.dist-info/METADATA,sha256=KcBb6H-yM-XribqKKpLQlWJzHYJ5XJJ0Xx2wdA7hfbk,536
33
- tiferet-1.0.0a19.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
34
- tiferet-1.0.0a19.dist-info/top_level.txt,sha256=g19Qw0j_VxPw-fgPF1TMPwbtHjnEhNQs0fa69wJZ6IM,8
35
- tiferet-1.0.0a19.dist-info/RECORD,,