williamjameshandley / py2nb Goto Github PK
View Code? Open in Web Editor NEWconvert python scripts to jupyter notebooks
License: GNU General Public License v3.0
convert python scripts to jupyter notebooks
License: GNU General Public License v3.0
If you see html2text it allows import in python
Also it is a script
py2nb is only delivered as a script ( I think)
I cannot say import py2nb
Problem also is subprocess.run does not work
So in a integration that I am doing I had to paste whole code and correct for utf8
Please see https://github.com/ojnc/html2ipynbSensible/blob/main/html2ipynbSensible.py
In the script I had to manually add ,"r",encoding="utf-8"
so that I could run in command line
Regards
Jayanta
Hi, is this tool still being actively developed?
It looks to be very useful!
Very nice script for generating a notebook!
I seem to have encountered an issue with the #-
and #|
syntax when using flake8
and yapf
, as flake8
gives a E265
(as there's no space after the #
) and yapf
will always format it to have a space - thus breaking all code sections/markdown.
An easy fix would be to just accept # -
and # |
, a more complicated fix can use a config file to set the expected characters.
What is your opinion on this? I'm happy to open a PR for either approach
Thanks for building this utility, works like a charm and saved me time. :-)
We need this code for ipynb kernel to be set to python 3
kernelspec=dict(display_name= "Python 3",
language= "python",
name= "python3",)
nb = nbformat.v4.new_notebook()
nb.metadata['kernelspec'] = kernelspec
I had to copy your code with 3 enhancements
please see https://github.com/ojnc/html2ipynbSensible/blob/main/html2ipynbSensible.py
Regards
Jayanta
with open(script_name) as f:
please change to
with open(script_name,"r",encoding="utf-8") as f:
I was getting errors till I changed the above
File "C:\Users\sssca\AppData\Local\Programs\Python\Python38\lib\encodings*cp1252.py*", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 794: character maps to
Regards
Jayanta
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.