Predefined data input tables for Jupyter notebooks
Project description
jupyter-datainputtable
Introduction | Current Features | Wishlist | Usage | Installation | Issues or comments | License
Introduction:
Tools for generating predefined data input tables for use in Jupyter notebooks. This is primarily for student worksheets.
Current Features:
- Can create a table using a python command in the Jupyter notebook.
- If using JupyterPhysSciLab/InstructorTools tables can be created using menu items in the Jupyter notebook (recommended usage).
- Table column and row labels can be locked once set.
- Number of rows and columns must be chosen on initial creation.
- Table will survive deletion of all cell output data.
- Default setting is to make the code cell that creates the table uneditable and undeletable.
- Table creation code will work without this package installed in the Jupyter kernel. Tables are viewable, but not editable in a plain vanilla Jupyter install.
- Option to create Pandas DataFrame from the table if Pandas imported as
pd
. If user tries without Pandas an explanation is provided. Versions >=0.7.0 properly handle cells that are empty or contain text.
Wishlist:
- Add rows to existing table.
Usage:
If you are using and have initialized the JupyterPhysSciLab/InstructorTools select the "insert table..." item from the menu. This will initiate the table creation process with a dialogbox.
If you are not using the InstructorTools package, but the package
jupyter_datainputtable
is installed in your Jupyter/Python
environment start by importing it:
from input_table import *
You initiate the table creation process with the command:
create_input_table()
Installation
Installation using pip into a virtual environment is recommended.
Production
-
If not installed, install pipenv:
$ pip3 install --user pipenv
. You may need to add~/.local/bin
to yourPATH
to makepipenv
available in your command shell. More discussion: The Hitchhiker's Guide to Python. -
Navigate to the directory where this package will be installed.
-
Start a shell in the environment
$ pipenv shell
. -
Install using pip.
$ pip install jupyter-datainputtable
. This will install Jupyter into the same virtual environment if you do not already have it on your machine. If Jupyter is already installed the virtual environment will use the existing installation. This takes a long time on a Raspberry Pi. It will not run on a 3B+ without at least 1 GB of swap. See: Build Jupyter on a Pi.- Still within the environment shell test this by starting jupyter
$ jupyter notebook
. Jupyter should launch in your browser.- Open a new notebook using the default (Python 3) kernel.
- In the first cell import the input_table module:
from input_table import *
- To try use the command
create_input_table()
in the next cell. This should generate a blank code cell and another code cell that has a table in the output for you to define your table dimensions. - If you define the dimensions the input table will be created for you.
-
Optional You can make this environment available to an alternate Jupyter install as a special kernel when you are the user.
- Make sure you are running in your virtual environment
$ pipenv shell
in the directory for virtual environment will do that. - Issue the command to add this as a kernel to your personal space:
$ python -m ipykernel install --user --name=<name-you-want-for-kernel>
. - More information is available in the Jupyter/Ipython documentation. A simple tutorial from Nikolai Jankiev (Parametric Thoughts) can be found here.
- Make sure you are running in your virtual environment
Development
Simply replace $ pip install jupyter-datainputtable
with $ pip install -e jupyter-datainputtable
in the Production
instructions.
Change Log
- 0.7.2
- Ability to have a table caption.
- Created a file for future custom css.
- Expansion and cleanup of README.md.
- 0.7.1 Bug fixes.
- 0.7.0
- Better handling of empty, string and NaN cells.
- Set Pandas indexes if row labels are not just numeric indexes.
- 0.6.0
- Added dialog for getting initial table dimensions.
- Added export table data to a Pandas DataFrame table action.
- Bug fixes.
- 0.5.0 Initial beta release
Issues or comments:
JupyterPhysSciLab/jupyter-datainputtable
This software is distributed under the GNU V3 license
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Copyright - Jonathan Gutow, 2020, 2021.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jupyter-datainputtable-0.7.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89b81be3b577036862f2b9eaa6ae1e3eeacc415b82b04e5576bd2c726de72510 |
|
MD5 | 8a3f5cdab67cbe77f8c47af453b1af98 |
|
BLAKE2b-256 | 631e9d6e61b03f1856871f411eadc5eee30a1e666064b983e4f47021e642cfcd |
Hashes for jupyter_datainputtable-0.7.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d56f06e039fe0cc2becec164118f5d6117a401d748802300141e40f28a7a57f |
|
MD5 | 34dec7a6891a721f009bfd1041924232 |
|
BLAKE2b-256 | 214a4a65233c1f8f55368d1c12e7fd0884fc9e6a48d3022683d102d9b4c1a0da |