MeUtils 2025.6.13.10.18.19__py3-none-any.whl → 2025.6.13.20.54.5__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.
@@ -52,7 +52,12 @@ def json_loads(s):
52
52
 
53
53
 
54
54
  def json_path(obj, expr): # todo: 缓存
55
- """$..["keywords","query","search_result"]"""
55
+ """
56
+ $..["keywords","query","search_result"]
57
+
58
+ python => $..[keywords,query,search_result]
59
+
60
+ """
56
61
  if isinstance(obj, dict):
57
62
  pass
58
63
  elif isinstance(obj, str):
@@ -76,47 +81,20 @@ if __name__ == '__main__':
76
81
  a: int = 1
77
82
 
78
83
 
79
- print(json_path(A(), '$.a'))
80
-
81
- json2class(
82
- {
83
- "id": 3323,
84
- "type": 1,
85
- "key": "20c790a8-8f5b-4382-942f-05d6f93ce04d:c3ceee990d5aae3f99084e7da6fa7c98",
86
- "access_token": "",
87
- "openai_organization": "",
88
- "test_model": "",
89
- "status": 1,
90
- "name": "fal-flux",
91
- "weight": 0,
92
- "created_time": 1749175121,
93
- "test_time": 0,
94
- "response_time": 0,
95
- "base_url": "https://openai.chatfire.cn/images",
96
- "other": "",
97
- "balance": 0,
98
- "balance_updated_time": 0,
99
- "models": "imagen4,recraft-v3,recraftv3,flux-pro-1.1-ultra,flux-kontext-pro,flux-kontext-max",
100
- "group": "default",
101
- "used_quota": 9927600,
102
- "upstream_user_quota": 0,
103
- "model_mapping": "{\n \"flux-pro-1.1-ultra\": \"fal-ai/flux-pro/v1.1-ultra\",\n \"ideogram-ai/ideogram-v2-turbo\": \"fal-ai/ideogram/v2/turbo\",\n \"ideogram-ai/ideogram-v2\": \"fal-ai/ideogram/v2\",\n \"recraftv3\": \"fal-ai/recraft-v3\",\n \"recraft-v3\": \"fal-ai/recraft-v3\",\n \"imagen4\": \"fal-ai/imagen4/preview\",\n \"flux-kontext-pro\": \"fal-ai/flux-pro/kontext\",\n \"flux-kontext-max\": \"fal-ai/flux-pro/kontext/max\",\n \"imagen4,recraft-v3,recraftv3,flux-pro-1.1-ultra,flux-kontext-pro,flux-kontext-max\": \"\"\n}",
104
- "headers": "",
105
- "status_code_mapping": "",
106
- "priority": 1,
107
- "auto_ban": 1,
108
- "empty_response_retry": 0,
109
- "not_use_key": 0,
110
- "remark": "",
111
- "mj_relax_limit": 99,
112
- "mj_fast_limit": 99,
113
- "mj_turbo_limit": 99,
114
- "other_info": "{\"status_reason\":\"model: flux-kontext-max, status code: 500, reason: Failed to generate image: User is locked. Reason: Exhausted balance. Top up your balance at fal.ai/dashboard/billing.\",\"status_time\":1749175757}",
115
- "channel_ratio": 1,
116
- "error_return_429": 0,
117
- "tag": "fal",
118
- "setting": "",
119
- "param_override": "",
120
- "is_tools": True
121
- }
122
- )
84
+ data = {
85
+ "id": "cgt-20250613173405-qnpqg",
86
+ "model": "doubao-seedance-1-0-pro-250528",
87
+ "status": "succeeded",
88
+ "content": {
89
+ "video_url": "https://ark-content-generation-cn-beijing.tos-cn-beijing.volces.com/doubao-seedance-1-0-pro/02174980724664200000000000000000000ffffac182c177b9d12.mp4?X-Tos-Algorithm=TOS4-HMAC-SHA256&X-Tos-Credential=AKLTYjg3ZjNlOGM0YzQyNGE1MmI2MDFiOTM3Y2IwMTY3OTE%2F20250613%2Fcn-beijing%2Ftos%2Frequest&X-Tos-Date=20250613T093454Z&X-Tos-Expires=86400&X-Tos-Signature=bc080dc9e02282dbe10c82e04c59ac1ed4afb67cbec8aa0506357540f9d47fc4&X-Tos-SignedHeaders=host"
90
+ },
91
+ "usage": {
92
+ "completion_tokens": 245388,
93
+ "total_tokens": 245388
94
+ },
95
+ "created_at": 1749807246,
96
+ "updated_at": 1749807294
97
+ }
98
+
99
+
100
+ print(json_path(data, expr='$..[url,image_url,video_url]'))