pylegend 0.10.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.
Files changed (170) hide show
  1. pylegend-0.10.0/LICENSE +201 -0
  2. pylegend-0.10.0/LICENSE.spdx +7 -0
  3. pylegend-0.10.0/NOTICE +5 -0
  4. pylegend-0.10.0/PKG-INFO +72 -0
  5. pylegend-0.10.0/README.md +44 -0
  6. pylegend-0.10.0/pylegend/__init__.py +76 -0
  7. pylegend-0.10.0/pylegend/_typing.py +50 -0
  8. pylegend-0.10.0/pylegend/core/__init__.py +13 -0
  9. pylegend-0.10.0/pylegend/core/database/__init__.py +13 -0
  10. pylegend-0.10.0/pylegend/core/database/sql_to_string/__init__.py +25 -0
  11. pylegend-0.10.0/pylegend/core/database/sql_to_string/config.py +44 -0
  12. pylegend-0.10.0/pylegend/core/database/sql_to_string/db_extension.py +1262 -0
  13. pylegend-0.10.0/pylegend/core/database/sql_to_string/generator.py +64 -0
  14. pylegend-0.10.0/pylegend/core/language/__init__.py +137 -0
  15. pylegend-0.10.0/pylegend/core/language/legacy_api/__init__.py +13 -0
  16. pylegend-0.10.0/pylegend/core/language/legacy_api/aggregate_specification.py +62 -0
  17. pylegend-0.10.0/pylegend/core/language/legacy_api/legacy_api_tds_row.py +32 -0
  18. pylegend-0.10.0/pylegend/core/language/legendql_api/__init__.py +13 -0
  19. pylegend-0.10.0/pylegend/core/language/legendql_api/legendql_api_custom_expressions.py +541 -0
  20. pylegend-0.10.0/pylegend/core/language/legendql_api/legendql_api_tds_row.py +292 -0
  21. pylegend-0.10.0/pylegend/core/language/pandas_api/__init__.py +13 -0
  22. pylegend-0.10.0/pylegend/core/language/pandas_api/pandas_api_aggregate_specification.py +54 -0
  23. pylegend-0.10.0/pylegend/core/language/pandas_api/pandas_api_custom_expressions.py +85 -0
  24. pylegend-0.10.0/pylegend/core/language/pandas_api/pandas_api_series.py +174 -0
  25. pylegend-0.10.0/pylegend/core/language/pandas_api/pandas_api_tds_row.py +74 -0
  26. pylegend-0.10.0/pylegend/core/language/shared/__init__.py +13 -0
  27. pylegend-0.10.0/pylegend/core/language/shared/column_expressions.py +124 -0
  28. pylegend-0.10.0/pylegend/core/language/shared/expression.py +88 -0
  29. pylegend-0.10.0/pylegend/core/language/shared/functions.py +54 -0
  30. pylegend-0.10.0/pylegend/core/language/shared/helpers.py +67 -0
  31. pylegend-0.10.0/pylegend/core/language/shared/literal_expressions.py +199 -0
  32. pylegend-0.10.0/pylegend/core/language/shared/operations/__init__.py +13 -0
  33. pylegend-0.10.0/pylegend/core/language/shared/operations/binary_expression.py +101 -0
  34. pylegend-0.10.0/pylegend/core/language/shared/operations/boolean_operation_expressions.py +124 -0
  35. pylegend-0.10.0/pylegend/core/language/shared/operations/collection_operation_expressions.py +633 -0
  36. pylegend-0.10.0/pylegend/core/language/shared/operations/date_operation_expressions.py +782 -0
  37. pylegend-0.10.0/pylegend/core/language/shared/operations/float_operation_expressions.py +184 -0
  38. pylegend-0.10.0/pylegend/core/language/shared/operations/integer_operation_expressions.py +255 -0
  39. pylegend-0.10.0/pylegend/core/language/shared/operations/nary_expression.py +104 -0
  40. pylegend-0.10.0/pylegend/core/language/shared/operations/nullary_expression.py +71 -0
  41. pylegend-0.10.0/pylegend/core/language/shared/operations/number_operation_expressions.py +1087 -0
  42. pylegend-0.10.0/pylegend/core/language/shared/operations/primitive_operation_expressions.py +177 -0
  43. pylegend-0.10.0/pylegend/core/language/shared/operations/string_operation_expressions.py +1176 -0
  44. pylegend-0.10.0/pylegend/core/language/shared/operations/unary_expression.py +87 -0
  45. pylegend-0.10.0/pylegend/core/language/shared/pct_helpers.py +56 -0
  46. pylegend-0.10.0/pylegend/core/language/shared/primitive_collection.py +338 -0
  47. pylegend-0.10.0/pylegend/core/language/shared/primitives/__init__.py +41 -0
  48. pylegend-0.10.0/pylegend/core/language/shared/primitives/boolean.py +90 -0
  49. pylegend-0.10.0/pylegend/core/language/shared/primitives/date.py +213 -0
  50. pylegend-0.10.0/pylegend/core/language/shared/primitives/datetime.py +75 -0
  51. pylegend-0.10.0/pylegend/core/language/shared/primitives/float.py +149 -0
  52. pylegend-0.10.0/pylegend/core/language/shared/primitives/integer.py +174 -0
  53. pylegend-0.10.0/pylegend/core/language/shared/primitives/number.py +344 -0
  54. pylegend-0.10.0/pylegend/core/language/shared/primitives/primitive.py +124 -0
  55. pylegend-0.10.0/pylegend/core/language/shared/primitives/strictdate.py +75 -0
  56. pylegend-0.10.0/pylegend/core/language/shared/primitives/string.py +304 -0
  57. pylegend-0.10.0/pylegend/core/language/shared/tds_row.py +215 -0
  58. pylegend-0.10.0/pylegend/core/project_cooridnates.py +125 -0
  59. pylegend-0.10.0/pylegend/core/request/__init__.py +36 -0
  60. pylegend-0.10.0/pylegend/core/request/auth.py +139 -0
  61. pylegend-0.10.0/pylegend/core/request/legend_client.py +117 -0
  62. pylegend-0.10.0/pylegend/core/request/response_reader.py +52 -0
  63. pylegend-0.10.0/pylegend/core/request/service_client.py +109 -0
  64. pylegend-0.10.0/pylegend/core/sql/__init__.py +13 -0
  65. pylegend-0.10.0/pylegend/core/sql/metamodel.py +929 -0
  66. pylegend-0.10.0/pylegend/core/sql/metamodel_extension.py +765 -0
  67. pylegend-0.10.0/pylegend/core/tds/__init__.py +13 -0
  68. pylegend-0.10.0/pylegend/core/tds/abstract/__init__.py +13 -0
  69. pylegend-0.10.0/pylegend/core/tds/abstract/frames/__init__.py +13 -0
  70. pylegend-0.10.0/pylegend/core/tds/abstract/frames/applied_function_tds_frame.py +81 -0
  71. pylegend-0.10.0/pylegend/core/tds/abstract/frames/base_tds_frame.py +125 -0
  72. pylegend-0.10.0/pylegend/core/tds/abstract/frames/input_tds_frame.py +52 -0
  73. pylegend-0.10.0/pylegend/core/tds/abstract/function_helpers.py +54 -0
  74. pylegend-0.10.0/pylegend/core/tds/legacy_api/__init__.py +13 -0
  75. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/__init__.py +13 -0
  76. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/__init__.py +13 -0
  77. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_concatenate_function.py +139 -0
  78. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_distinct_function.py +69 -0
  79. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_drop_function.py +74 -0
  80. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_extend_function.py +173 -0
  81. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_filter_function.py +121 -0
  82. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_group_by_function.py +236 -0
  83. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_head_function.py +74 -0
  84. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_join_by_columns_function.py +261 -0
  85. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_join_function.py +215 -0
  86. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_rename_columns_function.py +128 -0
  87. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_restrict_function.py +115 -0
  88. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_slice_function.py +82 -0
  89. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_sort_function.py +146 -0
  90. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/legacy_api_applied_function_tds_frame.py +37 -0
  91. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/legacy_api_base_tds_frame.py +204 -0
  92. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/legacy_api_input_tds_frame.py +51 -0
  93. pylegend-0.10.0/pylegend/core/tds/legacy_api/frames/legacy_api_tds_frame.py +136 -0
  94. pylegend-0.10.0/pylegend/core/tds/legendql_api/__init__.py +13 -0
  95. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/__init__.py +13 -0
  96. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/__init__.py +13 -0
  97. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_asofjoin_function.py +156 -0
  98. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_concatenate_function.py +139 -0
  99. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_distinct_function.py +69 -0
  100. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_drop_function.py +74 -0
  101. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_extend_function.py +256 -0
  102. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_filter_function.py +121 -0
  103. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_function_helpers.py +137 -0
  104. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_groupby_function.py +256 -0
  105. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_head_function.py +74 -0
  106. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_join_function.py +214 -0
  107. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_project_function.py +169 -0
  108. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_rename_function.py +189 -0
  109. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_select_function.py +131 -0
  110. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_slice_function.py +82 -0
  111. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_sort_function.py +93 -0
  112. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_window_extend_function.py +283 -0
  113. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/legendql_api_applied_function_tds_frame.py +37 -0
  114. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/legendql_api_base_tds_frame.py +419 -0
  115. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/legendql_api_input_tds_frame.py +50 -0
  116. pylegend-0.10.0/pylegend/core/tds/legendql_api/frames/legendql_api_tds_frame.py +327 -0
  117. pylegend-0.10.0/pylegend/core/tds/pandas_api/__init__.py +13 -0
  118. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/__init__.py +13 -0
  119. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/functions/__init__.py +13 -0
  120. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/functions/aggregate_function.py +316 -0
  121. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/functions/assign_function.py +123 -0
  122. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/functions/drop.py +171 -0
  123. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/functions/filter.py +193 -0
  124. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/functions/filtering.py +85 -0
  125. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/functions/sort_values_function.py +189 -0
  126. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/functions/truncate_function.py +120 -0
  127. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/pandas_api_applied_function_tds_frame.py +83 -0
  128. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/pandas_api_base_tds_frame.py +348 -0
  129. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/pandas_api_input_tds_frame.py +57 -0
  130. pylegend-0.10.0/pylegend/core/tds/pandas_api/frames/pandas_api_tds_frame.py +130 -0
  131. pylegend-0.10.0/pylegend/core/tds/result_handler/__init__.py +28 -0
  132. pylegend-0.10.0/pylegend/core/tds/result_handler/result_handler.py +37 -0
  133. pylegend-0.10.0/pylegend/core/tds/result_handler/to_csv_file_result_handler.py +57 -0
  134. pylegend-0.10.0/pylegend/core/tds/result_handler/to_json_file_result_handler.py +40 -0
  135. pylegend-0.10.0/pylegend/core/tds/result_handler/to_string_result_handler.py +31 -0
  136. pylegend-0.10.0/pylegend/core/tds/sql_query_helpers.py +116 -0
  137. pylegend-0.10.0/pylegend/core/tds/tds_column.py +171 -0
  138. pylegend-0.10.0/pylegend/core/tds/tds_frame.py +123 -0
  139. pylegend-0.10.0/pylegend/extensions/__init__.py +13 -0
  140. pylegend-0.10.0/pylegend/extensions/database/__init__.py +13 -0
  141. pylegend-0.10.0/pylegend/extensions/database/vendors/__init__.py +13 -0
  142. pylegend-0.10.0/pylegend/extensions/database/vendors/postgres/__init__.py +13 -0
  143. pylegend-0.10.0/pylegend/extensions/database/vendors/postgres/postgres_sql_to_string.py +43 -0
  144. pylegend-0.10.0/pylegend/extensions/tds/__init__.py +13 -0
  145. pylegend-0.10.0/pylegend/extensions/tds/abstract/__init__.py +13 -0
  146. pylegend-0.10.0/pylegend/extensions/tds/abstract/legend_function_input_frame.py +112 -0
  147. pylegend-0.10.0/pylegend/extensions/tds/abstract/legend_service_input_frame.py +112 -0
  148. pylegend-0.10.0/pylegend/extensions/tds/abstract/table_spec_input_frame.py +74 -0
  149. pylegend-0.10.0/pylegend/extensions/tds/legacy_api/__init__.py +13 -0
  150. pylegend-0.10.0/pylegend/extensions/tds/legacy_api/frames/__init__.py +13 -0
  151. pylegend-0.10.0/pylegend/extensions/tds/legacy_api/frames/legacy_api_legend_function_input_frame.py +46 -0
  152. pylegend-0.10.0/pylegend/extensions/tds/legacy_api/frames/legacy_api_legend_service_input_frame.py +46 -0
  153. pylegend-0.10.0/pylegend/extensions/tds/legacy_api/frames/legacy_api_table_spec_input_frame.py +36 -0
  154. pylegend-0.10.0/pylegend/extensions/tds/legendql_api/__init__.py +13 -0
  155. pylegend-0.10.0/pylegend/extensions/tds/legendql_api/frames/__init__.py +13 -0
  156. pylegend-0.10.0/pylegend/extensions/tds/legendql_api/frames/legendql_api_legend_function_input_frame.py +46 -0
  157. pylegend-0.10.0/pylegend/extensions/tds/legendql_api/frames/legendql_api_legend_service_input_frame.py +46 -0
  158. pylegend-0.10.0/pylegend/extensions/tds/legendql_api/frames/legendql_api_table_spec_input_frame.py +36 -0
  159. pylegend-0.10.0/pylegend/extensions/tds/pandas_api/__init__.py +13 -0
  160. pylegend-0.10.0/pylegend/extensions/tds/pandas_api/frames/__init__.py +13 -0
  161. pylegend-0.10.0/pylegend/extensions/tds/pandas_api/frames/pandas_api_legend_function_input_frame.py +46 -0
  162. pylegend-0.10.0/pylegend/extensions/tds/pandas_api/frames/pandas_api_legend_service_input_frame.py +46 -0
  163. pylegend-0.10.0/pylegend/extensions/tds/pandas_api/frames/pandas_api_table_spec_input_frame.py +36 -0
  164. pylegend-0.10.0/pylegend/extensions/tds/result_handler/__init__.py +26 -0
  165. pylegend-0.10.0/pylegend/extensions/tds/result_handler/to_pandas_df_result_handler.py +145 -0
  166. pylegend-0.10.0/pylegend/legacy_api_tds_client.py +73 -0
  167. pylegend-0.10.0/pylegend/legendql_api_tds_client.py +73 -0
  168. pylegend-0.10.0/pylegend/utils/__init__.py +13 -0
  169. pylegend-0.10.0/pylegend/utils/class_utils.py +29 -0
  170. pylegend-0.10.0/pyproject.toml +46 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2023 Goldman Sachs
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,7 @@
1
+ SPDXVersion: SPDX-2.0
2
+ DataLicense: CC0-1.0
3
+ Creator: Goldman Sachs
4
+ PackageName: pylegend
5
+ PackageOriginator: Goldman Sachs
6
+ PackageHomePage: https://github.com/finos/pylegend
7
+ PackageLicenseDeclared: Apache-2.0
pylegend-0.10.0/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ pylegend - FINOS
2
+ Copyright 2023 Goldman Sachs - info@gs.com
3
+
4
+ This product includes software developed at the Fintech Open Source Foundation (https://www.finos.org/).
5
+
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.4
2
+ Name: pylegend
3
+ Version: 0.10.0
4
+ Summary: Python language binding for Legend data management platform
5
+ License: Apache-2.0
6
+ License-File: LICENSE
7
+ License-File: LICENSE.spdx
8
+ License-File: NOTICE
9
+ Author: PyLegend Maintainers
10
+ Author-email: legend@finos.org
11
+ Requires-Python: >=3.9,<3.14
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Dist: ijson (>=3.1.4)
20
+ Requires-Dist: numpy (>=1.20.0) ; python_version < "3.12"
21
+ Requires-Dist: numpy (>=1.26.0) ; python_version >= "3.12"
22
+ Requires-Dist: pandas (>=1.0.0) ; python_version < "3.12"
23
+ Requires-Dist: pandas (>=2.1.1) ; python_version >= "3.12"
24
+ Requires-Dist: requests (>=2.27.1)
25
+ Project-URL: Repository, https://github.com/finos/pylegend
26
+ Description-Content-Type: text/markdown
27
+
28
+ [![FINOS - Incubating](https://cdn.jsdelivr.net/gh/finos/contrib-toolbox@master/images/badge-incubating.svg)](https://community.finos.org/docs/governance/Software-Projects/stages/incubating)
29
+ [![pypi](https://img.shields.io/pypi/v/pylegend.svg)](https://pypi.org/project/pylegend/)
30
+ [![python](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)](https://www.python.org/downloads)
31
+ ![CI Testing](https://img.shields.io/badge/CI%20Testing-Linux%20%7C%20%20Windows%20-orange)
32
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
33
+ ![Build](https://github.com/finos/pylegend/workflows/Build%20CI/badge.svg)
34
+ ![CVE Scan](https://github.com/finos/pylegend/workflows/CVE%20Scan/badge.svg)
35
+ ![License Scan](https://github.com/finos/pylegend/workflows/License%20Scan/badge.svg)
36
+ [![Codecov](https://codecov.io/gh/finos/pylegend/branch/main/graph/badge.svg)](https://app.codecov.io/gh/finos/pylegend)
37
+
38
+ # PyLegend
39
+
40
+ <b> -- Library is under active development -- </b>
41
+
42
+ PyLegend is part of [Legend](https://github.com/finos/legend) data management platform suite. It is a python client library which enables easy and streamlined integration of python clients with Legend ecosystem, providing interactive query building and push-down execution capabilities.
43
+
44
+ ## Build from source
45
+
46
+ PyLegend requires Python 3.9 or higher. We use [Poetry](https://python-poetry.org/) tool for dependency management and packaging. To install poetry, follow instructions [here](https://python-poetry.org/docs/#installation).
47
+
48
+ Run `poetry install` to install dependencies. If you intend to contribute, install dev dependencies using the command `poetry install --with dev`.
49
+
50
+ ## Contributing
51
+ For any questions, bugs or feature requests please open an [issue](https://github.com/finos/pylegend/issues).
52
+
53
+ To submit a contribution:
54
+ 1. Fork it (<https://github.com/finos/pylegend/fork>)
55
+ 2. Create your feature branch (`git checkout -b feature/fooBar`)
56
+ 3. Read our [contribution guidelines](./CONTRIBUTING.md) and [Community Code of Conduct](https://www.finos.org/code-of-conduct)
57
+ 4. Commit your changes (`git commit -am 'Add some fooBar'`)
58
+ 5. Push to the branch (`git push origin feature/fooBar`)
59
+ 6. Create a new Pull Request
60
+
61
+ _NOTE:_ Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR who are covered under an existing and active Corporate Contribution License Agreement (CCLA) executed with FINOS. Commits from individuals not covered under an ICLA or CCLA will be flagged and blocked by the FINOS Clabot tool (or [EasyCLA](https://community.finos.org/docs/governance/Software-Projects/easycla)). Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA.
62
+
63
+ *Need an ICLA? Unsure if you are covered under an existing CCLA? Email [help@finos.org](mailto:help@finos.org)*
64
+
65
+ ## License
66
+
67
+ Copyright 2023 Goldman Sachs
68
+
69
+ Distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
70
+
71
+ SPDX-License-Identifier: [Apache-2.0](https://spdx.org/licenses/Apache-2.0)
72
+
@@ -0,0 +1,44 @@
1
+ [![FINOS - Incubating](https://cdn.jsdelivr.net/gh/finos/contrib-toolbox@master/images/badge-incubating.svg)](https://community.finos.org/docs/governance/Software-Projects/stages/incubating)
2
+ [![pypi](https://img.shields.io/pypi/v/pylegend.svg)](https://pypi.org/project/pylegend/)
3
+ [![python](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)](https://www.python.org/downloads)
4
+ ![CI Testing](https://img.shields.io/badge/CI%20Testing-Linux%20%7C%20%20Windows%20-orange)
5
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
+ ![Build](https://github.com/finos/pylegend/workflows/Build%20CI/badge.svg)
7
+ ![CVE Scan](https://github.com/finos/pylegend/workflows/CVE%20Scan/badge.svg)
8
+ ![License Scan](https://github.com/finos/pylegend/workflows/License%20Scan/badge.svg)
9
+ [![Codecov](https://codecov.io/gh/finos/pylegend/branch/main/graph/badge.svg)](https://app.codecov.io/gh/finos/pylegend)
10
+
11
+ # PyLegend
12
+
13
+ <b> -- Library is under active development -- </b>
14
+
15
+ PyLegend is part of [Legend](https://github.com/finos/legend) data management platform suite. It is a python client library which enables easy and streamlined integration of python clients with Legend ecosystem, providing interactive query building and push-down execution capabilities.
16
+
17
+ ## Build from source
18
+
19
+ PyLegend requires Python 3.9 or higher. We use [Poetry](https://python-poetry.org/) tool for dependency management and packaging. To install poetry, follow instructions [here](https://python-poetry.org/docs/#installation).
20
+
21
+ Run `poetry install` to install dependencies. If you intend to contribute, install dev dependencies using the command `poetry install --with dev`.
22
+
23
+ ## Contributing
24
+ For any questions, bugs or feature requests please open an [issue](https://github.com/finos/pylegend/issues).
25
+
26
+ To submit a contribution:
27
+ 1. Fork it (<https://github.com/finos/pylegend/fork>)
28
+ 2. Create your feature branch (`git checkout -b feature/fooBar`)
29
+ 3. Read our [contribution guidelines](./CONTRIBUTING.md) and [Community Code of Conduct](https://www.finos.org/code-of-conduct)
30
+ 4. Commit your changes (`git commit -am 'Add some fooBar'`)
31
+ 5. Push to the branch (`git push origin feature/fooBar`)
32
+ 6. Create a new Pull Request
33
+
34
+ _NOTE:_ Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR who are covered under an existing and active Corporate Contribution License Agreement (CCLA) executed with FINOS. Commits from individuals not covered under an ICLA or CCLA will be flagged and blocked by the FINOS Clabot tool (or [EasyCLA](https://community.finos.org/docs/governance/Software-Projects/easycla)). Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA.
35
+
36
+ *Need an ICLA? Unsure if you are covered under an existing CCLA? Email [help@finos.org](mailto:help@finos.org)*
37
+
38
+ ## License
39
+
40
+ Copyright 2023 Goldman Sachs
41
+
42
+ Distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
43
+
44
+ SPDX-License-Identifier: [Apache-2.0](https://spdx.org/licenses/Apache-2.0)
@@ -0,0 +1,76 @@
1
+ # Copyright 2023 Goldman Sachs
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
+ from pylegend._typing import (
16
+ PyLegendSequence,
17
+ )
18
+ from pylegend.legacy_api_tds_client import (
19
+ LegacyApiTdsClient,
20
+ legacy_api_tds_client,
21
+ )
22
+ from pylegend.legendql_api_tds_client import (
23
+ LegendQLApiTdsClient,
24
+ legendql_api_tds_client,
25
+ )
26
+ from pylegend.core.request import (
27
+ LegendClient,
28
+ AuthScheme,
29
+ LocalhostEmptyAuthScheme,
30
+ HeaderTokenAuthScheme,
31
+ CookieAuthScheme,
32
+ ResponseReader,
33
+ )
34
+ from pylegend.core.project_cooridnates import (
35
+ VersionedProjectCoordinates,
36
+ PersonalWorkspaceProjectCoordinates,
37
+ GroupWorkspaceProjectCoordinates,
38
+ )
39
+ from pylegend.core.language import (
40
+ agg,
41
+ now,
42
+ today,
43
+ current_user,
44
+ )
45
+
46
+
47
+ __all__: PyLegendSequence[str] = [
48
+ "__version__",
49
+
50
+ "LegendQLApiTdsClient",
51
+ "legendql_api_tds_client",
52
+
53
+ "LegacyApiTdsClient",
54
+ "legacy_api_tds_client",
55
+
56
+ "LegendClient",
57
+ "AuthScheme",
58
+ "LocalhostEmptyAuthScheme",
59
+ "HeaderTokenAuthScheme",
60
+ "CookieAuthScheme",
61
+ "ResponseReader",
62
+
63
+ "VersionedProjectCoordinates",
64
+ "PersonalWorkspaceProjectCoordinates",
65
+ "GroupWorkspaceProjectCoordinates",
66
+
67
+ "agg",
68
+ "now",
69
+ "today",
70
+ "current_user",
71
+ ]
72
+
73
+
74
+ import importlib.metadata
75
+
76
+ __version__ = importlib.metadata.version("pylegend")
@@ -0,0 +1,50 @@
1
+ # Copyright 2023 Goldman Sachs
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
+ from typing import Callable as PyLegendCallable
16
+ from typing import Dict as PyLegendDict
17
+ from typing import Iterator as PyLegendIterator
18
+ from typing import List as PyLegendList
19
+ from typing import Set as PyLegendSet
20
+ from typing import Optional as PyLegendOptional
21
+ from typing import Sequence as PyLegendSequence
22
+ from typing import Type as PyLegendType
23
+ from typing import TypeVar as PyLegendTypeVar
24
+ from typing import Tuple as PyLegendTuple
25
+ from typing import Generator as PyLegendGenerator
26
+ from typing import Union as PyLegendUnion
27
+ from typing import Generic as PyLegendGeneric
28
+ from typing import Hashable as PyLegendHashable
29
+ from typing import Mapping as PyLegendMapping
30
+ from typing import TYPE_CHECKING
31
+
32
+
33
+ __all__: PyLegendSequence[str] = [
34
+ "PyLegendCallable",
35
+ "PyLegendDict",
36
+ "PyLegendIterator",
37
+ "PyLegendList",
38
+ "PyLegendSet",
39
+ "PyLegendSequence",
40
+ "PyLegendType",
41
+ "PyLegendTypeVar",
42
+ "PyLegendOptional",
43
+ "PyLegendTuple",
44
+ "PyLegendGenerator",
45
+ "PyLegendUnion",
46
+ "PyLegendGeneric",
47
+ "PyLegendMapping",
48
+ "PyLegendHashable",
49
+ "TYPE_CHECKING",
50
+ ]
@@ -0,0 +1,13 @@
1
+ # Copyright 2023 Goldman Sachs
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.
@@ -0,0 +1,13 @@
1
+ # Copyright 2023 Goldman Sachs
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.
@@ -0,0 +1,25 @@
1
+ # Copyright 2023 Goldman Sachs
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
+ from pylegend._typing import PyLegendSequence
16
+ from pylegend.core.database.sql_to_string.generator import SqlToStringGenerator
17
+ from pylegend.core.database.sql_to_string.config import SqlToStringConfig, SqlToStringFormat
18
+ from pylegend.core.database.sql_to_string.db_extension import SqlToStringDbExtension
19
+
20
+ __all__: PyLegendSequence[str] = [
21
+ "SqlToStringGenerator",
22
+ "SqlToStringConfig",
23
+ "SqlToStringFormat",
24
+ "SqlToStringDbExtension"
25
+ ]
@@ -0,0 +1,44 @@
1
+ # Copyright 2023 Goldman Sachs
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
+
16
+ class SqlToStringFormat:
17
+ pretty: bool
18
+ indent_count: int
19
+
20
+ def __init__(self, pretty: bool = True, indent_count: int = 0) -> None:
21
+ self.pretty = pretty
22
+ self.indent_count = indent_count
23
+
24
+ def push_indent(self) -> "SqlToStringFormat":
25
+ return SqlToStringFormat(self.pretty, self.indent_count + 1)
26
+
27
+ def separator(self, cnt: int = 0) -> str:
28
+ if self.pretty:
29
+ return "\n" + "".join([" " for _ in range(self.indent_count + cnt)])
30
+ else:
31
+ return " "
32
+
33
+
34
+ class SqlToStringConfig:
35
+ format: SqlToStringFormat
36
+
37
+ def __init__(
38
+ self,
39
+ format_: SqlToStringFormat
40
+ ) -> None:
41
+ self.format = format_
42
+
43
+ def push_indent(self) -> "SqlToStringConfig":
44
+ return SqlToStringConfig(self.format.push_indent())