MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / jupyter_data_dir

Function jupyter_data_dir

pythonFiles/printJupyWidgetEntryPoints.py:72–99  ·  view source on GitHub ↗

Get the config directory for Jupyter data files for this platform and user. These are non-transient, non-configuration files. Returns JUPYTER_DATA_DIR if defined, else a platform-appropriate path.

()

Source from the content-addressed store, hash-verified

70 return pjoin(home_dir, ".jupyter")
71
72 def jupyter_data_dir():
73 """Get the config directory for Jupyter data files for this platform and user.
74
75 These are non-transient, non-configuration files.
76
77 Returns JUPYTER_DATA_DIR if defined, else a platform-appropriate path.
78 """
79 env = __vscode_os.environ
80
81 if env.get("JUPYTER_DATA_DIR"):
82 return env["JUPYTER_DATA_DIR"]
83
84 home = get_home_dir()
85
86 if __vscode_sys.platform == "darwin":
87 return __vscode_os.path.join(home, "Library", "Jupyter")
88 elif __vscode_os.name == "nt":
89 appdata = __vscode_os.environ.get("APPDATA", None)
90 if appdata:
91 return str(__vscode_Path(appdata, "jupyter").resolve())
92 else:
93 return pjoin(jupyter_config_dir(), "data")
94 else:
95 # Linux, non-OS X Unix, AIX, etc.
96 xdg = env.get("XDG_DATA_HOME", None)
97 if not xdg:
98 xdg = pjoin(home, ".local", "share")
99 return pjoin(xdg, "jupyter")
100
101 if __vscode_os.name == "nt":
102 programdata = __vscode_os.environ.get("PROGRAMDATA", None)

Callers 1

jupyter_pathFunction · 0.85

Calls 5

get_home_dirFunction · 0.85
jupyter_config_dirFunction · 0.85
joinMethod · 0.80
getMethod · 0.65
resolveMethod · 0.65

Tested by

no test coverage detected