GithubHelp home page GithubHelp logo

jupyterlab-contrib / jupyterlab-spreadsheet-editor Goto Github PK

View Code? Open in Web Editor NEW
125.0 2.0 6.0 1.85 MB

JupyterLab spreadsheet editor for tabular data (e.g. csv, tsv)

License: BSD 3-Clause "New" or "Revised" License

TypeScript 94.13% CSS 4.49% JavaScript 0.04% Python 1.23% Shell 0.11%
jupyterlab-extension jupyterlab spreadsheet spreadsheet-manipulation csv tsv excel

jupyterlab-spreadsheet-editor's People

Contributors

dependabot[bot] avatar fcollonval avatar jtpio avatar krassowski avatar manics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jupyterlab-spreadsheet-editor's Issues

Add this package to conda-forge

Is your feature request related to a problem? Please describe.

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.

Describe the solution you'd like

The latest version of this package is contributed to conda-forge.

Describe alternatives you've considered

There are some workarounds, all with drawbacks:

  • Abandon conda-forge, locking on PyPI with Poetry only
  • Abandon conda-lock, accepting that conda install will install different packages over time
  • Manually edit the conda lock file to remove the offending pip packages

Additional context

  • Python package version:
    0.6.1
  • Extension version:
    0.6.1
  • Operating System and its version:
    Ubuntu 20.04

Could not support jupyterlab 3.0

Hi, 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`

Lazy loading of rows to support larger files

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:

  1. Search and replace needs to be carefully tested
  2. The scrollbar will probably need to be switched to programmatic which can be sub-optimal for the UX (but this is what the CSV Viewer already does).

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.

Incompatible with Python 3.12?

Description

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.

image

Reproduce

  1. Install rustup and mambaforge
  2. create new mamba environment in miniforge3 prompt with specified 'python=3.12' in

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
  1. activate environment and run pip install jupyterlab-spreadsheet-editor

Support for Jupyterlite

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.

Text align

Would that be possible to add text align function and button(s) to the menu (at least to the left as an option)?

Support for JupyterLab 4.0

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!

Releasing failed in "Finalize Release" step

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>

Implement column types to allow constraining input

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:

  • should the information about column types be stored in the CSV/TSV file?
  • if yes, is there any standard specifying how to store the column type information?
  • should we allow full-featured html entries (such as photos, see the jExcel example)? How would we save those?
  • column types have options (e.g. mask for currency, or choices for dropdown); how those should be specified? Should those be saved as well?

Color column does not show colors properly if header row is enabled

Description

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:
color-column-valid

Invalid colors with header row:
color-column-invalid

Reproduce

  1. Create a CSV file.
  2. Add a column with color type.
  3. Add a header row and several other rows with different colors.
  4. Toggle header row on and off

Expected behavior

Enabling or disabling header row should not affect the display of the colors.

Context

  • Operating System and version: Ubuntu 20.04
  • Browser and version: Firefox 91.0.2
  • JupyterLab version: 3.1.9

Add commands to the palette

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.

Add support for Excel (xls/xlsx) and Calc (ods) files

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:

  • typescript typings
  • modern codebase (no jQuery please)
  • both proprietary and open formats support
  • as little peer dependencies as possible
  • good maintainership history (especially with regard to security patches)
  • high fidelity/standard compliance

Implementation wise, we would want to implement:

  • multiple sheets support (but the initial proof-of-concept version could just use the first sheet)
  • "save as" feature so that one can convert Excel sheets into more friendly csv/tsv format

Please feel free to comment to add your own needs and wishes!

Extra row added when saving a csv

Description

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

Reproduce

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.

Expected behavior

I expect no extra row added when saving a csv.

Context

  • Python package version: 0.6.1
  • Extension version: 0.6.1
  • Operating System and its version: Ubuntu 20.04
  • Browser and its version: Firefox 109.0.1

Support parquet file format

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.