How to use the jupyter-paths.dataDirs function in jupyter-paths

To help you get started, we’ve selected a few jupyter-paths examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nteract / kernelspecs / lib / traverse.js View on Github external
function findAll() {
  return jp.dataDirs({ withSysPrefix: true }).then(dirs => {
    return Promise.all(dirs
      // get kernel infos for each directory and ignore errors
      .map(dir => getKernelInfos(path.join(dir, 'kernels')).catch(() => {}))
    ).then(extractKernelResources)
  });
}
github nteract / kernelspecs / lib / traverse.js View on Github external
function find(kernelName) {
  return jp.dataDirs({ withSysPrefix: true }).then(dirs => {

    const kernelInfos = dirs.map(dir => ({
      name: kernelName,
      resourceDir: path.join(dir, 'kernels', kernelName),
    }))

    return extractKernelResources(kernelInfos);
  }).then(kernelResource => kernelResource[kernelName])
}

jupyter-paths

Node wrapping of jupyter/jupyter_core to resolve paths across Jupyter installations.

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

49 / 100
Full package analysis