https://github.com/crystal-data/crystal_kernel
Python wrapper kernel for Crystal
https://github.com/crystal-data/crystal_kernel
crystal jupyter
Last synced: about 2 months ago
JSON representation
Python wrapper kernel for Crystal
- Host: GitHub
- URL: https://github.com/crystal-data/crystal_kernel
- Owner: crystal-data
- License: bsd-3-clause
- Created: 2022-03-19T14:36:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-08-13T10:54:04.000Z (10 months ago)
- Last Synced: 2025-10-02T10:09:25.073Z (9 months ago)
- Topics: crystal, jupyter
- Language: Python
- Homepage:
- Size: 48.8 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# crystal_kernel

[](https://pypi.org/project/crystal-kernel/)
[](https://opensource.org/licenses/BSD-3-Clause)
Simple [Python wrapper kernel](https://jupyter-client.readthedocs.io/en/stable/wrapperkernels.html) for Crystal language.
[ICrystal](https://github.com/RomainFranceschini/icrystal) is the widely used Jupyter kernel for Crystal,
which uses [ICR](https://github.com/crystal-community/icr).
On the other hand, this crystal_kernel uses the official [Crystal interpreter](https://crystal-lang.org/2021/12/29/crystal-i.html).
Forked from [bash_kernel](https://github.com/takluyver/bash_kernel)
## Installation
Make sure the [Crystal's interpreter](https://crystal-lang.org/2021/12/29/crystal-i.html) starts with `crystal i`.
Then type the following commands.
```sh
pip install crystal_kernel
python -m crystal_kernel.install
```
## Compiling Crystal interpreter
Crystal 1.3.2 does not provide the Crystal interpreter by default.
To enable `crystal i`, you need to [compile Crystal from source code](https://crystal-lang.org/install/from_sources/) with `interpreter` option. Crystal is required to compile Crystal. So please do not remove the existing Crystal just because you are going to install Crystal from source code.
```sh
git clone https://github.com/crystal-lang/crystal
cd crystal
make help # check available options
make interpreter=1 release=1 progress=1 # whatever you want
sudo make install # sudo checkinstall
```
Then check the interpreter start.
```sh
crystal i
```
Did it work?
## Using Shards
Use shards when you want to use crystal libraries. Go to your working directory and create `shard.yml` with `shards init` and write the necessary libraries to it. After `shards install`, start `jupyter`.
## Development
Clone the repository:
```sh
git clone https://github.com/crystal-data/crystal_kernel
cd crystal_kernel
```
Install in development mode:
```sh
pip install flit
flit install --symlink
```
Install the kernel spec:
```sh
python -m crystal_kernel.install
```
Build the package:
```sh
flit build
```
Publish to PyPI:
```sh
flit publish
```
See [Python wrapper kernel](https://jupyter-client.readthedocs.io/en/stable/wrapperkernels.html) for more information.
Feel free to fork this project and start your own project. The author (kojix2) is not familiar with Python and is ready to transfer this project to a more suitable person. If you are interested in taking over the project, please let us know.