zhmiscellany 6.3.5__py3-none-any.whl → 6.3.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
zhmiscellany/fileio.py CHANGED
@@ -239,6 +239,16 @@ def cache(function, *args, _cache_compressed=False, **kwargs):
239
239
  except (OSError, TypeError):
240
240
  return str(obj) # Fallback for lambdas/partials
241
241
 
242
+ # DICT-LIKE OBJECTS WITH NON-STRING KEYS (e.g., bidict, defaultdict, etc.)
243
+ # Convert keys to strings to make them JSON-serializable
244
+ if isinstance(obj, dict):
245
+ try:
246
+ # Check if any key is not a string
247
+ if any(not isinstance(k, str) for k in obj.keys()):
248
+ return {str(k): v for k, v in obj.items()}
249
+ except (TypeError, AttributeError):
250
+ pass
251
+
242
252
  # PANDAS DATAFRAMES: Convert to stable dictionary format
243
253
  if hasattr(obj, '__class__') and obj.__class__.__name__ == 'DataFrame':
244
254
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zhmiscellany
3
- Version: 6.3.5
3
+ Version: 6.3.6
4
4
  Summary: A collection of useful/interesting python libraries made by zh.
5
5
  Home-page: https://discord.gg/ThBBAuueVJ
6
6
  Author: zh
@@ -8,7 +8,7 @@ zhmiscellany/_resource_files_lookup.py,sha256=hsgPW0dngokgqWrAVAv5rUo-eobzJPjvWH
8
8
  zhmiscellany/cpp.py,sha256=XEUEoIKCDCdY5VgwNWE5oXrGjtsmGdz_MnaVwQmi2dk,179
9
9
  zhmiscellany/dict.py,sha256=dNu3G9qiJeLgE7JY3QD31GJU7EfLsYPqxf8AOhBsYag,81
10
10
  zhmiscellany/discord.py,sha256=yKoigWI3tONfYSoMEynGGEWW1VsXSRdkg8vPbIKwBNI,20312
11
- zhmiscellany/fileio.py,sha256=9OjWRMqbpLSaCh83axrLjWIIv8RsDOIKeL4rKnRyKqY,22179
11
+ zhmiscellany/fileio.py,sha256=7eMIrLBX69KLdxNbFur8hG16iZkg570LzOGizU2h2s4,22676
12
12
  zhmiscellany/gui.py,sha256=OVwuZ_kWHJlgKPeYR7fAAyomNmU-OnxOgXZelVNPm1w,10409
13
13
  zhmiscellany/image.py,sha256=6Hz5sfym_o7FHokGUKeXRsjl89VY_ZMSLnvuSam1icI,8265
14
14
  zhmiscellany/list.py,sha256=BnbYG-lpHmi0C4v8jLfaeXqQdc3opmNgkvY6yz4pasg,1475
@@ -21,7 +21,7 @@ zhmiscellany/pipes.py,sha256=RlHxsW_M_R6UJUIDgYVS_zfqUwO8kXG8j-0YG5qByjo,4637
21
21
  zhmiscellany/processing.py,sha256=ZhNAJ5OfCUHuaXj0z6XZ94ZGSK86-EdCyqW-9ILayLg,11524
22
22
  zhmiscellany/rust.py,sha256=cHkSpdtq7QQW3yzBEAYL9lZxLW0h4wal2tsxIOnyTrA,494
23
23
  zhmiscellany/string.py,sha256=A4ilBWSYlrJ0AJ0axvepSSjYCYwYk5X-vRrHNphi_ow,4809
24
- zhmiscellany-6.3.5.dist-info/METADATA,sha256=9qnaczarUJXs-eWVHwNvrSlPpDpgAXkcT-18L2bUUuY,43872
25
- zhmiscellany-6.3.5.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
26
- zhmiscellany-6.3.5.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
27
- zhmiscellany-6.3.5.dist-info/RECORD,,
24
+ zhmiscellany-6.3.6.dist-info/METADATA,sha256=HjIrPNfZ5x7q3srMfDGlcC8_Jkl5WWLPLdO-wkRS798,43872
25
+ zhmiscellany-6.3.6.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
26
+ zhmiscellany-6.3.6.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
27
+ zhmiscellany-6.3.6.dist-info/RECORD,,