colabcode
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: colabcode | ||
| Version: 0.1.2 | ||
| Version: 0.2.0 | ||
| Summary: ColabCode - Run codeserver on Colab! | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/abhishekkrthakur/colabcode |
| pyngrok>=5.0.0 | ||
| nest_asyncio==1.4.3 | ||
| uvicorn==0.13.1 | ||
| jupyterlab==3.0.7 |
+34
-1
| import os | ||
| import subprocess | ||
| import uuid | ||
@@ -23,3 +24,9 @@ import nest_asyncio | ||
| def __init__( | ||
| self, port=10000, password=None, authtoken=None, mount_drive=False, code=True | ||
| self, | ||
| port=10000, | ||
| password=None, | ||
| authtoken=None, | ||
| mount_drive=False, | ||
| code=True, | ||
| lab=False, | ||
| ): | ||
@@ -31,2 +38,6 @@ self.port = port | ||
| self._code = code | ||
| self._lab = lab | ||
| if self._lab: | ||
| self._start_server() | ||
| self._run_lab() | ||
| if self._code: | ||
@@ -66,2 +77,24 @@ self._install_code() | ||
| def _run_lab(self): | ||
| token = str(uuid.uuid1()) | ||
| print(f"Jupyter lab token: {token}") | ||
| base_cmd = "jupyter-lab --ip='localhost' --allow-root --ServerApp.allow_remote_access=True --no-browser" | ||
| os.system(f"fuser -n tcp -k {self.port}") | ||
| if self._mount and colab_env: | ||
| drive.mount("/content/drive") | ||
| if self.password: | ||
| lab_cmd = f" --ServerApp.token='{token}' --ServerApp.password='{self.password}' --port {self.port}" | ||
| else: | ||
| lab_cmd = f" --ServerApp.token='{token}' --ServerApp.password='' --port {self.port}" | ||
| lab_cmd = base_cmd + lab_cmd | ||
| with subprocess.Popen( | ||
| [lab_cmd], | ||
| shell=True, | ||
| stdout=subprocess.PIPE, | ||
| bufsize=1, | ||
| universal_newlines=True, | ||
| ) as proc: | ||
| for line in proc.stdout: | ||
| print(line, end="") | ||
| def _run_code(self): | ||
@@ -68,0 +101,0 @@ os.system(f"fuser -n tcp -k {self.port}") |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: colabcode | ||
| Version: 0.1.2 | ||
| Version: 0.2.0 | ||
| Summary: ColabCode - Run codeserver on Colab! | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/abhishekkrthakur/colabcode |
+7
-2
@@ -12,3 +12,3 @@ from setuptools import Extension, find_packages, setup | ||
| scripts=["scripts/colabcode"], | ||
| version="0.1.2", | ||
| version="0.2.0", | ||
| description="ColabCode - Run codeserver on Colab!", | ||
@@ -23,5 +23,10 @@ long_description=long_description, | ||
| include_package_data=True, | ||
| install_requires=["pyngrok>=5.0.0", "nest_asyncio==1.4.3", "uvicorn==0.13.1"], | ||
| install_requires=[ | ||
| "pyngrok>=5.0.0", | ||
| "nest_asyncio==1.4.3", | ||
| "uvicorn==0.13.1", | ||
| "jupyterlab==3.0.7", | ||
| ], | ||
| platforms=["linux", "unix"], | ||
| python_requires=">3.5.2", | ||
| ) |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
13670
9.41%131
39.36%