# SparkConnector
Helper to connect to CERN's Spark Clusters
This extension is built as a Python module named `sparkconnector`, which simplifies the connection to Spark clusters.
It installs:
1. an nbclassic-extension
1. a Jupyterlab extension
1. an iPython extension
## Requirements
- JupyterLab >= 4.0.0
- pyspark (not installed by default)
## Install
To install the extension, execute:
```bash
pip install sparkconnector
jupyter nbclassic-extension install sparkconnector --py
jupyter nbclassic-extension enable sparkconnector --py
```
It is also necessary to enable the iPython code. Append the following code to the config file (usually in `~/.ipython/profile_default/ipython_kernel_config.py`, check [here](https://ipython.readthedocs.io/en/stable/config/intro.html#python-configuration-files)):
```bash
c.InteractiveShellApp.extensions.append('sparkconnector.connector')
```
## Uninstall
To remove the extension, execute:
```bash
pip uninstall sparkconnector
```
## Contributing
### Development install
Note: You will need NodeJS to build the extension package.
The `jlpm` command is JupyterLab's pinned version of
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
`yarn` or `npm` in lieu of `jlpm` below.
```bash
# Clone the repo to your local environment
# Change directory to the sparkconnector directory
# Install package in development mode
pip install -e "."
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm build
```
You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
```bash
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab
```
With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
```bash
jupyter lab build --minimize=False
```
### Development uninstall
```bash
pip uninstall sparkconnector
```
In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
folder is located. Then you can remove the symlink named `@swan-cern/sparkconnector` within that folder.
### Packaging the extension
See [RELEASE](RELEASE.md)
Raw data
{
"_id": null,
"home_page": "https://github.com/swan-cern/jupyter-extensions",
"name": "sparkconnector",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "Jupyter, JupyterLab, SWAN, CERN",
"author": "SWAN Admins",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/8d/67/ea6b328ff701d6d5345517b36c2f51c1bb6b567470986b8b40dc3ee85bb8/sparkconnector-3.0.5.tar.gz",
"platform": "Linux",
"description": "# SparkConnector\n\nHelper to connect to CERN's Spark Clusters\n\nThis extension is built as a Python module named `sparkconnector`, which simplifies the connection to Spark clusters.\n\nIt installs:\n\n1. an nbclassic-extension\n1. a Jupyterlab extension\n1. an iPython extension\n\n\n## Requirements\n\n- JupyterLab >= 4.0.0\n- pyspark (not installed by default)\n\n## Install\n\nTo install the extension, execute:\n\n```bash\npip install sparkconnector\njupyter nbclassic-extension install sparkconnector --py\njupyter nbclassic-extension enable sparkconnector --py\n```\n\nIt is also necessary to enable the iPython code. Append the following code to the config file (usually in `~/.ipython/profile_default/ipython_kernel_config.py`, check [here](https://ipython.readthedocs.io/en/stable/config/intro.html#python-configuration-files)):\n\n```bash\nc.InteractiveShellApp.extensions.append('sparkconnector.connector')\n```\n\n## Uninstall\n\nTo remove the extension, execute:\n\n```bash\npip uninstall sparkconnector\n```\n\n## Contributing\n\n### Development install\n\nNote: You will need NodeJS to build the extension package.\n\nThe `jlpm` command is JupyterLab's pinned version of\n[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use\n`yarn` or `npm` in lieu of `jlpm` below.\n\n```bash\n# Clone the repo to your local environment\n# Change directory to the sparkconnector directory\n# Install package in development mode\npip install -e \".\"\n# Link your development version of the extension with JupyterLab\njupyter labextension develop . --overwrite\n# Rebuild extension Typescript source after making changes\njlpm build\n```\n\nYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.\n\n```bash\n# Watch the source directory in one terminal, automatically rebuilding when needed\njlpm watch\n# Run JupyterLab in another terminal\njupyter lab\n```\n\nWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).\n\nBy default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:\n\n```bash\njupyter lab build --minimize=False\n```\n\n### Development uninstall\n\n```bash\npip uninstall sparkconnector\n```\n\nIn development mode, you will also need to remove the symlink created by `jupyter labextension develop`\ncommand. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`\nfolder is located. Then you can remove the symlink named `@swan-cern/sparkconnector` within that folder.\n\n### Packaging the extension\n\nSee [RELEASE](RELEASE.md)\n",
"bugtrack_url": null,
"license": "AGPL-3.0",
"summary": "Helper to connect to CERN's Spark Clusters",
"version": "3.0.5",
"project_urls": {
"Homepage": "https://github.com/swan-cern/jupyter-extensions"
},
"split_keywords": [
"jupyter",
" jupyterlab",
" swan",
" cern"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "69ce88920161854ffef47e9beffbb47f8ead3d5d503ef9f9c26b30e58e197796",
"md5": "e90b99c824fefe72d740b429ead8af0d",
"sha256": "40bf7fefdb28f5b0292328d5bedb123b53cb949945f3bf4c97a96fa709de4d1e"
},
"downloads": -1,
"filename": "sparkconnector-3.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e90b99c824fefe72d740b429ead8af0d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 401208,
"upload_time": "2024-11-22T15:36:08",
"upload_time_iso_8601": "2024-11-22T15:36:08.913524Z",
"url": "https://files.pythonhosted.org/packages/69/ce/88920161854ffef47e9beffbb47f8ead3d5d503ef9f9c26b30e58e197796/sparkconnector-3.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8d67ea6b328ff701d6d5345517b36c2f51c1bb6b567470986b8b40dc3ee85bb8",
"md5": "82c5eaf00765e07e2617fd2e88db67b9",
"sha256": "5bb682637ca4d29147701252893660416966cd79858314c7f7f0bec674cde714"
},
"downloads": -1,
"filename": "sparkconnector-3.0.5.tar.gz",
"has_sig": false,
"md5_digest": "82c5eaf00765e07e2617fd2e88db67b9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 385038,
"upload_time": "2024-11-22T15:36:11",
"upload_time_iso_8601": "2024-11-22T15:36:11.604739Z",
"url": "https://files.pythonhosted.org/packages/8d/67/ea6b328ff701d6d5345517b36c2f51c1bb6b567470986b8b40dc3ee85bb8/sparkconnector-3.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-22 15:36:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "swan-cern",
"github_project": "jupyter-extensions",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "sparkconnector"
}