Working with Our IPython Notebooks
Some of our examples are provided as IPython Notebooks. (The file extension is .ipynb.) They require an IPython Notebook server to run, and in some cases they also need the accompanying data files.
While GitHub renders IPython notebooks, it does so with limitations (see Rendering Notebooks on GitHub). One of these limitations is that LaTeX math notation is not rendered correctly. We use this feature quite a bit in our notebooks, so looking at them in GitHub is not very useful. Because of this, we provide here two other options.
Static Renderings of our Notebooks
We use nbviewer to create static images of our notebooks that are properly rendered. (While nbviewer code powers the rendering of IPython notebooks on GitHub, the code running at the nbviewer site does not have the same limitations as the one running on GitHub.) nbviewer includes a file browser, so you can simply go to the top-level directory and select the notebooks from there, or you can use the direct links provided here.
- examples (directory): The top-level directory of our IPython notebook examples and tutorials.
- Hello World: A basic introduction into our API and math concepts.
- Hello Multisets: A similarly basic introduction into multisets.
- Hello XML: An introduction into the representation of hierarchical data.
- TPC-H Query 5 (directory): The directory with the TPC-H Query 5 example notebooks:
Installing IPython Notebook Locally
If you want to interact with the notebooks, you need to run them on an IPython Notebook server. Installing it is simple:
> pip install ipython[notebook]
You also need to install our library:
> pip install algebraixlib
After this, you simply run the notebook server (typically from within the 'examples' directory in a local copy of the code), like this:
> ipython notebook
Or like this if your Python "Scripts" directory is not on your path (
<PythonInstallDir> is your
Python installation directory):
> <PythonInstallDir>/Scripts/ipython notebook
This will open a web page that is essentially a file browser into the 'examples' directory. From there you can open the notebooks and interact with them.
Obtain a Local Copy of the Examples
A local copy of the example code can be obtained in a number of ways:
- Download the master.zip file from GitHub (see also the button "Download ZIP" on the repository home page and expand the "examples" directory contained in it.
- Run the command
svn export https://github.com/AlgebraixData/algebraixlib/trunk/examplesor one of the other possibilities described in the StackOverflow article Download a single folder or directory from a GitHub repo.