jupyterlab-contrib / jupyterlab-spreadsheet-editor Goto Github PK
View Code? Open in Web Editor NEWJupyterLab spreadsheet editor for tabular data (e.g. csv, tsv)
License: BSD 3-Clause "New" or "Revised" License
JupyterLab spreadsheet editor for tabular data (e.g. csv, tsv)
License: BSD 3-Clause "New" or "Revised" License
Would it be possible to add this package to conda-forge? conda-lock
cannot lock this package because it is not in conda-forge but still depends on jupyterlab
, which is in conda-forge. See this question on StackOverflow showing this particular failure. When these kinds of problems occur, the maintainers of conda-forge recommend this solution.
The latest version of this package is contributed to conda-forge.
There are some workarounds, all with drawbacks:
conda install
will install different packages over timeHi, after upgrade jupyter-lab, the extension not longer work, could you please fix it? I found your extension is very useful. Thank you.
`Conflicting Dependencies:
JupyterLab Extension Package
=3.0.3 <3.1.0 >=2.0.0 <3.0.0 @jupyterlab/application
=3.0.2 <3.1.0 >=2.2.0 <3.0.0 @jupyterlab/apputils
=5.0.1 <5.1.0 >=4.2.0 <5.0.0 @jupyterlab/coreutils
=3.0.3 <3.1.0 >=2.2.0 <3.0.0 @jupyterlab/documentsearch
=3.0.2 <3.1.0 >=2.2.2 <3.0.0 @jupyterlab/launcher
=3.0.2 <3.1.0 >=2.1.1 <3.0.0 @jupyterlab/mainmenu
=6.0.2 <6.1.0 >=5.2.1 <6.0.0 @jupyterlab/services
See the log file for details: /tmp/jupyterlab-debug-tew_5_t9.log`
While I intended this extension to be a solution for editing small tabular files (but larger than it can be conveniently done in a text editor) like up to 20 columns and 200 rows, it might be useful to support larger files as jExcel does implement lazy loading. There are a few things to look out for though:
We could have a size threshold to automatically switch to lazy loading if a file is very big, but we may want to have an opt-out button.
For extremely large files we could use the lumino's datagrid as highlighted by @blink1073:
example-datagrid. This seems to be "the future", but for now adopting jExcel may allow for more feature-rich experience.
In Windows 10, when using Python 3.12, the CLI outputs "Failed building wheel for pyzmq" when installing via pip install in a mamba environment. With 3.11 and below, the extension worked in Jupyterlab.
Used yaml file for environment:
name: test
channels:
- conda-forge
dependencies:
- python=3.11
- jupyter
- jupytext
- jupyterlab
- lxml
- requests
- numba
- pip
- cython
- matplotlib
- pandas
- numpy
- scipy
- scikit-learn
- h5py
- pytables
- pyarrow
- pytest
- pytest-cov
- sphinx
- sphinx_rtd_theme
- pyyaml
- yaml
- setuptools
- nodejs
- ipysheet
- pip:
- juliacall
- rise
- kaleido
- jupyterlab_rise
There are still some edge cases where it does not work as intended.
It looks like the default branch is currently master
.
Maybe it could be renamed to main
for consistency with the other repos in the jupyterlab-contrib
org?
This is an awesome feature for jupyterlab.
When i try to install it in jupyterlite 0.2.3 (https://jupyterlite.readthedocs.io) i have the following error.
ValueError: Can't find a pure Python 3 wheel for 'tornado>=6.1.0'.
See: https://pyodide.org/en/stable/usage/faq.html#why-can-t-micropip-find-a-pure-python-wheel-for-a-package
You can use `await micropip.install(..., keep_going=True)` to get a list of all packages with missing wheels.
Not sure why, since tornado is used by jupyterlab server.
ipysheet warns: "We recommend not using ipysheet anymore. We suggest an alternative like ipydatagrid." qgrid's successor is QgridNext.
If when using the search function the user modifies the text, removing the match the background highlight of this cell is not cleared.
Also happens on ctrl-x
Changes introduced by jexcel are not watched/reflected in the model/state so the state of the document is not set to dirty and one can end up not saving the changes (unless they make another edit which is correctly watched before an attempt to save).
Would that be possible to add text align function and button(s) to the menu (at least to the left as an option)?
Hello,
This is a great extension, but the current version (0.6.1) does not work with >JupyterLab 4.0. Would be awesome to support it. Thanks!
Right now the focus is there, but jExcel keeps some events bound which can lead to writing in the wrong place.
Turning on NPM provenance as id-token permission is set.
writing npm config to /home/runner/.npmrc
npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://registry.npmjs.org/-/whoami
npm ERR! A complete log of this run can be found in: /home/runner/.npm/_logs/2024-03-16T19_55_29_604Z-debug-0.log
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.8/x64/bin/jupyter-releaser", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/cli.py", line 121, in invoke
super().invoke(ctx)
File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/cli.py", line 676, in publish_assets
lib.publish_assets(
File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/lib.py", line 379, in publish_assets
util.run("npm whoami")
File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/util.py", line 94, in run
raise e
File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/util.py", line 86, in run
process = tee(cmd, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/tee.py", line [159](https://github.com/jupyterlab-contrib/jupyterlab-spreadsheet-editor/actions/runs/8310089368/job/22742184806#step:4:162), in run
raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command 'npm whoami' returned non-zero exit status 1.
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/actions/finalize_release.py", line [1](https://github.com/jupyterlab-contrib/jupyterlab-spreadsheet-editor/actions/runs/8310089368/job/22742184806#step:6:1)5, in <module>
Idea: implement a column-wise validation of the user input using the column types feature of jExcel.
I frequently find myself having to work with the spreadsheets having mistakes in data entry process (like dates being in UK and US format). Having the (optional) column types could alleviate at least some of the problem (i.e. decrease probability of myself and you from creating invalid files; cannot help about the other Excel users though).
The design idea is to have a bar above the column names with a drop-down allowing to choose column type. By default all would be "text", and the bar would be hidden. On pressing a toolbar button the bar with type drop-downs would show up and the user would be able to choose the column type.
Questions to the community/users/myself:
If the type of a column is selected as color
and "First row as header" option is enabled, color values are displayed not with their corresponding colors, but with the color in the first non-header row. If header row is disabled they are displayed properly.
Valid colors without header row:
Invalid colors with header row:
color
type.Enabling or disabling header row should not affect the display of the colors.
Quite a few useful functions (add/remove column etc) are implemented as anonymous functions for the toolbar buttons. Those could be registered as commands and added to the palette. It is not my personal priority but I am very welcoming of contributions if anyone wanted to implement it.
Initially let's just change the display, and do not save this info to csv. Maybe having a checkbox like
[ ] store text formatting in CSV
(off by default) could be ok?
Even though it seems to be targeting a different usecase it might be worth mentioning in the readme:
https://github.com/QuantStack/ipysheet
Should be implemented with an event listener.
As the current character/line is shown in the text editor
jupyterlab-spreadsheet depends on xlsx which seems to be the most popular choice. Alternatives include exceljs and xlsx-populate. This needs further evaluation (contributions welcome!).
We would ideally want to have:
Implementation wise, we would want to implement:
Please feel free to comment to add your own needs and wishes!
I had to install chokidar to make the watch mode/developement work. This is an upstream bug: jupyterlab/jupyterlab#8469 (already fixed, but fix not released yet).
To prevent annoying jumps
Saving a csv prepared with R or pandas adds an extra row at the bottom. That is, a csv like
a,b
1,3
2,4
becomes
a,b
1,3
2,4
, <-- added
Make a csv with R (or pandas).
Rscript -e "write.csv(data.frame(a = 1:2, b = 3:4), row.names = FALSE, eol = '\r\n')" > test.csv
Then open test.csv
in JupyterLab, modify the content of a cell, and save.
Removing the line ending on the last line before opening in JupyterLab seems to fix it, but having a CRLF at the end of the last row is allowed by RFC 4180. That is,
cat -e test.csv
a,b^M$
1,3^M$
2,4^M$
results in an extra line, whereas
cat -e test.csv
a,b^M$
1,3^M$
2,4
works as expected.
I expect no extra row added when saving a csv.
Describe the new feature being added
It would be good if this can support parquet files since they can be loaded and saved much faster than CSV files. This is more apparent as the size of the file begins to grow. source
How will this feature improve this extension
I think this is an even better use case for what has been built. Although it is useful to edit CSV's, the native jupyterlab editor can do that. Since the parquet format is not human readable, it is not possible currently for a user to modify that without loading it into pandas and then resaving it.
Additional context
Utilize existing library: https://github.com/ironSource/parquetjs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.