CQL Kernel for Jupyter based on cqlsh
Project description
A Jupyter kernel for the Apache Cassandra Database
To install::
pip install cql_kernel
python -m cql_kernel.install
To use it, run one of::
ipython notebook
# In the notebook interface, select CQL from the 'New' menu
ipython qtconsole --kernel cql
ipython console --kernel cql
To set the connection hostname:
either set the enviroment variable::
CASSANDRA_HOSTNAME=<hostname>
Or in the kernel.json file for the cql kernel, set it as an env. To find the file type::
jupyter kernelspec list
Below is a sample kernel.json with CASSANDRA_HOSTNAME set::
{"argv": ["/usr/bin/python", "-m", "cql_kernel", "-f", "{connection_file}"], "codemirror_mode": "sql", "display_name": "CQL", "env": {"CASSANDRA_HOST": "mycluster"}, "language": "CQL"}
For details of how this works, see the Jupyter docs on `wrapper kernels
<http://jupyter-client.readthedocs.org/en/latest/wrapperkernels.html>`_, and
Pexpect's docs on the `replwrap module
<http://pexpect.readthedocs.org/en/latest/api/replwrap.html>`_
To install::
pip install cql_kernel
python -m cql_kernel.install
To use it, run one of::
ipython notebook
# In the notebook interface, select CQL from the 'New' menu
ipython qtconsole --kernel cql
ipython console --kernel cql
To set the connection hostname:
either set the enviroment variable::
CASSANDRA_HOSTNAME=<hostname>
Or in the kernel.json file for the cql kernel, set it as an env. To find the file type::
jupyter kernelspec list
Below is a sample kernel.json with CASSANDRA_HOSTNAME set::
{"argv": ["/usr/bin/python", "-m", "cql_kernel", "-f", "{connection_file}"], "codemirror_mode": "sql", "display_name": "CQL", "env": {"CASSANDRA_HOST": "mycluster"}, "language": "CQL"}
For details of how this works, see the Jupyter docs on `wrapper kernels
<http://jupyter-client.readthedocs.org/en/latest/wrapperkernels.html>`_, and
Pexpect's docs on the `replwrap module
<http://pexpect.readthedocs.org/en/latest/api/replwrap.html>`_
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cql_kernel-0.1.1.tar.gz
(87.4 kB
view hashes)
Built Distribution
Close
Hashes for cql_kernel-0.1.1.macosx-10.10-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1507db2e2a239bf6f358ee7ef6cff2499dfac12b9a7e9e13b4627b3504157a32 |
|
MD5 | 5a39d26d35ea8a3d145c053999f5eb38 |
|
BLAKE2b-256 | 6e1e882bcc964c2da38219061459e9f302c27598c0c5c22db6f775b1b22f6f04 |