Giter Site home page Giter Site logo

jtpio / jupyterlab-python-file Goto Github PK

View Code? Open in Web Editor NEW
52.0 3.0 13.0 855 KB

JupyterLab extension to create Python files

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

TypeScript 36.66% JavaScript 16.29% Python 46.67% CSS 0.39%
jupyterlab jupyterlab-extension jupyter

jupyterlab-python-file's Introduction

jupyterlab-python-file

Archived

This project is archived. JupyterLab 3.1+ now supports creating new Python files:

image

Binder PyPI conda-forge npm

Create Python Files from JupyterLab

screenshot

screenshot2

Prerequisites

  • JupyterLab 1.0+

Installation

For JupyterLab 3.x, the extension can be installed with pip:

pip install jupyterlab-python-file

Or with conda:

conda install -c conda-forge jupyterlab-python-file

# or with mamba
mamba install jupyterlab-python-file

For JupyterLab 1.x and 2.x:

jupyter labextension install jupyterlab-python-file

Development

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the jupyterlab-python-file directory

# create a new environment
conda create -n jupyterlab-python-file -c conda-forge python nodejs -y
conda activate jupyterlab-python-file

# install the JupyterLab pre-release
python -m pip install --pre jupyterlab

# Install package in development mode
pip install -e .

# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite

# Rebuild extension Typescript source after making changes
jlpm run build

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

jupyterlab-python-file's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar jtpio avatar ogiorgis 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

Watchers

 avatar  avatar  avatar

jupyterlab-python-file's Issues

Archive the repository?

Since elyra provides an extension (@elyra/python-editor-extension, which can be installed separately) to create and run Python files, we should consider archiving this repo stop development on jupyterlab-python-file.

image

image

feature: code folding for python code (def, class, etc)

Thanks for this great extension. This is not an issue but rather a feature idea.

Is there a way to obtain code folding for Python file, liek folding code blocks of one indentation level? Is that something that would depend on this extension, or would that be at another place in Jupyter lab?

Is there anyway to do tab completion in this plugin

This is my first time I'm trying to use jupyter lab to create .py file, and I'm sure that I've followed the exact instruction of installation,
however I'm not able to do tab completion. I'm not sure if there any way to do this, could you please help in this.

any equivalent for Julia?

Hi,

I was wondering if you'd know an equivalent extension to write .jl (julia) file directly from the Jupyterlab editor? If not, is there a possibility to add support for Julia file from this extension?

Thanks

npm dependencies failed to install

I tried to install the extension from the command line and got:

RuntimeError: npm dependencies failed to install

Jupyter Lab version: 2.0.1
Operating system: macOS High Sierra

Here is the log file

Node v13.13.0

Yarn configuration loaded.
> /opt/anaconda3/bin/npm pack jupyterlab-python-file
npm notice 
npm notice ๐Ÿ“ฆ  [email protected]
npm notice === Tarball Contents === 
npm notice 1.5kB LICENSE        
npm notice 0     style/index.css
npm notice 3.0kB lib/index.js   
npm notice 1.2kB package.json   
npm notice 790B  README.md      
npm notice 174B  lib/index.d.ts 
npm notice === Tarball Details === 
npm notice name:          jupyterlab-python-file                  
npm notice version:       0.4.0                                   
npm notice filename:      jupyterlab-python-file-0.4.0.tgz        
npm notice package size:  2.9 kB                                  
npm notice unpacked size: 6.7 kB                                  
npm notice shasum:        48b7e37febd9b18b6c4dc953573ae036c2cc1540
npm notice integrity:     sha512-bXQmX6xjGWfDY[...]KtULNuMSRXpaA==
npm notice total files:   6                                       
npm notice 
jupyterlab-python-file-0.4.0.tgz

Node v13.13.0

Yarn configuration loaded.
Building jupyterlab assets (build:prod:minimize)
> node /opt/anaconda3/lib/python3.7/site-packages/jupyterlab/staging/yarn.js install --non-interactive
yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
error Integrity check failed for "jupyter-matplotlib" (computed integrity doesn't match our records, got "sha512-cHvQJy7kreJzSGVs0VOGFKMm3Vg9+B8IGGp/p+edtvKfQGzv5KenWowSXl/59jmYyvwL29Wcr8lC6SnPy4jytA== sha1-d1ZbqFu394/HEbxyatFoDGoFeJw=")
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

npm dependencies failed to install
Traceback (most recent call last):

  File "/opt/anaconda3/lib/python3.7/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

  File "/opt/anaconda3/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 105, in start
    command=command, app_options=app_options)

  File "/opt/anaconda3/lib/python3.7/site-packages/jupyterlab/commands.py", line 460, in build
    command=command, clean_staging=clean_staging)

  File "/opt/anaconda3/lib/python3.7/site-packages/jupyterlab/commands.py", line 652, in build
    raise RuntimeError(msg)

RuntimeError: npm dependencies failed to install

Exiting application: jupyter

Add context menu entry

It would be nice if Python files could be created from the context menu in the file browser.

Similar to these existing entries:

image

ValueError: No version of jupyterlab-python-file could be found

I continue get following error. Could you please help me on this

`
jupyter labextension install jupyterlab-python-file ๎‚ฒ 1 โ†ต ๎‚ฒ 1360 ๎‚ฒ 21:52:21

/usr/local/bin/npm pack jupyterlab-python-file
npm notice
npm notice ๐Ÿ“ฆ [email protected]
npm notice === Tarball Contents ===
npm notice 1.5kB LICENSE
npm notice 0 style/index.css
npm notice 3.0kB lib/index.js
npm notice 1.2kB package.json
npm notice 790B README.md
npm notice 174B lib/index.d.ts
npm notice === Tarball Details ===
npm notice name: jupyterlab-python-file
npm notice version: 0.4.0
npm notice filename: jupyterlab-python-file-0.4.0.tgz
npm notice package size: 2.9 kB
npm notice unpacked size: 6.7 kB
npm notice shasum: 48b7e37febd9b18b6c4dc953573ae036c2cc1540
npm notice integrity: sha512-bXQmX6xjGWfDY[...]KtULNuMSRXpaA==
npm notice total files: 6
npm notice
jupyterlab-python-file-0.4.0.tgz

Errored, use --debug for full output:
ValueError: No version of jupyterlab-python-file could be found that is compatible with the current version of JupyterLab. However, it seems to support a new version of JupyterLab. Consider upgrading JupyterLab.

Conflicting Dependencies:
JupyterLab Extension Package

=0.17.2 <0.18.0 >=2.0.0 <3.0.0 @jupyterlab/application
=0.17.3 <0.18.0 >=2.0.0 <3.0.0 @jupyterlab/filebrowser
=0.17.2 <0.18.0 >=2.0.0 <3.0.0 @jupyterlab/launcher`

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.