Buckets:

download
raw
2.76 kB
from __future__ import annotations
from importlib.metadata import version as _version
from typing import TYPE_CHECKING
__version__ = _version("calkit-python")
from .core import * # noqa: F403, I001
if TYPE_CHECKING:
from calkit import ( # noqa: F401
calc,
conda,
config,
datasets,
dependencies,
detect,
docker,
dvc,
environments,
fs,
git,
github,
gui,
hub,
install,
invenio,
julia,
jupyter,
licenses,
magics,
matlab,
models,
notebooks,
office,
ops,
overleaf,
pipeline,
procedures,
provenance,
releases,
reproducibility,
resources,
schema,
server,
templates,
)
from .notebooks import declare_notebook # noqa: F401
# Lazy-load submodules to speed up imports
_SUBMODULES = {
"git",
"dvc",
"hub",
"fs",
"jupyter",
"config",
"models",
"office",
"templates",
"conda",
"calc",
"procedures",
"provenance",
"reproducibility",
"github",
"invenio",
"releases",
"resources",
"licenses",
"overleaf",
"julia",
"notebooks",
"environments",
"pipeline",
"matlab",
"datasets",
"dependencies",
"detect",
"docker",
"gui",
"install",
"magics",
"ops",
"schema",
"server",
}
def __getattr__(name: str):
if name in _SUBMODULES:
import importlib
mod = importlib.import_module(f"calkit.{name}")
globals()[name] = mod
return mod
if name == "declare_notebook":
from .notebooks import declare_notebook
globals()["declare_notebook"] = declare_notebook
return declare_notebook
raise AttributeError(f"module 'calkit' has no attribute {name!r}")
def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": "calkit"}]
def _jupyter_server_extension_points():
return [{"module": "calkit"}]
def _load_jupyter_server_extension(server_app):
"""Registers the API handler to receive HTTP requests from the frontend
extension.
Parameters
----------
server_app: jupyterlab.labapp.LabApp
JupyterLab application instance
"""
import os
from .jupyterlab.routes import setup_route_handlers
# Change to root_dir so all handlers work in the correct directory context
root_dir = server_app.root_dir
os.chdir(root_dir)
server_app.log.info(f"Changed working directory to {root_dir}")
setup_route_handlers(server_app.web_app)
name = "calkit"
server_app.log.info(f"Registered {name} server extension")

Xet Storage Details

Size:
2.76 kB
·
Xet hash:
c8636521c1923701a5b6bc7ffb59f2ee370fce5064e15dbe17308bdabaa3fbbd

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.