Skip to main content

Tool for spreadsheet-like data entry in Jupyter notebooks

Project description

data_entry2.py

  • A spreadsheet interface for data entry in Python/Jupyter

Requires: ipydatagrid

To use:

  import data_entry2

  data_entry2.sheet("name")

This creates or loads name.csv and presents as a "live" spreadsheet-like interface. This is for data entry only, no calculations are possible in the spreadsheet.

Put a # in front of a row to comment it out Put a $ in front of a column name to comment out the column (useful for non-numeric columns)

Simple expressions can be evaluated, eg: =1+3/np.sqrt(3)

Generate Vectors generates a series of arrays for each non-commented column.

Two pandas data frames are also created:

  • one is self.df that contains just the data in the vectors.
  • the other, self.fdf is strings that has everything in the whole table.

To take a snapshot of a current sheet and generate a new one: data_entry2.sheet_copy("old", "new")

if new.csv exists, it gets loaded, if not, old.csv is copied to new.csv.

Add Row and Add Column do what they claim. To remove unwanted empty rows and columns, just re-run the cell that sets up the sheet. empty rows and columns will be deleted.

Copy & Paste only work for single cells.

To edit a cell - click and start typing. If you want to edit a current value: try double clicking - doesn't always take, might need a few tries. Or click and press F2.

After editing a cell, enter moves to next cell down, probably want Tab to move to next cell to right. (shift tab goes left).

There is a top row of cell headers shown that allows: column widths to be adjusted, and filters and sorting. Probably the sorting and filters should not be available. Display of these headers can be disabled by setting: header_visibility='row' in the call to DataGrid, but then the widths can't be adjusted... Can always restore the correct order by sorting key by ascending. To make that work there are some extra spaces included in front of the Variable and Units row headers

In order to help avoid disasterous data loss: every time Generate Vectors is pressed, a snapshot of the current sheet is saved in csv_backups (as long as it is different from the most recent backup). You can poke around in there and make copies of the backups, rename them and move up to where the notebook can use it.

BUGS: the sheet will only render when the notebook is exported if Settings->Auto Save Widget State is toggled on.

To output all sheets: call data_entry2.display_sheets() All sheets created will be displayed.

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

data_entry2-0.1.11.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

data_entry2-0.1.11-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file data_entry2-0.1.11.tar.gz.

File metadata

  • Download URL: data_entry2-0.1.11.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for data_entry2-0.1.11.tar.gz
Algorithm Hash digest
SHA256 841e3121f659c38fb523b321fae3147d21de0748ea6daed61a69163a2f7284e6
MD5 1a1ba0c4e0115664b89f3c43b49850b5
BLAKE2b-256 c70933d67ac0e4b4fe1d2b82260a1efbecbe5eb490d20680cf4ad7dbae079ce7

See more details on using hashes here.

File details

Details for the file data_entry2-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: data_entry2-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for data_entry2-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 e947f163c30a2ca8e4e7f574d7e4da2bfe8586dde90e38b4dd8d83294b6d8b93
MD5 987290f8b16900e061475216d6fe50ad
BLAKE2b-256 22fa0ddc7c3f37e2b2486f804376dd09a3cd4c032fb2f093dae5c1bf03bcfbf9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page