Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
317 changes: 317 additions & 0 deletions ILegend-JupyterMultiKernel/Demo.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,317 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "5469a760-15dd-4de3-9142-6ed6a8e2ba7a",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div style='color: #AAAAAA;font-family:monospace;'>Total Time Taken - 5.84s\n",
"</div>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Loaded into table: 'test3'. RowCount: 100"
]
}
],
"source": [
"load ~/Documents/CSV/startups.csv local::DuckDuckConnection"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "f0495a36-3743-456f-a108-b8258deb69e0",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div style='color: #AAAAAA;font-family:monospace;'>Total Time Taken - 3.59s\n",
"</div>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<details open><summary><b>Database: local::DB</b></summary><div style='margin-left: 20px;'>\n",
"<details><summary><b>Table: sample__sport</b></summary><div style='margin-left: 20px;'>\n",
"<table border='1' style='border-collapse: collapse;'>\n",
"<tr><th>Column Name</th><th>Type</th></tr>\n",
"<tr><td>Athlete</td><td>VARCHAR(0)</td></tr>\n",
"<tr><td>Age</td><td>BIGINT</td></tr>\n",
"<tr><td>Country</td><td>VARCHAR(0)</td></tr>\n",
"<tr><td>Year</td><td>BIGINT</td></tr>\n",
"<tr><td>Date</td><td>DATE</td></tr>\n",
"<tr><td>Sport</td><td>VARCHAR(0)</td></tr>\n",
"<tr><td>Gold</td><td>BIGINT</td></tr>\n",
"<tr><td>Silver</td><td>BIGINT</td></tr>\n",
"<tr><td>Bronze</td><td>BIGINT</td></tr>\n",
"</table></div></details>\n",
"<details><summary><b>Table: sample__tree</b></summary><div style='margin-left: 20px;'>\n",
"<table border='1' style='border-collapse: collapse;'>\n",
"<tr><th>Column Name</th><th>Type</th></tr>\n",
"<tr><td>city</td><td>VARCHAR(0)</td></tr>\n",
"<tr><td>country</td><td>VARCHAR(0)</td></tr>\n",
"<tr><td>year</td><td>BIGINT</td></tr>\n",
"<tr><td>tree</td><td>BIGINT</td></tr>\n",
"</table></div></details>\n",
"<details><summary><b>Table: test3</b></summary><div style='margin-left: 20px;'>\n",
"<table border='1' style='border-collapse: collapse;'>\n",
"<tr><th>Column Name</th><th>Type</th></tr>\n",
"<tr><td>Company</td><td>VARCHAR(0)</td></tr>\n",
"<tr><td>Sector</td><td>VARCHAR(0)</td></tr>\n",
"<tr><td>Stage</td><td>VARCHAR(0)</td></tr>\n",
"<tr><td>HeadQuarter</td><td>VARCHAR(0)</td></tr>\n",
"<tr><td>Description</td><td>VARCHAR(0)</td></tr>\n",
"<tr><td>&quot;TurnOver($)&quot;</td><td>DOUBLE</td></tr>\n",
"<tr><td>Year</td><td>BIGINT</td></tr>\n",
"</table></div></details>\n",
"</div></details>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"db local::DuckDuckConnection"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "388a9dcb-02c2-4088-96f2-5706d1704722",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div style='color:#AAAAAA;font-family:monospace;'>Total Time Taken - 2.52s\n",
"</div>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe src=\"http://localhost:8051\" \n",
" width=\"100%\" \n",
" height=\"450\" \n",
" style=\"border: none;\"></iframe>\n",
" "
],
"text/plain": [
" Company Sector ... TurnOver($) Year\n",
"0 Eunimart E-Commerce ... 3.380110e+07 2018\n",
"1 Hyperdata.IO Marketing ... 4.555556e+06 2018\n",
"2 Recordent FinTech ... 6.972143e+08 2020\n",
"3 Super Surfaces Design ... 5.000000e+05 2020\n",
"4 Freyr Energy Renewable Energy ... 2.000000e+06 2021\n",
"5 Eunimart E-Commerce ... 7.000000e+05 2021\n",
"6 Sreyas Holistic Remedies Med Tech ... 1.000000e+06 2020\n",
"7 Codingal EdTech ... 5.600000e+05 2020\n",
"8 Vistaar Finance Financial Services ... 3.000000e+07 2020\n",
"9 Quintype Content Marketing ... 3.500000e+06 2020\n",
"10 Cityflo Travel/Transport ... 7.000000e+06 2020\n",
"\n",
"[11 rows x 7 columns]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#>{local::DuckDuckDatabase.test3}#->\n",
"filter(x|$x.HeadQuarter=='Hyderabad')->from(local::DuckDuckRuntime)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "1cc1070b-de83-4259-b048-e40ab31672d1",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div style='color:#AAAAAA;font-family:monospace;'>Total Time Taken - 2.74s\n",
"</div>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div style='color:#AAAAAA;font-family:monospace;'>DataFrame variable 'my_df' stored in the Python Environment</div>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#>{local::DuckDuckDatabase.test3}#->filter(x|$x.HeadQuarter=='Hyderabad')->from(local::DuckDuckRuntime) --var my_df"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "499fbbc7-64d8-4fde-ab43-6641e7120488",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Company</th>\n",
" <th>Sector</th>\n",
" <th>Stage</th>\n",
" <th>HeadQuarter</th>\n",
" <th>Description</th>\n",
" <th>TurnOver($)</th>\n",
" <th>Year</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Eunimart</td>\n",
" <td>E-Commerce</td>\n",
" <td>Seed</td>\n",
" <td>Hyderabad</td>\n",
" <td>Eunimart is a one stop solution for merchants ...</td>\n",
" <td>3.380110e+07</td>\n",
" <td>2018</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Hyperdata.IO</td>\n",
" <td>Marketing</td>\n",
" <td>Angel</td>\n",
" <td>Hyderabad</td>\n",
" <td>Hyperdata combines advanced machine learning w...</td>\n",
" <td>4.555556e+06</td>\n",
" <td>2018</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Recordent</td>\n",
" <td>FinTech</td>\n",
" <td>Seed</td>\n",
" <td>Hyderabad</td>\n",
" <td>A technology-enabled platform that helps MSMEs...</td>\n",
" <td>6.972143e+08</td>\n",
" <td>2020</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Super Surfaces</td>\n",
" <td>Design</td>\n",
" <td>Series A</td>\n",
" <td>Hyderabad</td>\n",
" <td>A design solution based company</td>\n",
" <td>5.000000e+05</td>\n",
" <td>2020</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Freyr Energy</td>\n",
" <td>Renewable Energy</td>\n",
" <td>Undisclosed</td>\n",
" <td>Hyderabad</td>\n",
" <td>Freyr Energy is a company that provides full s...</td>\n",
" <td>2.000000e+06</td>\n",
" <td>2021</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Company Sector Stage HeadQuarter \\\n",
"0 Eunimart E-Commerce Seed Hyderabad \n",
"1 Hyperdata.IO Marketing Angel Hyderabad \n",
"2 Recordent FinTech Seed Hyderabad \n",
"3 Super Surfaces Design Series A Hyderabad \n",
"4 Freyr Energy Renewable Energy Undisclosed Hyderabad \n",
"\n",
" Description TurnOver($) Year \n",
"0 Eunimart is a one stop solution for merchants ... 3.380110e+07 2018 \n",
"1 Hyperdata combines advanced machine learning w... 4.555556e+06 2018 \n",
"2 A technology-enabled platform that helps MSMEs... 6.972143e+08 2020 \n",
"3 A design solution based company 5.000000e+05 2020 \n",
"4 Freyr Energy is a company that provides full s... 2.000000e+06 2021 "
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#Kernel: Python\n",
"#Code in Python below. Don't Remove this Header!!\n",
"my_df.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d5d9af73-ae1e-447c-86d8-cf8448ab0065",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "ILegend",
"language": "ilegend",
"name": "ilegend_kernel"
},
"language_info": {
"codemirror_mode": "ilegend",
"file_extension": ".ilgd",
"mimetype": "text/x-ilegend",
"name": "ilegend"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
19 changes: 19 additions & 0 deletions ILegend-JupyterMultiKernel/Kernel/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2025 Shanmukh raj MSS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
10 changes: 10 additions & 0 deletions ILegend-JupyterMultiKernel/Kernel/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

install:
pip install -e .
python -m ilegend_kernel.install



clean:
pip uninstall ilegend_kernel
jupyter kernelspec remove ilegend_kernel
26 changes: 26 additions & 0 deletions ILegend-JupyterMultiKernel/Kernel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

# Jupyter-ILegend - A Jupyter Kernel for ILegend Services


## Installation

### Requirements

- At least **Python** 3.5
- Tested with Python 3.12.2
- **Jupyter** installation with JupyterLab and/or Juypter Notebook
- Tested with
- jupyter_core: 5.7.2
- jupyterlab: 4.x.x
- notebook: 7.x.x


## Development

### Development Install

1. Download the repository.
2. Change to the root directory of the repository.
3. `pip install .`
4. Install the kernelspec:
- `python -m ilegend_kernel.install`
3 changes: 3 additions & 0 deletions ILegend-JupyterMultiKernel/Kernel/ilegend_kernel/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

from .kernel import ILegendRouterKernel
__version__ = ILegendRouterKernel.implementation_version
5 changes: 5 additions & 0 deletions ILegend-JupyterMultiKernel/Kernel/ilegend_kernel/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

from ipykernel.kernelapp import IPKernelApp
from .kernel import ILegendRouterKernel

IPKernelApp.launch_instance(kernel_class=ILegendRouterKernel)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c = get_config()
Loading