MCPcopy Create free account
hub / github.com/nlweb-ai/NLWeb / clean_json_string

Function clean_json_string

AskAgent/python/data_loading/process_rss_by_org.py:49–56  ·  view source on GitHub ↗

Remove newlines from JSON string

(obj)

Source from the content-addressed store, hash-verified

47 return org_name
48
49def clean_json_string(obj):
50 """Remove newlines from JSON string"""
51 json_str = json.dumps(obj, ensure_ascii=False, separators=(',', ':'))
52 # Remove any newlines that might be in the content
53 json_str = json_str.replace('\n', ' ').replace('\r', ' ')
54 # Clean up multiple spaces
55 json_str = ' '.join(json_str.split())
56 return json_str
57
58def transform_episode(item, podcast_info):
59 """Transform a single episode to match the expected format"""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected