pyswordfish 3.0.4.0__cp312-cp312-win_amd64.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 (644) hide show
  1. pyswordfish-3.0.4.0.dist-info/METADATA +53 -0
  2. pyswordfish-3.0.4.0.dist-info/RECORD +644 -0
  3. pyswordfish-3.0.4.0.dist-info/WHEEL +5 -0
  4. pyswordfish-3.0.4.0.dist-info/top_level.txt +1 -0
  5. swordfish/__init__.py +102 -0
  6. swordfish/_config.py +901 -0
  7. swordfish/_connection.py +1418 -0
  8. swordfish/_core.py +17 -0
  9. swordfish/_engine.py +1456 -0
  10. swordfish/_enums.py +142 -0
  11. swordfish/_function_bindings.py +23594 -0
  12. swordfish/_function_tools.py +124 -0
  13. swordfish/_helper.py +57 -0
  14. swordfish/_runtime.py +158 -0
  15. swordfish/_sqlbuilder.py +549 -0
  16. swordfish/_streaming.py +333 -0
  17. swordfish/_swordfishcpp.cp312-win_amd64.pyd +0 -0
  18. swordfish/_swordfishcpp.pyi +4784 -0
  19. swordfish/_translator.py +580 -0
  20. swordfish/asset/dolphindb.dos +71 -0
  21. swordfish/asset/tzdb/Africa/Abidjan +0 -0
  22. swordfish/asset/tzdb/Africa/Accra +0 -0
  23. swordfish/asset/tzdb/Africa/Addis_Ababa +0 -0
  24. swordfish/asset/tzdb/Africa/Algiers +0 -0
  25. swordfish/asset/tzdb/Africa/Asmara +0 -0
  26. swordfish/asset/tzdb/Africa/Asmera +0 -0
  27. swordfish/asset/tzdb/Africa/Bamako +0 -0
  28. swordfish/asset/tzdb/Africa/Bangui +0 -0
  29. swordfish/asset/tzdb/Africa/Banjul +0 -0
  30. swordfish/asset/tzdb/Africa/Bissau +0 -0
  31. swordfish/asset/tzdb/Africa/Blantyre +0 -0
  32. swordfish/asset/tzdb/Africa/Brazzaville +0 -0
  33. swordfish/asset/tzdb/Africa/Bujumbura +0 -0
  34. swordfish/asset/tzdb/Africa/Cairo +0 -0
  35. swordfish/asset/tzdb/Africa/Casablanca +0 -0
  36. swordfish/asset/tzdb/Africa/Ceuta +0 -0
  37. swordfish/asset/tzdb/Africa/Conakry +0 -0
  38. swordfish/asset/tzdb/Africa/Dakar +0 -0
  39. swordfish/asset/tzdb/Africa/Dar_es_Salaam +0 -0
  40. swordfish/asset/tzdb/Africa/Djibouti +0 -0
  41. swordfish/asset/tzdb/Africa/Douala +0 -0
  42. swordfish/asset/tzdb/Africa/El_Aaiun +0 -0
  43. swordfish/asset/tzdb/Africa/Freetown +0 -0
  44. swordfish/asset/tzdb/Africa/Gaborone +0 -0
  45. swordfish/asset/tzdb/Africa/Harare +0 -0
  46. swordfish/asset/tzdb/Africa/Johannesburg +0 -0
  47. swordfish/asset/tzdb/Africa/Juba +0 -0
  48. swordfish/asset/tzdb/Africa/Kampala +0 -0
  49. swordfish/asset/tzdb/Africa/Khartoum +0 -0
  50. swordfish/asset/tzdb/Africa/Kigali +0 -0
  51. swordfish/asset/tzdb/Africa/Kinshasa +0 -0
  52. swordfish/asset/tzdb/Africa/Lagos +0 -0
  53. swordfish/asset/tzdb/Africa/Libreville +0 -0
  54. swordfish/asset/tzdb/Africa/Lome +0 -0
  55. swordfish/asset/tzdb/Africa/Luanda +0 -0
  56. swordfish/asset/tzdb/Africa/Lubumbashi +0 -0
  57. swordfish/asset/tzdb/Africa/Lusaka +0 -0
  58. swordfish/asset/tzdb/Africa/Malabo +0 -0
  59. swordfish/asset/tzdb/Africa/Maputo +0 -0
  60. swordfish/asset/tzdb/Africa/Maseru +0 -0
  61. swordfish/asset/tzdb/Africa/Mbabane +0 -0
  62. swordfish/asset/tzdb/Africa/Mogadishu +0 -0
  63. swordfish/asset/tzdb/Africa/Monrovia +0 -0
  64. swordfish/asset/tzdb/Africa/Nairobi +0 -0
  65. swordfish/asset/tzdb/Africa/Ndjamena +0 -0
  66. swordfish/asset/tzdb/Africa/Niamey +0 -0
  67. swordfish/asset/tzdb/Africa/Nouakchott +0 -0
  68. swordfish/asset/tzdb/Africa/Ouagadougou +0 -0
  69. swordfish/asset/tzdb/Africa/Porto-Novo +0 -0
  70. swordfish/asset/tzdb/Africa/Sao_Tome +0 -0
  71. swordfish/asset/tzdb/Africa/Timbuktu +0 -0
  72. swordfish/asset/tzdb/Africa/Tripoli +0 -0
  73. swordfish/asset/tzdb/Africa/Tunis +0 -0
  74. swordfish/asset/tzdb/Africa/Windhoek +0 -0
  75. swordfish/asset/tzdb/America/Adak +0 -0
  76. swordfish/asset/tzdb/America/Anchorage +0 -0
  77. swordfish/asset/tzdb/America/Anguilla +0 -0
  78. swordfish/asset/tzdb/America/Antigua +0 -0
  79. swordfish/asset/tzdb/America/Araguaina +0 -0
  80. swordfish/asset/tzdb/America/Argentina/Buenos_Aires +0 -0
  81. swordfish/asset/tzdb/America/Argentina/Catamarca +0 -0
  82. swordfish/asset/tzdb/America/Argentina/ComodRivadavia +0 -0
  83. swordfish/asset/tzdb/America/Argentina/Cordoba +0 -0
  84. swordfish/asset/tzdb/America/Argentina/Jujuy +0 -0
  85. swordfish/asset/tzdb/America/Argentina/La_Rioja +0 -0
  86. swordfish/asset/tzdb/America/Argentina/Mendoza +0 -0
  87. swordfish/asset/tzdb/America/Argentina/Rio_Gallegos +0 -0
  88. swordfish/asset/tzdb/America/Argentina/Salta +0 -0
  89. swordfish/asset/tzdb/America/Argentina/San_Juan +0 -0
  90. swordfish/asset/tzdb/America/Argentina/San_Luis +0 -0
  91. swordfish/asset/tzdb/America/Argentina/Tucuman +0 -0
  92. swordfish/asset/tzdb/America/Argentina/Ushuaia +0 -0
  93. swordfish/asset/tzdb/America/Aruba +0 -0
  94. swordfish/asset/tzdb/America/Asuncion +0 -0
  95. swordfish/asset/tzdb/America/Atikokan +0 -0
  96. swordfish/asset/tzdb/America/Atka +0 -0
  97. swordfish/asset/tzdb/America/Bahia +0 -0
  98. swordfish/asset/tzdb/America/Bahia_Banderas +0 -0
  99. swordfish/asset/tzdb/America/Barbados +0 -0
  100. swordfish/asset/tzdb/America/Belem +0 -0
  101. swordfish/asset/tzdb/America/Belize +0 -0
  102. swordfish/asset/tzdb/America/Blanc-Sablon +0 -0
  103. swordfish/asset/tzdb/America/Boa_Vista +0 -0
  104. swordfish/asset/tzdb/America/Bogota +0 -0
  105. swordfish/asset/tzdb/America/Boise +0 -0
  106. swordfish/asset/tzdb/America/Buenos_Aires +0 -0
  107. swordfish/asset/tzdb/America/Cambridge_Bay +0 -0
  108. swordfish/asset/tzdb/America/Campo_Grande +0 -0
  109. swordfish/asset/tzdb/America/Cancun +0 -0
  110. swordfish/asset/tzdb/America/Caracas +0 -0
  111. swordfish/asset/tzdb/America/Catamarca +0 -0
  112. swordfish/asset/tzdb/America/Cayenne +0 -0
  113. swordfish/asset/tzdb/America/Cayman +0 -0
  114. swordfish/asset/tzdb/America/Chicago +0 -0
  115. swordfish/asset/tzdb/America/Chihuahua +0 -0
  116. swordfish/asset/tzdb/America/Coral_Harbour +0 -0
  117. swordfish/asset/tzdb/America/Cordoba +0 -0
  118. swordfish/asset/tzdb/America/Costa_Rica +0 -0
  119. swordfish/asset/tzdb/America/Creston +0 -0
  120. swordfish/asset/tzdb/America/Cuiaba +0 -0
  121. swordfish/asset/tzdb/America/Curacao +0 -0
  122. swordfish/asset/tzdb/America/Danmarkshavn +0 -0
  123. swordfish/asset/tzdb/America/Dawson +0 -0
  124. swordfish/asset/tzdb/America/Dawson_Creek +0 -0
  125. swordfish/asset/tzdb/America/Denver +0 -0
  126. swordfish/asset/tzdb/America/Detroit +0 -0
  127. swordfish/asset/tzdb/America/Dominica +0 -0
  128. swordfish/asset/tzdb/America/Edmonton +0 -0
  129. swordfish/asset/tzdb/America/Eirunepe +0 -0
  130. swordfish/asset/tzdb/America/El_Salvador +0 -0
  131. swordfish/asset/tzdb/America/Ensenada +0 -0
  132. swordfish/asset/tzdb/America/Fort_Nelson +0 -0
  133. swordfish/asset/tzdb/America/Fort_Wayne +0 -0
  134. swordfish/asset/tzdb/America/Fortaleza +0 -0
  135. swordfish/asset/tzdb/America/Glace_Bay +0 -0
  136. swordfish/asset/tzdb/America/Godthab +0 -0
  137. swordfish/asset/tzdb/America/Goose_Bay +0 -0
  138. swordfish/asset/tzdb/America/Grand_Turk +0 -0
  139. swordfish/asset/tzdb/America/Grenada +0 -0
  140. swordfish/asset/tzdb/America/Guadeloupe +0 -0
  141. swordfish/asset/tzdb/America/Guatemala +0 -0
  142. swordfish/asset/tzdb/America/Guayaquil +0 -0
  143. swordfish/asset/tzdb/America/Guyana +0 -0
  144. swordfish/asset/tzdb/America/Halifax +0 -0
  145. swordfish/asset/tzdb/America/Havana +0 -0
  146. swordfish/asset/tzdb/America/Hermosillo +0 -0
  147. swordfish/asset/tzdb/America/Indiana/Indianapolis +0 -0
  148. swordfish/asset/tzdb/America/Indiana/Knox +0 -0
  149. swordfish/asset/tzdb/America/Indiana/Marengo +0 -0
  150. swordfish/asset/tzdb/America/Indiana/Petersburg +0 -0
  151. swordfish/asset/tzdb/America/Indiana/Tell_City +0 -0
  152. swordfish/asset/tzdb/America/Indiana/Vevay +0 -0
  153. swordfish/asset/tzdb/America/Indiana/Vincennes +0 -0
  154. swordfish/asset/tzdb/America/Indiana/Winamac +0 -0
  155. swordfish/asset/tzdb/America/Indianapolis +0 -0
  156. swordfish/asset/tzdb/America/Inuvik +0 -0
  157. swordfish/asset/tzdb/America/Iqaluit +0 -0
  158. swordfish/asset/tzdb/America/Jamaica +0 -0
  159. swordfish/asset/tzdb/America/Jujuy +0 -0
  160. swordfish/asset/tzdb/America/Juneau +0 -0
  161. swordfish/asset/tzdb/America/Kentucky/Louisville +0 -0
  162. swordfish/asset/tzdb/America/Kentucky/Monticello +0 -0
  163. swordfish/asset/tzdb/America/Knox_IN +0 -0
  164. swordfish/asset/tzdb/America/Kralendijk +0 -0
  165. swordfish/asset/tzdb/America/La_Paz +0 -0
  166. swordfish/asset/tzdb/America/Lima +0 -0
  167. swordfish/asset/tzdb/America/Los_Angeles +0 -0
  168. swordfish/asset/tzdb/America/Louisville +0 -0
  169. swordfish/asset/tzdb/America/Lower_Princes +0 -0
  170. swordfish/asset/tzdb/America/Maceio +0 -0
  171. swordfish/asset/tzdb/America/Managua +0 -0
  172. swordfish/asset/tzdb/America/Manaus +0 -0
  173. swordfish/asset/tzdb/America/Marigot +0 -0
  174. swordfish/asset/tzdb/America/Martinique +0 -0
  175. swordfish/asset/tzdb/America/Matamoros +0 -0
  176. swordfish/asset/tzdb/America/Mazatlan +0 -0
  177. swordfish/asset/tzdb/America/Mendoza +0 -0
  178. swordfish/asset/tzdb/America/Menominee +0 -0
  179. swordfish/asset/tzdb/America/Merida +0 -0
  180. swordfish/asset/tzdb/America/Metlakatla +0 -0
  181. swordfish/asset/tzdb/America/Mexico_City +0 -0
  182. swordfish/asset/tzdb/America/Miquelon +0 -0
  183. swordfish/asset/tzdb/America/Moncton +0 -0
  184. swordfish/asset/tzdb/America/Monterrey +0 -0
  185. swordfish/asset/tzdb/America/Montevideo +0 -0
  186. swordfish/asset/tzdb/America/Montreal +0 -0
  187. swordfish/asset/tzdb/America/Montserrat +0 -0
  188. swordfish/asset/tzdb/America/Nassau +0 -0
  189. swordfish/asset/tzdb/America/New_York +0 -0
  190. swordfish/asset/tzdb/America/Nipigon +0 -0
  191. swordfish/asset/tzdb/America/Nome +0 -0
  192. swordfish/asset/tzdb/America/Noronha +0 -0
  193. swordfish/asset/tzdb/America/North_Dakota/Beulah +0 -0
  194. swordfish/asset/tzdb/America/North_Dakota/Center +0 -0
  195. swordfish/asset/tzdb/America/North_Dakota/New_Salem +0 -0
  196. swordfish/asset/tzdb/America/Ojinaga +0 -0
  197. swordfish/asset/tzdb/America/Panama +0 -0
  198. swordfish/asset/tzdb/America/Pangnirtung +0 -0
  199. swordfish/asset/tzdb/America/Paramaribo +0 -0
  200. swordfish/asset/tzdb/America/Phoenix +0 -0
  201. swordfish/asset/tzdb/America/Port-au-Prince +0 -0
  202. swordfish/asset/tzdb/America/Port_of_Spain +0 -0
  203. swordfish/asset/tzdb/America/Porto_Acre +0 -0
  204. swordfish/asset/tzdb/America/Porto_Velho +0 -0
  205. swordfish/asset/tzdb/America/Puerto_Rico +0 -0
  206. swordfish/asset/tzdb/America/Punta_Arenas +0 -0
  207. swordfish/asset/tzdb/America/Rainy_River +0 -0
  208. swordfish/asset/tzdb/America/Rankin_Inlet +0 -0
  209. swordfish/asset/tzdb/America/Recife +0 -0
  210. swordfish/asset/tzdb/America/Regina +0 -0
  211. swordfish/asset/tzdb/America/Resolute +0 -0
  212. swordfish/asset/tzdb/America/Rio_Branco +0 -0
  213. swordfish/asset/tzdb/America/Rosario +0 -0
  214. swordfish/asset/tzdb/America/Santa_Isabel +0 -0
  215. swordfish/asset/tzdb/America/Santarem +0 -0
  216. swordfish/asset/tzdb/America/Santiago +0 -0
  217. swordfish/asset/tzdb/America/Santo_Domingo +0 -0
  218. swordfish/asset/tzdb/America/Sao_Paulo +0 -0
  219. swordfish/asset/tzdb/America/Scoresbysund +0 -0
  220. swordfish/asset/tzdb/America/Shiprock +0 -0
  221. swordfish/asset/tzdb/America/Sitka +0 -0
  222. swordfish/asset/tzdb/America/St_Barthelemy +0 -0
  223. swordfish/asset/tzdb/America/St_Johns +0 -0
  224. swordfish/asset/tzdb/America/St_Kitts +0 -0
  225. swordfish/asset/tzdb/America/St_Lucia +0 -0
  226. swordfish/asset/tzdb/America/St_Thomas +0 -0
  227. swordfish/asset/tzdb/America/St_Vincent +0 -0
  228. swordfish/asset/tzdb/America/Swift_Current +0 -0
  229. swordfish/asset/tzdb/America/Tegucigalpa +0 -0
  230. swordfish/asset/tzdb/America/Thule +0 -0
  231. swordfish/asset/tzdb/America/Thunder_Bay +0 -0
  232. swordfish/asset/tzdb/America/Tijuana +0 -0
  233. swordfish/asset/tzdb/America/Toronto +0 -0
  234. swordfish/asset/tzdb/America/Tortola +0 -0
  235. swordfish/asset/tzdb/America/Vancouver +0 -0
  236. swordfish/asset/tzdb/America/Virgin +0 -0
  237. swordfish/asset/tzdb/America/Whitehorse +0 -0
  238. swordfish/asset/tzdb/America/Winnipeg +0 -0
  239. swordfish/asset/tzdb/America/Yakutat +0 -0
  240. swordfish/asset/tzdb/America/Yellowknife +0 -0
  241. swordfish/asset/tzdb/Antarctica/Casey +0 -0
  242. swordfish/asset/tzdb/Antarctica/Davis +0 -0
  243. swordfish/asset/tzdb/Antarctica/DumontDUrville +0 -0
  244. swordfish/asset/tzdb/Antarctica/Macquarie +0 -0
  245. swordfish/asset/tzdb/Antarctica/Mawson +0 -0
  246. swordfish/asset/tzdb/Antarctica/McMurdo +0 -0
  247. swordfish/asset/tzdb/Antarctica/Palmer +0 -0
  248. swordfish/asset/tzdb/Antarctica/Rothera +0 -0
  249. swordfish/asset/tzdb/Antarctica/South_Pole +0 -0
  250. swordfish/asset/tzdb/Antarctica/Syowa +0 -0
  251. swordfish/asset/tzdb/Antarctica/Troll +0 -0
  252. swordfish/asset/tzdb/Antarctica/Vostok +0 -0
  253. swordfish/asset/tzdb/Arctic/Longyearbyen +0 -0
  254. swordfish/asset/tzdb/Asia/Aden +0 -0
  255. swordfish/asset/tzdb/Asia/Almaty +0 -0
  256. swordfish/asset/tzdb/Asia/Amman +0 -0
  257. swordfish/asset/tzdb/Asia/Anadyr +0 -0
  258. swordfish/asset/tzdb/Asia/Aqtau +0 -0
  259. swordfish/asset/tzdb/Asia/Aqtobe +0 -0
  260. swordfish/asset/tzdb/Asia/Ashgabat +0 -0
  261. swordfish/asset/tzdb/Asia/Ashkhabad +0 -0
  262. swordfish/asset/tzdb/Asia/Atyrau +0 -0
  263. swordfish/asset/tzdb/Asia/Baghdad +0 -0
  264. swordfish/asset/tzdb/Asia/Bahrain +0 -0
  265. swordfish/asset/tzdb/Asia/Baku +0 -0
  266. swordfish/asset/tzdb/Asia/Bangkok +0 -0
  267. swordfish/asset/tzdb/Asia/Barnaul +0 -0
  268. swordfish/asset/tzdb/Asia/Beirut +0 -0
  269. swordfish/asset/tzdb/Asia/Bishkek +0 -0
  270. swordfish/asset/tzdb/Asia/Brunei +0 -0
  271. swordfish/asset/tzdb/Asia/Calcutta +0 -0
  272. swordfish/asset/tzdb/Asia/Chita +0 -0
  273. swordfish/asset/tzdb/Asia/Choibalsan +0 -0
  274. swordfish/asset/tzdb/Asia/Chongqing +0 -0
  275. swordfish/asset/tzdb/Asia/Chungking +0 -0
  276. swordfish/asset/tzdb/Asia/Colombo +0 -0
  277. swordfish/asset/tzdb/Asia/Dacca +0 -0
  278. swordfish/asset/tzdb/Asia/Damascus +0 -0
  279. swordfish/asset/tzdb/Asia/Dhaka +0 -0
  280. swordfish/asset/tzdb/Asia/Dili +0 -0
  281. swordfish/asset/tzdb/Asia/Dubai +0 -0
  282. swordfish/asset/tzdb/Asia/Dushanbe +0 -0
  283. swordfish/asset/tzdb/Asia/Famagusta +0 -0
  284. swordfish/asset/tzdb/Asia/Gaza +0 -0
  285. swordfish/asset/tzdb/Asia/Harbin +0 -0
  286. swordfish/asset/tzdb/Asia/Hebron +0 -0
  287. swordfish/asset/tzdb/Asia/Ho_Chi_Minh +0 -0
  288. swordfish/asset/tzdb/Asia/Hong_Kong +0 -0
  289. swordfish/asset/tzdb/Asia/Hovd +0 -0
  290. swordfish/asset/tzdb/Asia/Irkutsk +0 -0
  291. swordfish/asset/tzdb/Asia/Istanbul +0 -0
  292. swordfish/asset/tzdb/Asia/Jakarta +0 -0
  293. swordfish/asset/tzdb/Asia/Jayapura +0 -0
  294. swordfish/asset/tzdb/Asia/Jerusalem +0 -0
  295. swordfish/asset/tzdb/Asia/Kabul +0 -0
  296. swordfish/asset/tzdb/Asia/Kamchatka +0 -0
  297. swordfish/asset/tzdb/Asia/Karachi +0 -0
  298. swordfish/asset/tzdb/Asia/Kashgar +0 -0
  299. swordfish/asset/tzdb/Asia/Kathmandu +0 -0
  300. swordfish/asset/tzdb/Asia/Katmandu +0 -0
  301. swordfish/asset/tzdb/Asia/Khandyga +0 -0
  302. swordfish/asset/tzdb/Asia/Kolkata +0 -0
  303. swordfish/asset/tzdb/Asia/Krasnoyarsk +0 -0
  304. swordfish/asset/tzdb/Asia/Kuala_Lumpur +0 -0
  305. swordfish/asset/tzdb/Asia/Kuching +0 -0
  306. swordfish/asset/tzdb/Asia/Kuwait +0 -0
  307. swordfish/asset/tzdb/Asia/Macao +0 -0
  308. swordfish/asset/tzdb/Asia/Macau +0 -0
  309. swordfish/asset/tzdb/Asia/Magadan +0 -0
  310. swordfish/asset/tzdb/Asia/Makassar +0 -0
  311. swordfish/asset/tzdb/Asia/Manila +0 -0
  312. swordfish/asset/tzdb/Asia/Muscat +0 -0
  313. swordfish/asset/tzdb/Asia/Nicosia +0 -0
  314. swordfish/asset/tzdb/Asia/Novokuznetsk +0 -0
  315. swordfish/asset/tzdb/Asia/Novosibirsk +0 -0
  316. swordfish/asset/tzdb/Asia/Omsk +0 -0
  317. swordfish/asset/tzdb/Asia/Oral +0 -0
  318. swordfish/asset/tzdb/Asia/Phnom_Penh +0 -0
  319. swordfish/asset/tzdb/Asia/Pontianak +0 -0
  320. swordfish/asset/tzdb/Asia/Pyongyang +0 -0
  321. swordfish/asset/tzdb/Asia/Qatar +0 -0
  322. swordfish/asset/tzdb/Asia/Qyzylorda +0 -0
  323. swordfish/asset/tzdb/Asia/Rangoon +0 -0
  324. swordfish/asset/tzdb/Asia/Riyadh +0 -0
  325. swordfish/asset/tzdb/Asia/Saigon +0 -0
  326. swordfish/asset/tzdb/Asia/Sakhalin +0 -0
  327. swordfish/asset/tzdb/Asia/Samarkand +0 -0
  328. swordfish/asset/tzdb/Asia/Seoul +0 -0
  329. swordfish/asset/tzdb/Asia/Shanghai +0 -0
  330. swordfish/asset/tzdb/Asia/Singapore +0 -0
  331. swordfish/asset/tzdb/Asia/Srednekolymsk +0 -0
  332. swordfish/asset/tzdb/Asia/Taipei +0 -0
  333. swordfish/asset/tzdb/Asia/Tashkent +0 -0
  334. swordfish/asset/tzdb/Asia/Tbilisi +0 -0
  335. swordfish/asset/tzdb/Asia/Tehran +0 -0
  336. swordfish/asset/tzdb/Asia/Tel_Aviv +0 -0
  337. swordfish/asset/tzdb/Asia/Thimbu +0 -0
  338. swordfish/asset/tzdb/Asia/Thimphu +0 -0
  339. swordfish/asset/tzdb/Asia/Tokyo +0 -0
  340. swordfish/asset/tzdb/Asia/Tomsk +0 -0
  341. swordfish/asset/tzdb/Asia/Ujung_Pandang +0 -0
  342. swordfish/asset/tzdb/Asia/Ulaanbaatar +0 -0
  343. swordfish/asset/tzdb/Asia/Ulan_Bator +0 -0
  344. swordfish/asset/tzdb/Asia/Urumqi +0 -0
  345. swordfish/asset/tzdb/Asia/Ust-Nera +0 -0
  346. swordfish/asset/tzdb/Asia/Vientiane +0 -0
  347. swordfish/asset/tzdb/Asia/Vladivostok +0 -0
  348. swordfish/asset/tzdb/Asia/Yakutsk +0 -0
  349. swordfish/asset/tzdb/Asia/Yangon +0 -0
  350. swordfish/asset/tzdb/Asia/Yekaterinburg +0 -0
  351. swordfish/asset/tzdb/Asia/Yerevan +0 -0
  352. swordfish/asset/tzdb/Atlantic/Azores +0 -0
  353. swordfish/asset/tzdb/Atlantic/Bermuda +0 -0
  354. swordfish/asset/tzdb/Atlantic/Canary +0 -0
  355. swordfish/asset/tzdb/Atlantic/Cape_Verde +0 -0
  356. swordfish/asset/tzdb/Atlantic/Faeroe +0 -0
  357. swordfish/asset/tzdb/Atlantic/Faroe +0 -0
  358. swordfish/asset/tzdb/Atlantic/Jan_Mayen +0 -0
  359. swordfish/asset/tzdb/Atlantic/Madeira +0 -0
  360. swordfish/asset/tzdb/Atlantic/Reykjavik +0 -0
  361. swordfish/asset/tzdb/Atlantic/South_Georgia +0 -0
  362. swordfish/asset/tzdb/Atlantic/St_Helena +0 -0
  363. swordfish/asset/tzdb/Atlantic/Stanley +0 -0
  364. swordfish/asset/tzdb/Australia/ACT +0 -0
  365. swordfish/asset/tzdb/Australia/Adelaide +0 -0
  366. swordfish/asset/tzdb/Australia/Brisbane +0 -0
  367. swordfish/asset/tzdb/Australia/Broken_Hill +0 -0
  368. swordfish/asset/tzdb/Australia/Canberra +0 -0
  369. swordfish/asset/tzdb/Australia/Currie +0 -0
  370. swordfish/asset/tzdb/Australia/Darwin +0 -0
  371. swordfish/asset/tzdb/Australia/Eucla +0 -0
  372. swordfish/asset/tzdb/Australia/Hobart +0 -0
  373. swordfish/asset/tzdb/Australia/LHI +0 -0
  374. swordfish/asset/tzdb/Australia/Lindeman +0 -0
  375. swordfish/asset/tzdb/Australia/Lord_Howe +0 -0
  376. swordfish/asset/tzdb/Australia/Melbourne +0 -0
  377. swordfish/asset/tzdb/Australia/NSW +0 -0
  378. swordfish/asset/tzdb/Australia/North +0 -0
  379. swordfish/asset/tzdb/Australia/Perth +0 -0
  380. swordfish/asset/tzdb/Australia/Queensland +0 -0
  381. swordfish/asset/tzdb/Australia/South +0 -0
  382. swordfish/asset/tzdb/Australia/Sydney +0 -0
  383. swordfish/asset/tzdb/Australia/Tasmania +0 -0
  384. swordfish/asset/tzdb/Australia/Victoria +0 -0
  385. swordfish/asset/tzdb/Australia/West +0 -0
  386. swordfish/asset/tzdb/Australia/Yancowinna +0 -0
  387. swordfish/asset/tzdb/Brazil/Acre +0 -0
  388. swordfish/asset/tzdb/Brazil/DeNoronha +0 -0
  389. swordfish/asset/tzdb/Brazil/East +0 -0
  390. swordfish/asset/tzdb/Brazil/West +0 -0
  391. swordfish/asset/tzdb/CET +0 -0
  392. swordfish/asset/tzdb/CST6CDT +0 -0
  393. swordfish/asset/tzdb/Canada/Atlantic +0 -0
  394. swordfish/asset/tzdb/Canada/Central +0 -0
  395. swordfish/asset/tzdb/Canada/Eastern +0 -0
  396. swordfish/asset/tzdb/Canada/Mountain +0 -0
  397. swordfish/asset/tzdb/Canada/Newfoundland +0 -0
  398. swordfish/asset/tzdb/Canada/Pacific +0 -0
  399. swordfish/asset/tzdb/Canada/Saskatchewan +0 -0
  400. swordfish/asset/tzdb/Canada/Yukon +0 -0
  401. swordfish/asset/tzdb/Chile/Continental +0 -0
  402. swordfish/asset/tzdb/Chile/EasterIsland +0 -0
  403. swordfish/asset/tzdb/Cuba +0 -0
  404. swordfish/asset/tzdb/EET +0 -0
  405. swordfish/asset/tzdb/EST +0 -0
  406. swordfish/asset/tzdb/EST5EDT +0 -0
  407. swordfish/asset/tzdb/Egypt +0 -0
  408. swordfish/asset/tzdb/Eire +0 -0
  409. swordfish/asset/tzdb/Etc/GMT +0 -0
  410. swordfish/asset/tzdb/Etc/GMT+0 +0 -0
  411. swordfish/asset/tzdb/Etc/GMT+1 +0 -0
  412. swordfish/asset/tzdb/Etc/GMT+10 +0 -0
  413. swordfish/asset/tzdb/Etc/GMT+11 +0 -0
  414. swordfish/asset/tzdb/Etc/GMT+12 +0 -0
  415. swordfish/asset/tzdb/Etc/GMT+2 +0 -0
  416. swordfish/asset/tzdb/Etc/GMT+3 +0 -0
  417. swordfish/asset/tzdb/Etc/GMT+4 +0 -0
  418. swordfish/asset/tzdb/Etc/GMT+5 +0 -0
  419. swordfish/asset/tzdb/Etc/GMT+6 +0 -0
  420. swordfish/asset/tzdb/Etc/GMT+7 +0 -0
  421. swordfish/asset/tzdb/Etc/GMT+8 +0 -0
  422. swordfish/asset/tzdb/Etc/GMT+9 +0 -0
  423. swordfish/asset/tzdb/Etc/GMT-0 +0 -0
  424. swordfish/asset/tzdb/Etc/GMT-1 +0 -0
  425. swordfish/asset/tzdb/Etc/GMT-10 +0 -0
  426. swordfish/asset/tzdb/Etc/GMT-11 +0 -0
  427. swordfish/asset/tzdb/Etc/GMT-12 +0 -0
  428. swordfish/asset/tzdb/Etc/GMT-13 +0 -0
  429. swordfish/asset/tzdb/Etc/GMT-14 +0 -0
  430. swordfish/asset/tzdb/Etc/GMT-2 +0 -0
  431. swordfish/asset/tzdb/Etc/GMT-3 +0 -0
  432. swordfish/asset/tzdb/Etc/GMT-4 +0 -0
  433. swordfish/asset/tzdb/Etc/GMT-5 +0 -0
  434. swordfish/asset/tzdb/Etc/GMT-6 +0 -0
  435. swordfish/asset/tzdb/Etc/GMT-7 +0 -0
  436. swordfish/asset/tzdb/Etc/GMT-8 +0 -0
  437. swordfish/asset/tzdb/Etc/GMT-9 +0 -0
  438. swordfish/asset/tzdb/Etc/GMT0 +0 -0
  439. swordfish/asset/tzdb/Etc/Greenwich +0 -0
  440. swordfish/asset/tzdb/Etc/UCT +0 -0
  441. swordfish/asset/tzdb/Etc/UTC +0 -0
  442. swordfish/asset/tzdb/Etc/Universal +0 -0
  443. swordfish/asset/tzdb/Etc/Zulu +0 -0
  444. swordfish/asset/tzdb/Europe/Amsterdam +0 -0
  445. swordfish/asset/tzdb/Europe/Andorra +0 -0
  446. swordfish/asset/tzdb/Europe/Astrakhan +0 -0
  447. swordfish/asset/tzdb/Europe/Athens +0 -0
  448. swordfish/asset/tzdb/Europe/Belfast +0 -0
  449. swordfish/asset/tzdb/Europe/Belgrade +0 -0
  450. swordfish/asset/tzdb/Europe/Berlin +0 -0
  451. swordfish/asset/tzdb/Europe/Bratislava +0 -0
  452. swordfish/asset/tzdb/Europe/Brussels +0 -0
  453. swordfish/asset/tzdb/Europe/Bucharest +0 -0
  454. swordfish/asset/tzdb/Europe/Budapest +0 -0
  455. swordfish/asset/tzdb/Europe/Busingen +0 -0
  456. swordfish/asset/tzdb/Europe/Chisinau +0 -0
  457. swordfish/asset/tzdb/Europe/Copenhagen +0 -0
  458. swordfish/asset/tzdb/Europe/Dublin +0 -0
  459. swordfish/asset/tzdb/Europe/Gibraltar +0 -0
  460. swordfish/asset/tzdb/Europe/Guernsey +0 -0
  461. swordfish/asset/tzdb/Europe/Helsinki +0 -0
  462. swordfish/asset/tzdb/Europe/Isle_of_Man +0 -0
  463. swordfish/asset/tzdb/Europe/Istanbul +0 -0
  464. swordfish/asset/tzdb/Europe/Jersey +0 -0
  465. swordfish/asset/tzdb/Europe/Kaliningrad +0 -0
  466. swordfish/asset/tzdb/Europe/Kiev +0 -0
  467. swordfish/asset/tzdb/Europe/Kirov +0 -0
  468. swordfish/asset/tzdb/Europe/Lisbon +0 -0
  469. swordfish/asset/tzdb/Europe/Ljubljana +0 -0
  470. swordfish/asset/tzdb/Europe/London +0 -0
  471. swordfish/asset/tzdb/Europe/Luxembourg +0 -0
  472. swordfish/asset/tzdb/Europe/Madrid +0 -0
  473. swordfish/asset/tzdb/Europe/Malta +0 -0
  474. swordfish/asset/tzdb/Europe/Mariehamn +0 -0
  475. swordfish/asset/tzdb/Europe/Minsk +0 -0
  476. swordfish/asset/tzdb/Europe/Monaco +0 -0
  477. swordfish/asset/tzdb/Europe/Moscow +0 -0
  478. swordfish/asset/tzdb/Europe/Nicosia +0 -0
  479. swordfish/asset/tzdb/Europe/Oslo +0 -0
  480. swordfish/asset/tzdb/Europe/Paris +0 -0
  481. swordfish/asset/tzdb/Europe/Podgorica +0 -0
  482. swordfish/asset/tzdb/Europe/Prague +0 -0
  483. swordfish/asset/tzdb/Europe/Riga +0 -0
  484. swordfish/asset/tzdb/Europe/Rome +0 -0
  485. swordfish/asset/tzdb/Europe/Samara +0 -0
  486. swordfish/asset/tzdb/Europe/San_Marino +0 -0
  487. swordfish/asset/tzdb/Europe/Sarajevo +0 -0
  488. swordfish/asset/tzdb/Europe/Saratov +0 -0
  489. swordfish/asset/tzdb/Europe/Simferopol +0 -0
  490. swordfish/asset/tzdb/Europe/Skopje +0 -0
  491. swordfish/asset/tzdb/Europe/Sofia +0 -0
  492. swordfish/asset/tzdb/Europe/Stockholm +0 -0
  493. swordfish/asset/tzdb/Europe/Tallinn +0 -0
  494. swordfish/asset/tzdb/Europe/Tirane +0 -0
  495. swordfish/asset/tzdb/Europe/Tiraspol +0 -0
  496. swordfish/asset/tzdb/Europe/Ulyanovsk +0 -0
  497. swordfish/asset/tzdb/Europe/Uzhgorod +0 -0
  498. swordfish/asset/tzdb/Europe/Vaduz +0 -0
  499. swordfish/asset/tzdb/Europe/Vatican +0 -0
  500. swordfish/asset/tzdb/Europe/Vienna +0 -0
  501. swordfish/asset/tzdb/Europe/Vilnius +0 -0
  502. swordfish/asset/tzdb/Europe/Volgograd +0 -0
  503. swordfish/asset/tzdb/Europe/Warsaw +0 -0
  504. swordfish/asset/tzdb/Europe/Zagreb +0 -0
  505. swordfish/asset/tzdb/Europe/Zaporozhye +0 -0
  506. swordfish/asset/tzdb/Europe/Zurich +0 -0
  507. swordfish/asset/tzdb/Factory +0 -0
  508. swordfish/asset/tzdb/GB +0 -0
  509. swordfish/asset/tzdb/GB-Eire +0 -0
  510. swordfish/asset/tzdb/GMT +0 -0
  511. swordfish/asset/tzdb/GMT+0 +0 -0
  512. swordfish/asset/tzdb/GMT-0 +0 -0
  513. swordfish/asset/tzdb/GMT0 +0 -0
  514. swordfish/asset/tzdb/Greenwich +0 -0
  515. swordfish/asset/tzdb/HST +0 -0
  516. swordfish/asset/tzdb/Hongkong +0 -0
  517. swordfish/asset/tzdb/Iceland +0 -0
  518. swordfish/asset/tzdb/Indian/Antananarivo +0 -0
  519. swordfish/asset/tzdb/Indian/Chagos +0 -0
  520. swordfish/asset/tzdb/Indian/Christmas +0 -0
  521. swordfish/asset/tzdb/Indian/Cocos +0 -0
  522. swordfish/asset/tzdb/Indian/Comoro +0 -0
  523. swordfish/asset/tzdb/Indian/Kerguelen +0 -0
  524. swordfish/asset/tzdb/Indian/Mahe +0 -0
  525. swordfish/asset/tzdb/Indian/Maldives +0 -0
  526. swordfish/asset/tzdb/Indian/Mauritius +0 -0
  527. swordfish/asset/tzdb/Indian/Mayotte +0 -0
  528. swordfish/asset/tzdb/Indian/Reunion +0 -0
  529. swordfish/asset/tzdb/Iran +0 -0
  530. swordfish/asset/tzdb/Israel +0 -0
  531. swordfish/asset/tzdb/Jamaica +0 -0
  532. swordfish/asset/tzdb/Japan +0 -0
  533. swordfish/asset/tzdb/Kwajalein +0 -0
  534. swordfish/asset/tzdb/Libya +0 -0
  535. swordfish/asset/tzdb/MET +0 -0
  536. swordfish/asset/tzdb/MST +0 -0
  537. swordfish/asset/tzdb/MST7MDT +0 -0
  538. swordfish/asset/tzdb/Mexico/BajaNorte +0 -0
  539. swordfish/asset/tzdb/Mexico/BajaSur +0 -0
  540. swordfish/asset/tzdb/Mexico/General +0 -0
  541. swordfish/asset/tzdb/NZ +0 -0
  542. swordfish/asset/tzdb/NZ-CHAT +0 -0
  543. swordfish/asset/tzdb/Navajo +0 -0
  544. swordfish/asset/tzdb/PRC +0 -0
  545. swordfish/asset/tzdb/PST8PDT +0 -0
  546. swordfish/asset/tzdb/Pacific/Apia +0 -0
  547. swordfish/asset/tzdb/Pacific/Auckland +0 -0
  548. swordfish/asset/tzdb/Pacific/Bougainville +0 -0
  549. swordfish/asset/tzdb/Pacific/Chatham +0 -0
  550. swordfish/asset/tzdb/Pacific/Chuuk +0 -0
  551. swordfish/asset/tzdb/Pacific/Easter +0 -0
  552. swordfish/asset/tzdb/Pacific/Efate +0 -0
  553. swordfish/asset/tzdb/Pacific/Enderbury +0 -0
  554. swordfish/asset/tzdb/Pacific/Fakaofo +0 -0
  555. swordfish/asset/tzdb/Pacific/Fiji +0 -0
  556. swordfish/asset/tzdb/Pacific/Funafuti +0 -0
  557. swordfish/asset/tzdb/Pacific/Galapagos +0 -0
  558. swordfish/asset/tzdb/Pacific/Gambier +0 -0
  559. swordfish/asset/tzdb/Pacific/Guadalcanal +0 -0
  560. swordfish/asset/tzdb/Pacific/Guam +0 -0
  561. swordfish/asset/tzdb/Pacific/Honolulu +0 -0
  562. swordfish/asset/tzdb/Pacific/Johnston +0 -0
  563. swordfish/asset/tzdb/Pacific/Kiritimati +0 -0
  564. swordfish/asset/tzdb/Pacific/Kosrae +0 -0
  565. swordfish/asset/tzdb/Pacific/Kwajalein +0 -0
  566. swordfish/asset/tzdb/Pacific/Majuro +0 -0
  567. swordfish/asset/tzdb/Pacific/Marquesas +0 -0
  568. swordfish/asset/tzdb/Pacific/Midway +0 -0
  569. swordfish/asset/tzdb/Pacific/Nauru +0 -0
  570. swordfish/asset/tzdb/Pacific/Niue +0 -0
  571. swordfish/asset/tzdb/Pacific/Norfolk +0 -0
  572. swordfish/asset/tzdb/Pacific/Noumea +0 -0
  573. swordfish/asset/tzdb/Pacific/Pago_Pago +0 -0
  574. swordfish/asset/tzdb/Pacific/Palau +0 -0
  575. swordfish/asset/tzdb/Pacific/Pitcairn +0 -0
  576. swordfish/asset/tzdb/Pacific/Pohnpei +0 -0
  577. swordfish/asset/tzdb/Pacific/Ponape +0 -0
  578. swordfish/asset/tzdb/Pacific/Port_Moresby +0 -0
  579. swordfish/asset/tzdb/Pacific/Rarotonga +0 -0
  580. swordfish/asset/tzdb/Pacific/Saipan +0 -0
  581. swordfish/asset/tzdb/Pacific/Samoa +0 -0
  582. swordfish/asset/tzdb/Pacific/Tahiti +0 -0
  583. swordfish/asset/tzdb/Pacific/Tarawa +0 -0
  584. swordfish/asset/tzdb/Pacific/Tongatapu +0 -0
  585. swordfish/asset/tzdb/Pacific/Truk +0 -0
  586. swordfish/asset/tzdb/Pacific/Wake +0 -0
  587. swordfish/asset/tzdb/Pacific/Wallis +0 -0
  588. swordfish/asset/tzdb/Pacific/Yap +0 -0
  589. swordfish/asset/tzdb/Poland +0 -0
  590. swordfish/asset/tzdb/Portugal +0 -0
  591. swordfish/asset/tzdb/ROC +0 -0
  592. swordfish/asset/tzdb/ROK +0 -0
  593. swordfish/asset/tzdb/Singapore +0 -0
  594. swordfish/asset/tzdb/Turkey +0 -0
  595. swordfish/asset/tzdb/UCT +0 -0
  596. swordfish/asset/tzdb/US/Alaska +0 -0
  597. swordfish/asset/tzdb/US/Aleutian +0 -0
  598. swordfish/asset/tzdb/US/Arizona +0 -0
  599. swordfish/asset/tzdb/US/Central +0 -0
  600. swordfish/asset/tzdb/US/East-Indiana +0 -0
  601. swordfish/asset/tzdb/US/Eastern +0 -0
  602. swordfish/asset/tzdb/US/Hawaii +0 -0
  603. swordfish/asset/tzdb/US/Indiana-Starke +0 -0
  604. swordfish/asset/tzdb/US/Michigan +0 -0
  605. swordfish/asset/tzdb/US/Mountain +0 -0
  606. swordfish/asset/tzdb/US/Pacific +0 -0
  607. swordfish/asset/tzdb/US/Samoa +0 -0
  608. swordfish/asset/tzdb/UTC +0 -0
  609. swordfish/asset/tzdb/Universal +0 -0
  610. swordfish/asset/tzdb/W-SU +0 -0
  611. swordfish/asset/tzdb/WET +0 -0
  612. swordfish/asset/tzdb/Zulu +0 -0
  613. swordfish/asset/tzdb/iso3166.tab +274 -0
  614. swordfish/asset/tzdb/leapseconds +61 -0
  615. swordfish/asset/tzdb/posixrules +0 -0
  616. swordfish/asset/tzdb/tzdata.zi +4150 -0
  617. swordfish/asset/tzdb/tzmap_gen.py +27 -0
  618. swordfish/asset/tzdb/tzmapping +501 -0
  619. swordfish/asset/tzdb/windowsZones.xml +781 -0
  620. swordfish/asset/tzdb/zone.tab +448 -0
  621. swordfish/asset/tzdb/zone1970.tab +382 -0
  622. swordfish/connection.py +33 -0
  623. swordfish/data.py +806 -0
  624. swordfish/engine.py +28 -0
  625. swordfish/enums.py +32 -0
  626. swordfish/function.py +3 -0
  627. swordfish/infos.py +53 -0
  628. swordfish/io.py +11 -0
  629. swordfish/libSwordfish.dll +0 -0
  630. swordfish/libclucene-contribs-lib.dll +0 -0
  631. swordfish/libclucene-core.dll +0 -0
  632. swordfish/libclucene-shared.dll +0 -0
  633. swordfish/libgcc_s_seh-1.dll +0 -0
  634. swordfish/libstdc++-6.dll +0 -0
  635. swordfish/libwinpthread-1.dll +0 -0
  636. swordfish/module.py +57 -0
  637. swordfish/plugins/__init__.py +17 -0
  638. swordfish/plugins/backtest/__init__.py +38 -0
  639. swordfish/plugins/backtest/backtest.py +4228 -0
  640. swordfish/plugins/backtest/translator.py +820 -0
  641. swordfish/plugins/matching_engine_simulator.py +247 -0
  642. swordfish/streaming.py +19 -0
  643. swordfish/tools.py +71 -0
  644. swordfish/types.py +30 -0
swordfish/_config.py ADDED
@@ -0,0 +1,901 @@
1
+ import os
2
+ import sys
3
+ import toml
4
+ from pathlib import Path
5
+ from typing import Type, TypeVar, Generic, Optional, Dict, List
6
+ from ._swordfishcpp import ( # type: ignore
7
+ sw_check,
8
+ sw_is_ce_edition,
9
+ _global_call,
10
+ Scalar,
11
+ ProgrammingError,
12
+ )
13
+ from .tools import get_random_available_port
14
+
15
+
16
+ ENV_NAME_HOME = "SWORDFISH_PYTHON_HOME_PATH"
17
+ ENV_NAME_CONFIG = "SWORDFISH_PYTHON_CONFIG_PATH"
18
+ ENV_NAME_LICENSE = "SWORDFISH_PYTHON_LICENSE_PATH"
19
+ ENV_NAME_HOST = "SWORDFISH_PYTHON_HOST"
20
+ ENV_NAME_PORT = "SWORDFISH_PYTHON_PORT"
21
+ ENV_NAME_ALIAS = "SWORDFISH_PYTHON_ALIAS"
22
+ ENV_NAME_EXTRA = "SWORDFISH_PYTHON_COMMAND"
23
+
24
+
25
+ def _getenv(env_name: str):
26
+ val = os.getenv(env_name)
27
+ return val if val else None
28
+
29
+
30
+ def _get_absolute_path_env(env_name: str):
31
+ return Path(_getenv(env_name)).expanduser()
32
+
33
+
34
+ T = TypeVar('T')
35
+
36
+
37
+ class ConfigDescriptor(Generic[T]):
38
+ """
39
+ A descriptor for managing configuration values.
40
+ """
41
+ config_name: str
42
+ """
43
+ The name of the configuration.
44
+ """
45
+ config_type: Type[T]
46
+ """
47
+ The type of the configuration value.
48
+ """
49
+ config_value: Optional[T]
50
+ """
51
+ The current value of the configuration.
52
+ """
53
+
54
+ def __init__(self, val_type: Type[T], default_value: Optional[T] = None):
55
+ self.init(val_type, default_value)
56
+
57
+ def init(self, val_type: Type[T], default_value: Optional[T] = None):
58
+ self.config_type = val_type
59
+ self.config_value = val_type(default_value) if default_value is not None else None
60
+ self.default_value = self.config_value
61
+
62
+ def __set_name__(self, owner: "Config", name):
63
+ self.name = name
64
+ owner.config_dict[name] = self
65
+
66
+ def __get__(self, instance, owner):
67
+ pass
68
+
69
+ def __set__(self, instance, value):
70
+ pass
71
+
72
+ def get_value_str(self):
73
+ if self.config_value is None:
74
+ return None
75
+ if isinstance(self.config_value, bool):
76
+ return str(self.config_value).lower()
77
+ return str(self.config_value)
78
+
79
+ def is_default(self) -> bool:
80
+ """
81
+ Checks if the configuration value matches the default value.
82
+
83
+ Returns
84
+ -------
85
+ bool
86
+ True if the current value is the default, False otherwise.
87
+ """
88
+ return self.config_value == self.default_value
89
+
90
+ def _wrap_config_value(self, val: Scalar):
91
+ if val.is_null():
92
+ return None
93
+ if self.config_type is Path:
94
+ return Path(val.to_python())
95
+ return val.to_python()
96
+
97
+
98
+ class StaticConfigDescriptor(ConfigDescriptor):
99
+ """
100
+ A descriptor for handling static configuration values.
101
+ """
102
+ def __get__(self, instance, owner):
103
+ if not sw_check():
104
+ return self.config_value if self.config_value is not None else None
105
+ val = _global_call("getConfig", self.name)
106
+ return self._wrap_config_value(val)
107
+
108
+ def __set__(self, instance, value):
109
+ if sw_check():
110
+ raise ProgrammingError("Cannot modify static configuration after initialization.")
111
+ if not isinstance(value, self.config_type) and value is not None:
112
+ self.config_value = self.config_type(value)
113
+ else:
114
+ self.config_value = value
115
+
116
+
117
+ # class DynamicConfigDescriptor(ConfigDescriptor):
118
+ # def __get__(self, instance, owner):
119
+ # if not sw_check():
120
+ # return self.config_value if self.config_value is not None else None
121
+ # val = _global_call("getConfig", self.name)
122
+ # return self._wrap_config_value(val)
123
+
124
+ # def __set__(self, instance, value):
125
+ # if not isinstance(value, self.config_type) and value is not None:
126
+ # value = self.config_type(value)
127
+ # if sw_check():
128
+ # if isinstance(value, Path):
129
+ # value = str(value)
130
+ # set_dynamic_config(self.name, value)
131
+ # else:
132
+ # self.config_value = value
133
+
134
+
135
+ class DynamicConfigDescriptor(StaticConfigDescriptor):
136
+ """
137
+ A descriptor for dynamic configuration values.
138
+
139
+ Currently, dynamic configuration is not supported.
140
+ """
141
+ pass
142
+
143
+
144
+ class Config:
145
+ """
146
+ A class that manages various configuration settings.
147
+ """
148
+ config_dict: Dict[str, ConfigDescriptor] = dict()
149
+ """
150
+ :meta hide-value:
151
+ """
152
+
153
+ dataSync: int = StaticConfigDescriptor(int, 1)
154
+ """
155
+ :meta hide-value:
156
+
157
+ Whether database logs are forced to persist to disk before the transaction is
158
+ committed.
159
+
160
+ - If `dataSync=1` (default), the redo logs, data, and metadata are forced to
161
+ persist to disk.
162
+ - If `dataSync=0`, the operating system will decide when to write the log files
163
+ to disk.
164
+ """
165
+
166
+ decimalRoundingMode: str = StaticConfigDescriptor(str, "trunc")
167
+ """
168
+ :meta hide-value:
169
+
170
+ Specifies the rounding mode for Decimal type. The default is `"trunc"`, meaning
171
+ the decimal part is truncated. Set it to `"round"` to round the decimal part.
172
+ It is applicable to the following conversion scenarios:
173
+
174
+ - Parsing floating-point numeric strings to DECIMAL type (e.g., loading files
175
+ with `loadText`).
176
+ - Converting floating-point numbers to Decimal type.
177
+ - Converting Decimal values to Integral type.
178
+ - Converting high-precision Decimal values to low-precision Decimal values.
179
+
180
+ Note
181
+ ----
182
+ The rounding mode for the first case is rounding. For other scenarios,
183
+ truncation was used.
184
+ """
185
+
186
+ enableChunkGranularityConfig: bool = StaticConfigDescriptor(bool, True)
187
+ """
188
+ :meta hide-value:
189
+
190
+ Specifies the chunk granularity to determine the level of the lock of a
191
+ transaction. When writing to a chunk, the transaction locks it to prevent other
192
+ transactions from writing to it.
193
+
194
+ The default value is `True`. You can specify the chunk granularity with the
195
+ parameter `chunkGranularity` of function `database`.
196
+
197
+ If set to `False`, the chunk granularity is at the table level, i.e., each
198
+ tablet of a partition is a chunk. Concurrent writes to different tables in the
199
+ same partition are thus allowed.
200
+ """
201
+
202
+ enableConcurrentDimensionalTableWrite: bool = StaticConfigDescriptor(bool, False)
203
+ """
204
+ :meta hide-value:
205
+
206
+ Whether to allow conducting concurrent write or update/delete on dimension
207
+ tables.
208
+
209
+ The default value is `False`, indicating concurrent write and update/delete is
210
+ disabled for dimension tables.
211
+ """
212
+
213
+ enableDFS: bool = StaticConfigDescriptor(bool, False if sw_is_ce_edition() else True)
214
+ """
215
+ :meta hide-value:
216
+ """
217
+
218
+ enableInsertStatementForDFSTable: bool = StaticConfigDescriptor(bool, True)
219
+ """
220
+ :meta hide-value:
221
+
222
+ Whether to enable the insert into statement for DFS tables. The default value is
223
+ `True`.
224
+ """
225
+
226
+ enableLocalDatabase: bool = StaticConfigDescriptor(bool, False)
227
+ """
228
+ :meta hide-value:
229
+
230
+ Whether to enable the creation of a local database. The default value is `False`.
231
+ """
232
+
233
+ home: Path = StaticConfigDescriptor(Path, None)
234
+ """
235
+ :meta hide-value:
236
+
237
+ The DolphinDB home directory (`<HomeDir>`). It can only be specified in command
238
+ line.
239
+ """
240
+
241
+ ignoreSpecialCharacterInPartitionId: bool = StaticConfigDescriptor(bool, False)
242
+ """
243
+ :meta hide-value:
244
+
245
+ Whether to ignore ``":"`` and ``"."`` in partitioning columns when creating
246
+ partition directories for value-partitioned tables with partitioning columns of
247
+ STRING or SYMBOL type.
248
+
249
+ The default value is `False`. The "." and ":" will be included as part of the
250
+ path, which means data written to the ".a:bc." and "abc" partitions will be
251
+ separated into different paths.
252
+
253
+ If set to `True`, keys like ``".a:bc."`` and "abc" of the partitioning column
254
+ will map to the same directory path since ":" and "." are ignored. So data
255
+ written to partitions ".a:bc." and "abc" will both end up being stored under
256
+ "abc".
257
+ """
258
+
259
+ init: Path = StaticConfigDescriptor(Path, None)
260
+ """
261
+ :meta hide-value:
262
+
263
+ This file is executed when the system starts. The default file is `{package
264
+ install dir}/asset/dolphindb.dos`.
265
+
266
+ It usually contains definitions of system-level functions that are visible to
267
+ all users and cannot be overwritten.
268
+ """
269
+
270
+ license: Path = StaticConfigDescriptor(Path, None)
271
+ """
272
+ :meta hide-value:
273
+ """
274
+
275
+ localSite: str = StaticConfigDescriptor(str, None)
276
+ """
277
+ :meta hide-value:
278
+
279
+ The LAN information of the node, including host address, port number and alias
280
+ of the node, separated by ``":"``.
281
+ """
282
+
283
+ logFile: Path = StaticConfigDescriptor(Path, None)
284
+ """
285
+ :meta hide-value:
286
+
287
+ The path and name of the log file. It displays the Swordfish configuration
288
+ specifications, warnings, and error messages.
289
+ """
290
+
291
+ logicOrIgnoreNull: bool = StaticConfigDescriptor(bool, False)
292
+ """
293
+ :meta hide-value:
294
+
295
+ Whether function `or` ignores null values.
296
+
297
+ When set to False (default), it always returns NULL regardless of the value of
298
+ the other operand, which matches the behavior in prior versions.
299
+
300
+ When set to True:
301
+
302
+ - If the other operand is non-zero, it returns True.
303
+ - If the other operand is zero, it returns False.
304
+ - If the other operand is a null value, it returns NULL.
305
+ """
306
+
307
+ logLevel: str = DynamicConfigDescriptor(str, "ERROR")
308
+ """
309
+ :meta hide-value:
310
+
311
+ The level equal to and above which logs are printed to help users locate the
312
+ error message in the log. From the lowest to the highest level, the possible
313
+ values are `DEBUG`, `INFO`, `WARNING`, and `ERROR`. The default value is
314
+ `ERROR`.
315
+ """
316
+
317
+ logRetentionTime: float = StaticConfigDescriptor(float, None)
318
+ """
319
+ :meta hide-value:
320
+
321
+ To prevent excessive resource usage from old logs, the `logRetentionTime`
322
+ parameter can be used to specify the amount of time (in days) to keep a log file
323
+ before deleting it.
324
+
325
+ The default value is 30 (of floating-point data type). For example, 0.5 means
326
+ 12 hours. If set to 0, log files are not deleted.
327
+ """
328
+
329
+ marketHolidayDir: Path = StaticConfigDescriptor(Path, None)
330
+ """
331
+ :meta hide-value:
332
+
333
+ The directory to the file of market holidays. Either an absolute or relative
334
+ directory can be specified.
335
+
336
+ The system searches the relative directory in the following order: home
337
+ directory of the node, the working directory of the node, and the directory with
338
+ the DolphinDB executable.
339
+
340
+ The default directory is `{package install dir}/asset/marketHoliday`. The file
341
+ must be a single-column CSV file with `Date` data. Based on the CSV files under
342
+ `marketHolidayDir`, a trading calendar is created with the file name as its
343
+ identifier.
344
+
345
+ Notes
346
+ -----
347
+ - Weekends are recognized as holidays by default; therefore, only weekday
348
+ holidays need to be filled in the file.
349
+ - It is recommended to name the file in Market Identifier Code, e.g.,
350
+ `"XNYS.csv"`.
351
+ """
352
+
353
+ maxBlockSizeForReservedMemory: float = DynamicConfigDescriptor(float, None)
354
+ """
355
+ :meta hide-value:
356
+
357
+ The maximum size (in units of KB) of the memory block that DolphinDB allocates
358
+ for each memory request when its available memory is less than `reservedMemSize`.
359
+ The default value is 64.
360
+
361
+ It is not recommended to set it too high as exceptions or crashes may occur if
362
+ there isn't enough memory left for critical database operations.
363
+ """
364
+
365
+ maxConnections: int = DynamicConfigDescriptor(int, None)
366
+ """
367
+ :meta hide-value:
368
+
369
+ The maximum number of connections to the local node.
370
+ """
371
+
372
+ maxLogSize: int = StaticConfigDescriptor(int, None)
373
+ """
374
+ :meta hide-value:
375
+
376
+ The system will archive the Swordfish log after it reaches the specified size
377
+ limit (in MB). The default value is 1024 and the minimum value is 100.
378
+
379
+ Upon reaching this limit, Swordfish automatically generates a new log with a
380
+ timestamp prefix in seconds. The prefix is in the format of `<date><seq>`, e.g.,
381
+ `20181109000`. `<seq>` has 3 digits and starts with `000`.
382
+ """
383
+
384
+ maxMemSize: float = DynamicConfigDescriptor(float, None)
385
+ """
386
+ :meta hide-value:
387
+
388
+ The maximum memory (in units of GB) allocated to Swordfish. The default value is
389
+ 0, meaning no limits on memory usage. The value of `maxMemSize` cannot exceed
390
+ the machine memory.
391
+ """
392
+
393
+ maxPartitionNumPerQuery: int = DynamicConfigDescriptor(int, 65536)
394
+ """
395
+ :meta hide-value:
396
+
397
+ The maximum number of partitions that a single query can search. The default
398
+ value is `65536`.
399
+ """
400
+
401
+ maxPubConnections: int = StaticConfigDescriptor(int, 64)
402
+ """
403
+ :meta hide-value:
404
+
405
+ The maximum number of subscriber nodes that the publisher node can connect to.
406
+ The default value is 64.
407
+
408
+ For the node to serve as a publisher, we must set `maxPubConnections > 0`.
409
+ """
410
+
411
+ maxSubConnections: int = StaticConfigDescriptor(int, None)
412
+ """
413
+ :meta hide-value:
414
+
415
+ The maximum number of publisher nodes that the subscriber node can connect to.
416
+ The default value is 64.
417
+ """
418
+
419
+ maxSubQueueDepth: int = StaticConfigDescriptor(int, None)
420
+ """
421
+ :meta hide-value:
422
+
423
+ The maximum depth (number of records) of a message queue on the subscriber node.
424
+ The default value is `10,000,000`.
425
+ """
426
+
427
+ memLimitOfAllTempResults: float = DynamicConfigDescriptor(float, None)
428
+ """
429
+ :meta hide-value:
430
+
431
+ The total memory limit (in GB) for all temporary results generated during SQL
432
+ distributed queries. The default value is `20% * maxMemSize`.
433
+
434
+ If the memory usage exceeds the limit, temporary results are spilled to disk.
435
+ """
436
+
437
+ memLimitOfQueryResult: float = DynamicConfigDescriptor(float, None)
438
+ """
439
+ :meta hide-value:
440
+
441
+ The memory limit for a query result. The default value is `min(50% * maxMemSize,
442
+ 8G)`, and it must be smaller than `80% * maxMemSize`.
443
+ """
444
+
445
+ memLimitOfTaskGroupResult: float = DynamicConfigDescriptor(float, None)
446
+ """
447
+ :meta hide-value:
448
+
449
+ In the Map phase of MapReduce, a single query is divided into several tasks,
450
+ among which the remote tasks are sent to remote nodes in batches (task groups).
451
+ `memLimitOfTaskGroupResult` is used to set the memory limit of a task group sent
452
+ from the current node.
453
+
454
+ The default value is min(20% * `maxMemSize`, 2G), and it must be smaller than
455
+ 50% * `maxMemSize`.
456
+ """
457
+
458
+ moduleDir: Path = StaticConfigDescriptor(Path, None)
459
+ """
460
+ :meta hide-value:
461
+
462
+ The directory for the module files. It can be an absolute path or a relative
463
+ directory, with `modules` as the default.
464
+
465
+ The system searches the relative directory `modules` in the following order:
466
+ home directory, the working directory, and the directory with the swordfish
467
+ package.
468
+ """
469
+
470
+ newValuePartitionPolicy: str = StaticConfigDescriptor(str, "add")
471
+ """
472
+ :meta hide-value:
473
+
474
+ How new data outside of existing VALUE partitions are handled in databases. It
475
+ can be "add", "skip", or "fail".
476
+
477
+ - `"add"` (default): Creates new VALUE partitions to add all data.
478
+ - `"skip"`: Appends data that belongs to existing VALUE partitions and ignores
479
+ out-of-scope data.
480
+ - `"fail"`: Throws exception if out-of-scope data is included. None of the data
481
+ will be written. In most cases, `"add"` is recommended.
482
+ """
483
+
484
+ nullAsMinValueForComparison: bool = StaticConfigDescriptor(bool, None)
485
+ """
486
+ :meta hide-value:
487
+
488
+ Whether a null value is treated as the minimum value in data comparison. The
489
+ default value is True.
490
+
491
+ If it is set to False, the result of comparison involving null values is NULL.
492
+ """
493
+
494
+ OLAPCacheEngineSize: float = DynamicConfigDescriptor(float, 0.5)
495
+ """
496
+ :meta hide-value:
497
+
498
+ The capacity of cache engine in units of GB. After cache engine is enabled, data
499
+ is not written to disk until data in cache exceeds 30% of
500
+ `OLAPCacheEngineSize`.
501
+
502
+ The default value is 0.5. To enable the cache engine, we must set
503
+ `OLAPCacheEngineSize` > 0 and `dataSync` = 1.
504
+ """
505
+
506
+ parseDecimalAsFloatingNumber: bool = StaticConfigDescriptor(bool, None)
507
+ """
508
+ :meta hide-value:
509
+
510
+ Whether decimal numbers are parsed to Double or Decimal64 type.
511
+
512
+ - If set to `True` (default), decimals are parsed to Double floating point
513
+ numbers.
514
+ - If set to `False`, decimals are parsed to Decimal64 fixed point numbers.
515
+ """
516
+
517
+ persistenceDir: Path = StaticConfigDescriptor(Path, None)
518
+ """
519
+ :meta hide-value:
520
+
521
+ The directory where shared stream tables are persisted to. To enable
522
+ persistence, `persistenceDir` must be specified.
523
+ """
524
+
525
+ # recoveryWorkers: int = DynamicConfigDescriptor(int, None)
526
+ # """
527
+ # :meta hide-value:
528
+ # The number of workers that can be used to recover chunks synchronously in node
529
+ # recovery. The default value is 1.
530
+
531
+ # Notes
532
+ # -----
533
+ # If the number of existing threads is fewer than that of the newly configured
534
+ # threads, the system will create the missing threads. If it is larger, the
535
+ # system will block and reclaim the excess threads.
536
+ # There is no hard upper limit on `recoveryWorkers`, but it is subject to the
537
+ # constraints of the operating system.
538
+ # """
539
+
540
+ regularArrayMemoryLimit: float = StaticConfigDescriptor(float, None)
541
+ """
542
+ :meta hide-value:
543
+
544
+ The limit on the maximum memory size (in MB) of a regular array. Its value must
545
+ be a power of 2. The default value is 2048 (MB).
546
+
547
+ The actual available memory is `min(regularArrayMemoryLimit, maxMemSize/2)`. If
548
+ the memory occupied by an array exceeds this limit, the system will create a big
549
+ array instead.
550
+ """
551
+
552
+ removeSpecialCharInColumnName: bool = StaticConfigDescriptor(bool, False)
553
+ """
554
+ :meta hide-value:
555
+
556
+ Whether to normalize column names.
557
+
558
+ - If set to `False` (default), column names can contain special characters
559
+ (except underscores) or start without letters.
560
+ - If set to `True`, column names are normalized.
561
+ """
562
+
563
+ reservedMemSize: float = DynamicConfigDescriptor(float, None)
564
+ """
565
+ :meta hide-value:
566
+
567
+ A positive number specified in units of GB. When the available memory in
568
+ Swordfish is less than `reservedMemSize`, Swordfish only allocates a memory
569
+ block of limited size (as specified by `maxBlockSizeForReservedMemory`) for each
570
+ memory request.
571
+
572
+ `reservedMemSize` is provided to restrict the memory allocation for each memory
573
+ request to improve the likelihood that there is enough memory for critical
574
+ operations that use a small amount of memory (error reporting, rollbacks, etc.).
575
+
576
+ For example, when data writes fail due to insufficient memory, the transactions
577
+ can be rolled back to guarantee data consistency. If the parameter is not
578
+ specified, the system sets `reservedMemSize` = 5% * `maxMemSize` and
579
+ `reservedMemSize` must be between 64MB and 1GB.
580
+ """
581
+
582
+ stdoutLog: int = StaticConfigDescriptor(int, 1)
583
+ """
584
+ :meta hide-value:
585
+
586
+ Where to output the system log. It can be:
587
+
588
+ - 0: dolphindb.log;
589
+ - 1 (default): stdout;
590
+ - 2: both stdout and dolphindb.log.
591
+ """
592
+
593
+ # strictPermissionMode: bool = StaticConfigDescriptor(bool, True)
594
+ # """
595
+ # :meta hide-value:
596
+ # Whether to enable strict permission mode. The default value is True. Operations
597
+ # such as disk read/write are only allowed for administrators.
598
+
599
+ # Related functions include: `saveTextFile`, `saveAsNpy`, `backup`, `restore`,
600
+ # `restoreDB`, `restoreTable`, `backupDB`, `backupTable`, `migrate`, `file`,
601
+ # `files`, `writeObject`, `readObject`, `loadPlugin`, `close`, `fflush`,
602
+ # `mkdir`, `rmdir`, `rm`, `writeLog`, `run`, `runScript`, `test`, `saveTable`,
603
+ # `savePartition`, `saveDualPartition`, `saveDatabase`, `saveText`,
604
+ # `loadText`, `loadModule`, `saveModule`.
605
+ # """
606
+
607
+ subExecutors: int = StaticConfigDescriptor(int, 8)
608
+ """
609
+ :meta hide-value:
610
+
611
+ The number of message processing threads in the subscriber node. Only when
612
+ subscription is enabled is this parameter relevant.
613
+
614
+ The default value is 8. If it is set to 0, it means the thread can conduct
615
+ message parsing and can also process messages.
616
+ """
617
+
618
+ subThrottle: int = StaticConfigDescriptor(int, 1000)
619
+ """
620
+ :meta hide-value:
621
+
622
+ A non-negative integer in milliseconds, indicating the interval at which the
623
+ system checks whether the `throttle` parameter in the `subscribe` function has
624
+ been reached.The default value is 1000.
625
+
626
+ If the interval specified by the `throttle` parameter in `subscribe` is less
627
+ than `subThrottle`, the `handler` parameter in `subscribe` will be triggered to
628
+ process messages at an interval of `subThrottle`.
629
+
630
+ To set `throttle` to less than 1 second, you need to modify the configuration
631
+ parameter `subThrottle` first. For example, to set `throttle = 0.001` (second),
632
+ please set `subThrottle = 1` first.
633
+
634
+ Notes
635
+ -----
636
+ This parameter is only valid if the parameter `batch_size` is specified in
637
+ function `subscribe`.
638
+ """
639
+
640
+ tcpNoDelay: bool = StaticConfigDescriptor(bool, None)
641
+ """
642
+ :meta hide-value:
643
+
644
+ Whether to enable the `TCP_NODELAY` socket option. The default value is False.
645
+ """
646
+
647
+ tcpUserTimeout: int = StaticConfigDescriptor(int, None)
648
+ """
649
+ :meta hide-value:
650
+
651
+ Set the socket option `TCP_USER_TIMEOUT`. The default value is 300000 (in ms).
652
+ """
653
+
654
+ tempResultsSpillDir: Path = StaticConfigDescriptor(Path, None)
655
+ """
656
+ :meta hide-value:
657
+
658
+ The directory for storing temporary results generated during distributed queries
659
+ when they exceed memory limits. The default directory is `<HomeDir>/tempResults`.
660
+
661
+ Temporary results exceeding the memory limit (specified by
662
+ `memLimitOfAllTempResults`) are spilled to the directory. Files are
663
+ automatically deleted after query completion.
664
+
665
+ Notes
666
+ -----
667
+ This directory is recreated after Swordfish initialization, deleting any
668
+ existing contents.
669
+ """
670
+
671
+ TSDBCacheEngineSize: float = DynamicConfigDescriptor(float, 1)
672
+ """
673
+ :meta hide-value:
674
+
675
+ A positive number indicating the capacity (in GB) of the TSDB cache engine. The
676
+ default value is 1.
677
+
678
+ The memory used by the cache engine may reach twice the set value as an extra
679
+ memoryblock will be allocated to cache the incoming data while data in the
680
+ original memory is being flushed to disk.
681
+
682
+ - If the flush process is not fast enough, the newly allocated memory may also
683
+ reach `TSDBCacheEngineSize` and thus block the writer thread.
684
+ - If the parameter is set too small, data in the cache engine may be flushed to
685
+ disk too frequently, thus affecting the write performance;
686
+ - If set too high, a large volume of cached data is not flushed to disk until it
687
+ reaches `TSDBCacheEngineSize` (or after 10 minutes).
688
+ - If power failure or shutdown occurs in such cases, numerous redo logs are to
689
+ be replayed when the system is restarting, causing a slow startup.
690
+ """
691
+
692
+ tzdb: Path = StaticConfigDescriptor(Path, None)
693
+ """
694
+ :meta hide-value:
695
+
696
+ The directory of the time zone database. The default value is `{package install
697
+ dir}/asset/tzdb`.
698
+ """
699
+
700
+ warningMemSize: float = StaticConfigDescriptor(float, 20)
701
+ """
702
+ :meta hide-value:
703
+
704
+ When memory usage exceeds `warningMemSize` (in units of GB), the system will
705
+ automatically clean up the cache of some databases to avoid OOM exceptions. The
706
+ default value is 20.
707
+ """
708
+
709
+ workerNum: int = StaticConfigDescriptor(int, None)
710
+ """
711
+ :meta hide-value:
712
+
713
+ The size of worker pool for regular interactive jobs. The default value is the
714
+ number of CPU cores.
715
+ """
716
+
717
+ def __setitem__(self, key, value):
718
+ self.config_dict[key].__set__(self, value)
719
+
720
+ def __getitem__(self, key):
721
+ return self.config_dict[key].__get__(self, type(self))
722
+
723
+ def __str__(self):
724
+ max_len = (max([len(k) for k in self.config_dict]) // 5 + 1) * 5
725
+ str_list = [
726
+ f"{k.ljust(max_len)}: {str(v.__get__(self, type(self)))}" for k, v in self.config_dict.items()
727
+ ]
728
+ return "\n".join(str_list)
729
+
730
+ def build(self):
731
+ """Builds a list of command-line arguments based on the configuration.
732
+
733
+ Returns
734
+ -------
735
+ list
736
+ A list of command-line arguments.
737
+ """
738
+
739
+ # step 1: config path [ENV_NAME_CONFIG, ENV_NAME_HOME, CWD]
740
+ config_search_path: List[Path] = []
741
+ if _getenv(ENV_NAME_CONFIG):
742
+ config_search_path.append(_get_absolute_path_env(ENV_NAME_CONFIG))
743
+ if _getenv(ENV_NAME_HOME):
744
+ config_search_path.append(_get_absolute_path_env(ENV_NAME_HOME))
745
+ config_search_path.append(Path(f"{os.getcwd()}"))
746
+
747
+ extra_config = None
748
+
749
+ for path in config_search_path:
750
+ file_path = path / "swordfish.toml" if path.is_dir() else path
751
+ if file_path.exists():
752
+ extra_config = self.read_config_from_toml(file_path)
753
+ break
754
+
755
+ # step 2: home path [ENV_NAME_HOME, config["home"], CWD]
756
+ home_search_path: List[Path] = []
757
+ if _getenv(ENV_NAME_HOME):
758
+ home_search_path.append(_get_absolute_path_env(ENV_NAME_HOME))
759
+ if not self.config_dict["home"].is_default():
760
+ home_search_path.append(self.home)
761
+ home_search_path.append(Path(f"{os.getcwd()}"))
762
+
763
+ assert len(home_search_path) > 0
764
+ self.home = home_search_path[0]
765
+
766
+ # step 3: license path [ENV_NAME_LICENSE, config["license"], home]
767
+ license_search_path: List[Path] = []
768
+ if _getenv(ENV_NAME_LICENSE):
769
+ license_search_path.append(_get_absolute_path_env(ENV_NAME_LICENSE))
770
+ if not self.config_dict["license"].is_default():
771
+ license_search_path.append(self.license)
772
+ license_search_path.append(self.home)
773
+
774
+ for path in license_search_path:
775
+ file_path = path / "dolphindb.lic" if path.is_dir() else path
776
+ if file_path.exists():
777
+ self.license = file_path
778
+ break
779
+
780
+ # step 4: localSite [ENV_NAME_HOST/PORT/ALIAS, config]
781
+ host = _getenv(ENV_NAME_HOST)
782
+ host = extra_config["host"] if host is None and extra_config else host
783
+ host = "0.0.0.0" if host is None else host
784
+
785
+ port = _getenv(ENV_NAME_PORT)
786
+ port = extra_config["port"] if port is None and extra_config else port
787
+ port = get_random_available_port() if port is None else port
788
+
789
+ alias = _getenv(ENV_NAME_ALIAS)
790
+ alias = extra_config["alias"] if alias is None and extra_config else alias
791
+ alias = "default" if alias is None else alias
792
+
793
+ if not sw_is_ce_edition():
794
+ config.localSite = f"{host}:{port}:{alias}"
795
+
796
+ # step 5: extra configs
797
+ args = []
798
+ if _getenv(ENV_NAME_EXTRA):
799
+ args = [v.strip() for v in _getenv(ENV_NAME_EXTRA).split(" ")]
800
+
801
+ if self.config_dict["init"].is_default():
802
+ self.config_dict["init"].init(Path, Path(__file__).parent / "asset" / "dolphindb.dos")
803
+ if self.config_dict["logFile"].is_default():
804
+ self.config_dict["logFile"].init(Path, "dolphindb.log")
805
+ if self.config_dict["marketHolidayDir"].is_default():
806
+ self.config_dict["marketHolidayDir"].init(Path, Path(__file__).parent / "asset" / "marketHoliday")
807
+ if self.config_dict["moduleDir"].is_default():
808
+ self.config_dict["moduleDir"].init(Path, Path(__file__).parent / "asset" / "modules")
809
+ if self.config_dict["tempResultsSpillDir"].is_default():
810
+ self.config_dict["tempResultsSpillDir"].init(Path, "tempResults")
811
+ if self.config_dict["persistenceDir"].is_default():
812
+ self.config_dict["persistenceDir"].init(Path, "persistenceDir")
813
+ if self.config_dict["tzdb"].is_default() and sys.platform.startswith("win"):
814
+ self.config_dict["tzdb"].init(Path, Path(__file__).parent / "asset" / "tzdb")
815
+
816
+ res_list = []
817
+ for name, item in self.config_dict.items():
818
+ value = item.get_value_str()
819
+ if value is not None:
820
+ res_list += [f"-{name}", value]
821
+ return args + res_list
822
+
823
+ def read_config_from_toml(self, file_path: Path):
824
+ def _set_config(_configs: dict, config_name: str, k1: str, k2: str):
825
+ val = _configs.get(k1, dict()).get(k2, None)
826
+ if val is not None:
827
+ setattr(self, config_name, val)
828
+
829
+ configs = toml.load(file_path)
830
+
831
+ _set_config(configs, "home", "initial", "home")
832
+ host = configs.get("initial", dict()).get("host", None)
833
+ port = configs.get("initial", dict()).get("port", None)
834
+ alias = configs.get("initial", dict()).get("alias", None)
835
+
836
+ classify = "initial"
837
+ _set_config(configs, "init", classify, "init")
838
+ _set_config(configs, "license", classify, "license")
839
+ _set_config(configs, "marketHolidayDir", classify, "marketHolidayDir")
840
+ _set_config(configs, "moduleDir", classify, "moduleDir")
841
+ _set_config(configs, "tzdb", classify, "tzdb")
842
+
843
+ classify = "logging"
844
+ _set_config(configs, "stdoutLog", classify, "stdoutLog")
845
+ _set_config(configs, "logFile", classify, "logFile")
846
+ _set_config(configs, "logLevel", classify, "logLevel")
847
+ _set_config(configs, "logRetentionTime", classify, "logRetentionTime")
848
+ _set_config(configs, "maxLogSize", classify, "maxLogSize")
849
+
850
+ classify = "network"
851
+ _set_config(configs, "maxConnections", classify, "maxConnections")
852
+ _set_config(configs, "tcpNoDelay", classify, "tcpNoDelay")
853
+ _set_config(configs, "tcpUserTimeout", classify, "tcpUserTimeout")
854
+
855
+ classify = "behavior"
856
+ _set_config(configs, "decimalRoundingMode", classify, "decimalRoundingMode")
857
+ _set_config(configs, "ignoreSpecialCharacterInPartitionId", classify, "ignoreSpecialCharacterInPartitionId")
858
+ _set_config(configs, "logicOrIgnoreNull", classify, "logicOrIgnoreNull")
859
+ _set_config(configs, "nullAsMinValueForComparison", classify, "nullAsMinValueForComparison")
860
+ _set_config(configs, "parseDecimalAsFloatingNumber", classify, "parseDecimalAsFloatingNumber")
861
+ _set_config(configs, "removeSpecialCharInColumnName", classify, "removeSpecialCharInColumnName")
862
+
863
+ classify = "caching"
864
+ _set_config(configs, "OLAPCacheEngineSize", classify, "OLAPCacheEngineSize")
865
+ _set_config(configs, "TSDBCacheEngineSize", classify, "TSDBCacheEngineSize")
866
+
867
+ classify = "concurrency"
868
+ _set_config(configs, "workerNum", classify, "workerNum")
869
+
870
+ classify = "resource"
871
+ _set_config(configs, "dataSync", classify, "dataSync")
872
+ _set_config(configs, "maxBlockSizeForReservedMemory", classify, "maxBlockSizeForReservedMemory")
873
+ _set_config(configs, "maxMemSize", classify, "maxMemSize")
874
+ _set_config(configs, "regularArrayMemoryLimit", classify, "regularArrayMemoryLimit")
875
+ _set_config(configs, "reservedMemSize", classify, "reservedMemSize")
876
+ _set_config(configs, "warningMemSize", classify, "warningMemSize")
877
+ _set_config(configs, "maxPartitionNumPerQuery", classify, "maxPartitionNumPerQuery")
878
+ _set_config(configs, "memLimitOfAllTempResults", classify, "memLimitOfAllTempResults")
879
+ _set_config(configs, "memLimitOfQueryResult", classify, "memLimitOfQueryResult")
880
+ _set_config(configs, "memLimitOfTaskGroupResult", classify, "memLimitOfTaskGroupResult")
881
+ _set_config(configs, "tempResultsSpillDir", classify, "tempResultsSpillDir")
882
+
883
+ classify = "storage"
884
+ _set_config(configs, "newValuePartitionPolicy", classify, "newValuePartitionPolicy")
885
+
886
+ classify = "streaming"
887
+ _set_config(configs, "maxPubConnections", classify, "maxPubConnections")
888
+ _set_config(configs, "maxSubConnections", classify, "maxSubConnections")
889
+ _set_config(configs, "maxSubQueueDepth", classify, "maxSubQueueDepth")
890
+ _set_config(configs, "persistenceDir", classify, "persistenceDir")
891
+ _set_config(configs, "subExecutors", classify, "subExecutors")
892
+ _set_config(configs, "subThrottle", classify, "subThrottle")
893
+
894
+ return {
895
+ "host": host,
896
+ "port": port,
897
+ "alias": alias,
898
+ }
899
+
900
+
901
+ config = Config()