forked from datacamp/pythonwhat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconverters.py
More file actions
22 lines (18 loc) · 721 Bytes
/
Copy pathconverters.py
File metadata and controls
22 lines (18 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import inspect
import pythonwhat
def get_manual_converters():
converters = {
"pandas.io.excel.ExcelFile": lambda x: x.io,
"builtins.dict_keys": lambda x: sorted(x),
"builtins.dict_items": lambda x: sorted(x),
"bs4.BeautifulSoup": lambda x: str(x),
"bs4.element.Tag": lambda x: str(x),
"bs4.element.NavigableString": lambda x: str(x),
"bs4.element.ResultSet": lambda x: [str(res) for res in x],
"h5py._hl.files.File": lambda x: x.file.filename,
"h5py._hl.group.Group": lambda x: x.file.filename
+ "_"
+ str([x for x in x.keys()]),
"sqlalchemy.engine.base.Engine": lambda x: x.url.database,
}
return converters