mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
15 lines
260 B
Python
15 lines
260 B
Python
import json
|
|
import re
|
|
|
|
from bson import json_util
|
|
|
|
|
|
def is_object_id(id):
|
|
return re.search('^[a-zA-Z0-9]{24}$', id) is not None
|
|
|
|
|
|
def jsonify(obj: dict):
|
|
dump_str = json_util.dumps(obj)
|
|
converted_obj = json.loads(dump_str)
|
|
return converted_obj
|