py2ls 0.1.4.5__tar.gz → 0.1.4.7__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 (115) hide show
  1. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/PKG-INFO +1 -1
  2. py2ls-0.1.4.7/py2ls/.git/COMMIT_EDITMSG +1 -0
  3. py2ls-0.1.4.7/py2ls/.git/FETCH_HEAD +1 -0
  4. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/index +0 -0
  5. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/logs/HEAD +1 -0
  6. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/logs/refs/heads/main +1 -0
  7. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/logs/refs/remotes/origin/HEAD +1 -0
  8. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/logs/refs/remotes/origin/main +1 -0
  9. py2ls-0.1.4.7/py2ls/.git/objects/6a/52e747a2b349b128d1490d9e896d2323818eb7 +0 -0
  10. py2ls-0.1.4.7/py2ls/.git/objects/71/36b2074a2754be8b58127d82250e5b37e3c373 +0 -0
  11. py2ls-0.1.4.7/py2ls/.git/objects/c1/20fc812b9ad311c34a3608512d6a9d976bb48e +0 -0
  12. py2ls-0.1.4.7/py2ls/.git/objects/db/141dbaa93594df2a8156182f361ee4db829359 +0 -0
  13. py2ls-0.1.4.7/py2ls/.git/refs/heads/main +1 -0
  14. py2ls-0.1.4.7/py2ls/.git/refs/remotes/origin/main +1 -0
  15. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/ips.py +99 -3
  16. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/pyproject.toml +1 -1
  17. py2ls-0.1.4.5/py2ls/.git/COMMIT_EDITMSG +0 -1
  18. py2ls-0.1.4.5/py2ls/.git/FETCH_HEAD +0 -1
  19. py2ls-0.1.4.5/py2ls/.git/refs/heads/main +0 -1
  20. py2ls-0.1.4.5/py2ls/.git/refs/remotes/origin/main +0 -1
  21. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/README.md +0 -0
  22. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.DS_Store +0 -0
  23. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/HEAD +0 -0
  24. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/config +0 -0
  25. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/description +0 -0
  26. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/applypatch-msg.sample +0 -0
  27. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/commit-msg.sample +0 -0
  28. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/fsmonitor-watchman.sample +0 -0
  29. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/post-update.sample +0 -0
  30. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/pre-applypatch.sample +0 -0
  31. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/pre-commit.sample +0 -0
  32. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/pre-merge-commit.sample +0 -0
  33. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/pre-push.sample +0 -0
  34. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/pre-rebase.sample +0 -0
  35. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/pre-receive.sample +0 -0
  36. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/prepare-commit-msg.sample +0 -0
  37. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/push-to-checkout.sample +0 -0
  38. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/hooks/update.sample +0 -0
  39. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/info/exclude +0 -0
  40. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/0b/409e1bc918277010f5679b402d1d1dda53e15c +0 -0
  41. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/14/449a0e6ba4ea2f1a73acf63ef91c9c6193f9ed +0 -0
  42. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/15/a8e468aacfcb440e090020f36d0b985d45da23 +0 -0
  43. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/1a/b4585881a6a42889f01aa0cfe25fd5acfaf46f +0 -0
  44. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/1d/fe9d9633b24ea560354f4f93d39c6e5f163ea0 +0 -0
  45. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/24/6b368b986f758630c46dc02b7fa512b53422f7 +0 -0
  46. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/25/b796accd261b9135fd32a2c00785f68edf6c46 +0 -0
  47. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/30/a2f8da47ee947811dc8d993f5a06a45de374f4 +0 -0
  48. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/36/b4a1b7403abc6c360f8fe2cb656ab945254971 +0 -0
  49. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/36/e56a361f526eafa59c5235a5c990bf288b5f9c +0 -0
  50. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/36/ef43e50009e59db11812c258846d9e38718173 +0 -0
  51. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/3b/bd972aa7ad680858f8dfbd0f7fcd97756f0d6f +0 -0
  52. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/3c/bbe5f4173d165127b9ad96119f1ec24c306ffc +0 -0
  53. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/3f/d6561300938afbb3d11976cf9c8f29549280d9 +0 -0
  54. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/43/dbd49b2ee367c5434dd545e3b5795434f2ef0b +0 -0
  55. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/48/a88fc5806305d0bb0755ee6801161b79696972 +0 -0
  56. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/50/08ddfcf53c02e82d7eee2e57c38e5672ef89f6 +0 -0
  57. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/53/e0deb1cb4c2c606bced6e7f9a66b0fda60980d +0 -0
  58. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/56/e4e8b2d5545e0256090f45aa8fc42c5fe067d0 +0 -0
  59. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/58/20a729045d4dc7e37ccaf8aa8eec126850afe2 +0 -0
  60. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/60/f273eb1c412d916fa3f11318a7da7a9911b52a +0 -0
  61. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/61/570cec8c061abe74121f27f5face6c69b98f99 +0 -0
  62. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/62/7c81b23b4e56e87b042b650b0103653cc9e34a +0 -0
  63. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/62/d90ccf8cbefdc2e4fd475e7c6f4f76e9fdf801 +0 -0
  64. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/64/27a4edff08f93d98f511418423f09f2ab90bcd +0 -0
  65. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/69/13c452ca319f7cbf6a0836dc10a5bb033c84e4 +0 -0
  66. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/6b/7fde264d93a7a0986d394c46c7650d0ce2ab92 +0 -0
  67. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/6c/cebb29b7f3f5b0c889f6dadbf9ff066554587d +0 -0
  68. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/78/3d4167bc95c9d2175e0df03ef1c1c880ba75ab +0 -0
  69. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/79/7ae089b2212a937840e215276005ce76881307 +0 -0
  70. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/7e/5956c806b5edc344d46dab599dec337891ba1f +0 -0
  71. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/81/8f26b7bf042269729020cf944fc362d66ba27e +0 -0
  72. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/84/59071b722a255b774a80b27746033f8141ab39 +0 -0
  73. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/87/ef1fc3f7f1ddc4d0ab9b3e65381ce9f3388621 +0 -0
  74. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/8b/84f56978e1de8f2ae82abce5f8b3e182d365cd +0 -0
  75. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/8e/55a7d2b96184030211f20c9b9af201eefcac82 +0 -0
  76. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/91/c69ad88fe0ba94aa7859fb5f7edac5e6f1a3f7 +0 -0
  77. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/9d/0df52899fe95279059286d9c0ec42287edc168 +0 -0
  78. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/a5/ec8f74642fbba27f7ea78c53b372ae0c7dedce +0 -0
  79. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/a7/3e13eafee65c5b8d73ad2d3ea46d0eee82f0d3 +0 -0
  80. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/b0/56be4be89ba6b76949dd641df45bb7036050c8 +0 -0
  81. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/b0/9cd7856d58590578ee1a4f3ad45d1310a97f87 +0 -0
  82. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/b2/18e6a0f0f1c4df8cdefa9852058348abc713b7 +0 -0
  83. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/b5/61831c7dce8ea51e7ee6b6fa35745f14d8242d +0 -0
  84. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/bb/934eb33bc1a8b85630bf680caffd99560c1b8f +0 -0
  85. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/c4/cba65f1163661999ee4b8ed23342b63bc1300c +0 -0
  86. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/c6/7f17e5707313600efcb85e9a3fedea35dba591 +0 -0
  87. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/cf/0c0d9c6fb09473aaeb7f7e2edbd770c3f2ef3d +0 -0
  88. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/d6/9ab1c4aadf279936dd778e8346ba60f74705b6 +0 -0
  89. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/d9/005f2cc7fc4e65f14ed5518276007c08cf2fd0 +0 -0
  90. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/d9/c2403fd166ce791b4e9d0c6792ed8342c71fcd +0 -0
  91. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/d9/dfa5aee51e92a541b707e8e7baea6f06deff98 +0 -0
  92. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/db/ffa8ea7bda721d0cee7b9e4ce5b2ef927733ff +0 -0
  93. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/df/e0770424b2a19faf507a501ebfc23be8f54e7b +0 -0
  94. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/e3/1356f90ea6dd0577b5e0b40b206319adcbf085 +0 -0
  95. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/e3/5a4dafc50850cacac7bf76c56db2715cbda2c4 +0 -0
  96. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/e9/391ffe371f1cc43b42ef09b705d9c767c2e14f +0 -0
  97. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/f4/b64d3107b39e3ad6f540c6607004ea34e6c024 +0 -0
  98. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/f7/c98ba5c2f903e603b1f5e63d49fbc8a43815cc +0 -0
  99. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/fa/147e6bb78a2e8db241d231295fd7f1ed061af8 +0 -0
  100. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/objects/fc/292e793ecfd42240ac43be407023bd731fa9e7 +0 -0
  101. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.git/refs/remotes/origin/HEAD +0 -0
  102. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.gitattributes +0 -0
  103. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/.gitignore +0 -0
  104. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/LICENSE +0 -0
  105. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/README.md +0 -0
  106. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/__init__.py +0 -0
  107. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/brain_atlas.py +0 -0
  108. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/correlators.py +0 -0
  109. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/dbhandler.py +0 -0
  110. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/freqanalysis.py +0 -0
  111. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/netfinder.py +0 -0
  112. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/setuptools-70.1.0-py3-none-any.whl +0 -0
  113. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/sleep_events_detectors.py +0 -0
  114. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/translator.py +0 -0
  115. {py2ls-0.1.4.5 → py2ls-0.1.4.7}/py2ls/wb_detector.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2ls
3
- Version: 0.1.4.5
3
+ Version: 0.1.4.7
4
4
  Summary: py(thon)2(too)ls
5
5
  Author: Jianfeng
6
6
  Author-email: Jianfeng.Liu0413@gmail.com
@@ -0,0 +1 @@
1
+ update
@@ -0,0 +1 @@
1
+ c120fc812b9ad311c34a3608512d6a9d976bb48e branch 'main' of https://github.com/Jianfengliu0413/py2ls
@@ -12,3 +12,4 @@ cf0c0d9c6fb09473aaeb7f7e2edbd770c3f2ef3d 6427a4edff08f93d98f511418423f09f2ab90bc
12
12
  d9dfa5aee51e92a541b707e8e7baea6f06deff98 e31356f90ea6dd0577b5e0b40b206319adcbf085 Jianfeng <Jianfeng.Liu0413@gmail.com> 1718618413 +0200 commit: add thumbnail
13
13
  e31356f90ea6dd0577b5e0b40b206319adcbf085 1ab4585881a6a42889f01aa0cfe25fd5acfaf46f Jianfeng <Jianfeng.Liu0413@gmail.com> 1718619568 +0200 commit: Update ips.py
14
14
  1ab4585881a6a42889f01aa0cfe25fd5acfaf46f 627c81b23b4e56e87b042b650b0103653cc9e34a Jianfeng <Jianfeng.Liu0413@gmail.com> 1718698925 +0200 commit: update xample_imgsets
15
+ 627c81b23b4e56e87b042b650b0103653cc9e34a c120fc812b9ad311c34a3608512d6a9d976bb48e Jianfeng <Jianfeng.Liu0413@gmail.com> 1718893141 +0200 commit: update
@@ -12,3 +12,4 @@ cf0c0d9c6fb09473aaeb7f7e2edbd770c3f2ef3d 6427a4edff08f93d98f511418423f09f2ab90bc
12
12
  d9dfa5aee51e92a541b707e8e7baea6f06deff98 e31356f90ea6dd0577b5e0b40b206319adcbf085 Jianfeng <Jianfeng.Liu0413@gmail.com> 1718618413 +0200 commit: add thumbnail
13
13
  e31356f90ea6dd0577b5e0b40b206319adcbf085 1ab4585881a6a42889f01aa0cfe25fd5acfaf46f Jianfeng <Jianfeng.Liu0413@gmail.com> 1718619568 +0200 commit: Update ips.py
14
14
  1ab4585881a6a42889f01aa0cfe25fd5acfaf46f 627c81b23b4e56e87b042b650b0103653cc9e34a Jianfeng <Jianfeng.Liu0413@gmail.com> 1718698925 +0200 commit: update xample_imgsets
15
+ 627c81b23b4e56e87b042b650b0103653cc9e34a c120fc812b9ad311c34a3608512d6a9d976bb48e Jianfeng <Jianfeng.Liu0413@gmail.com> 1718893141 +0200 commit: update
@@ -35,3 +35,4 @@ e31356f90ea6dd0577b5e0b40b206319adcbf085 e31356f90ea6dd0577b5e0b40b206319adcbf08
35
35
  1ab4585881a6a42889f01aa0cfe25fd5acfaf46f 1ab4585881a6a42889f01aa0cfe25fd5acfaf46f Jianfeng Liu <macjianfeng@JFLMBP.local> 1718705358 +0200 remote set-head
36
36
  1ab4585881a6a42889f01aa0cfe25fd5acfaf46f 1ab4585881a6a42889f01aa0cfe25fd5acfaf46f Jianfeng Liu <macjianfeng@JFLMBP.local> 1718707170 +0200 remote set-head
37
37
  1ab4585881a6a42889f01aa0cfe25fd5acfaf46f 1ab4585881a6a42889f01aa0cfe25fd5acfaf46f Jianfeng Liu <macjianfeng@JFLMBP.local> 1718708982 +0200 remote set-head
38
+ c120fc812b9ad311c34a3608512d6a9d976bb48e c120fc812b9ad311c34a3608512d6a9d976bb48e Jianfeng Liu <macjianfeng@JFLMBP.cin.medizin.uni-tuebingen.de> 1718893145 +0200 remote set-head
@@ -11,3 +11,4 @@ cf0c0d9c6fb09473aaeb7f7e2edbd770c3f2ef3d 6427a4edff08f93d98f511418423f09f2ab90bc
11
11
  6427a4edff08f93d98f511418423f09f2ab90bcd d9dfa5aee51e92a541b707e8e7baea6f06deff98 Jianfeng <Jianfeng.Liu0413@gmail.com> 1718570102 +0200 update by push
12
12
  d9dfa5aee51e92a541b707e8e7baea6f06deff98 e31356f90ea6dd0577b5e0b40b206319adcbf085 Jianfeng <Jianfeng.Liu0413@gmail.com> 1718618415 +0200 update by push
13
13
  e31356f90ea6dd0577b5e0b40b206319adcbf085 1ab4585881a6a42889f01aa0cfe25fd5acfaf46f Jianfeng <Jianfeng.Liu0413@gmail.com> 1718619570 +0200 update by push
14
+ 1ab4585881a6a42889f01aa0cfe25fd5acfaf46f c120fc812b9ad311c34a3608512d6a9d976bb48e Jianfeng <Jianfeng.Liu0413@gmail.com> 1718893144 +0200 update by push
@@ -0,0 +1 @@
1
+ c120fc812b9ad311c34a3608512d6a9d976bb48e
@@ -0,0 +1 @@
1
+ c120fc812b9ad311c34a3608512d6a9d976bb48e
@@ -4,7 +4,7 @@ import pandas as pd
4
4
  import json
5
5
  import matplotlib.pyplot as plt
6
6
  import seaborn as sns
7
- import scienceplots
7
+ # import scienceplots
8
8
  import matplotlib
9
9
  import sys
10
10
  import os
@@ -37,17 +37,113 @@ from numerizer import numerize
37
37
  from tqdm import tqdm
38
38
  import mimetypes
39
39
  from pprint import pp
40
+ from dateutil import parser
41
+ from datetime import datetime
42
+
43
+ def is_num(s):
44
+ """
45
+ Check if a string can be converted to a number (int or float).
46
+ Parameters:
47
+ - s (str): The string to check.
48
+ Returns:
49
+ - bool: True if the string can be converted to a number, False otherwise.
50
+ """
51
+ try:
52
+ float(s) # Try converting the string to a float
53
+ return True
54
+ except ValueError:
55
+ return False
56
+ def isnum(s):
57
+ return is_num(s)
58
+
59
+ def str2time(time_str, fmt='24'):
60
+ """
61
+ Convert a time string into the specified format.
62
+ Parameters:
63
+ - time_str (str): The time string to be converted.
64
+ - fmt (str): The format to convert the time to. Defaults to '%H:%M:%S'.
65
+ Returns:
66
+ %I represents the hour in 12-hour format.
67
+ %H represents the hour in 24-hour format (00 through 23).
68
+ %M represents the minute.
69
+ %S represents the second.
70
+ %p represents AM or PM.
71
+ - str: The converted time string.
72
+ """
73
+ def time_len_corr(time_str):
74
+ time_str_= ssplit(time_str,by=[':'," ","digital_num"]) if ':' in time_str else None
75
+ time_str_split=[]
76
+ [time_str_split.append(i) for i in time_str_ if is_num(i)]
77
+ if time_str_split:
78
+ if len(time_str_split)==2:
79
+ H,M=time_str_split
80
+ time_str_full=H+":"+M+":00"
81
+ elif len(time_str_split)==3:
82
+ H,M,S=time_str_split
83
+ time_str_full=H+":"+M+":"+S
84
+
85
+ if 'am' in time_str.lower():
86
+ time_str_full+=" AM"
87
+ elif "pm"in time_str.lower():
88
+ time_str_full +=" PM"
89
+ return time_str_full
90
+ if '12' in fmt:
91
+ fmt = "%I:%M:%S %p"
92
+ elif '24' in fmt:
93
+ fmt = "%H:%M:%S"
94
+
95
+ try:
96
+ # Try to parse the time string assuming it could be in 24-hour or 12-hour format
97
+ time_obj = datetime.strptime(time_str, '%H:%M:%S')
98
+ except ValueError:
99
+ try:
100
+ time_obj = datetime.strptime(time_str, '%I:%M:%S %p')
101
+ except ValueError as e:
102
+ raise ValueError(f"Unable to parse time string: {time_str}. Error: {e}")
103
+
104
+ # Format the time object to the desired output format
105
+ formatted_time = time_obj.strftime(fmt)
106
+ return formatted_time
107
+
108
+ # # Example usage:
109
+ # time_str1 = "14:30:45"
110
+ # time_str2 = "02:30:45 PM"
111
+
112
+ # formatted_time1 = str2time(time_str1, fmt='12') # Convert to 12-hour format
113
+ # formatted_time2 = str2time(time_str2, fmt='24') # Convert to 24-hour format
114
+
115
+ # print(formatted_time1) # Output: 02:30:45 PM
116
+ # print(formatted_time2) # Output: 14:30:45
117
+
118
+ def str2date(date_str, fmt='%Y-%m-%d_%H:%M:%S'):
119
+ """
120
+ Convert a date string into the specified format.
121
+ Parameters:
122
+ - date_str (str): The date string to be converted.
123
+ - fmt (str): The format to convert the date to. Defaults to '%Y%m%d'.
124
+ Returns:
125
+ - str: The converted date string.
126
+ """
127
+ try:
128
+ date_obj = parser.parse(date_str)
129
+ except ValueError as e:
130
+ raise ValueError(f"Unable to parse date string: {date_str}. Error: {e}")
131
+ # Format the date object to the desired output format
132
+ formatted_date = date_obj.strftime(fmt)
133
+ return formatted_date
134
+ # str1=str2date(num2str(20240625),fmt="%a %d-%B-%Y")
135
+ # print(str1)
136
+ # str2=str2num(str2date(str1,fmt='%a %Y%m%d'))
137
+ # print(str2)
40
138
 
41
139
  def str2num(s, *args):
42
140
  delimiter = None
43
141
  round_digits = None
44
-
45
142
  for arg in args:
46
143
  if isinstance(arg, str):
47
144
  delimiter = arg
48
145
  elif isinstance(arg, int):
49
146
  round_digits = arg
50
-
51
147
  try:
52
148
  num = int(s)
53
149
  except ValueError:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "py2ls"
3
- version = "0.1.4.5"
3
+ version = "0.1.4.7"
4
4
  description = "py(thon)2(too)ls"
5
5
  authors = ["Jianfeng <Jianfeng.Liu0413@gmail.com>"]
6
6
  readme = "README.md"
@@ -1 +0,0 @@
1
- update xample_imgsets
@@ -1 +0,0 @@
1
- 1ab4585881a6a42889f01aa0cfe25fd5acfaf46f branch 'main' of https://github.com/Jianfengliu0413/py2ls
@@ -1 +0,0 @@
1
- 627c81b23b4e56e87b042b650b0103653cc9e34a
@@ -1 +0,0 @@
1
- 1ab4585881a6a42889f01aa0cfe25fd5acfaf46f
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes