https://github.com/astropenguin/jupyter-io
:zap: Saving and loading files directly into Jupyter notebooks
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 3 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
1 of 1 committers (100.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.5%) to scientific vocabulary
Keywords
Repository
:zap: Saving and loading files directly into Jupyter notebooks
Basic Info
- Host: GitHub
- Owner: astropenguin
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://astropenguin.github.io/jupyter-io/v2.0.1
- Size: 2.8 MB
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
- Releases: 4
Topics
Metadata Files
README.md
jupyter-io
Saving and loading files directly into Jupyter notebooks
Installation
shell
pip install jupyter-io
File saving
jupyter-io provides the in_notebook function to directly save (i.e. embed) files to Jupyter notebooks.
Suppose you create a Matplotlib figure want to save it as a PDF file.
The following code will save the PDF file to your local environment:
```python
import matplotlib.pyplot as plt
plt.plot([1, 2, 3])
plt.savefig("figure.pdf")
This should work in many cases, however, in a virtual environment like [Google Colaboratory](https://colab.research.google.com/), you will not be able to get the file once the Jupyter server is stopped.
By wrapping the file path by `in_notebook`, the PDF file will be directly saved to the Jupyter notebook and you will get a download link instead:
python
import matplotlib.pyplot as plt
from jupyterio import innotebook
plt.plot([1, 2, 3]) plt.savefig(in_notebook("figure.pdf")) ``` The download link works when the Jupyter server is stopped, and even when it does not exist. This makes Jupyter notebooks more portable, for example, to share the output data other than images together with them.
More examples
To save a pandas series to a notebook:
```python import pandas as pd from jupyterio import innotebook
ser = pd.Series([1, 2, 3]) ser.tocsv(innotebook("series.csv")) ```
To save a general text to a notebook:
```python from jupyterio import innotebook
with open(in_notebook("output.txt"), "w") as f: f.write("1, 2, 3\n") ```
File loading
The file loading feature has not been implemented yet.
Owner
- Name: Akio Taniguchi
- Login: astropenguin
- Kind: user
- Location: Nagoya, Japan
- Company: Nagoya University
- Website: https://astropengu.in
- Twitter: astropengu_in
- Repositories: 76
- Profile: https://github.com/astropenguin
Project assistant professor (LMT-FINER)
GitHub Events
Total
- Create event: 11
- Release event: 4
- Issues event: 14
- Watch event: 3
- Delete event: 6
- Push event: 23
- Pull request event: 15
Last Year
- Create event: 11
- Release event: 4
- Issues event: 14
- Watch event: 3
- Delete event: 6
- Push event: 23
- Pull request event: 15
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Akio Taniguchi | t****i@a****p | 34 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 9
- Total pull requests: 8
- Average time to close issues: 4 months
- Average time to close pull requests: about 4 hours
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 7
- Pull requests: 7
- Average time to close issues: 6 days
- Average time to close pull requests: about 4 hours
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- astropenguin (10)
Pull Request Authors
- astropenguin (14)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 368 last-month
- Total dependent packages: 1
- Total dependent repositories: 2
- Total versions: 9
- Total maintainers: 1
pypi.org: jupyter-io
Saving and loading files directly into Jupyter notebooks
- Documentation: https://jupyter-io.readthedocs.io/
- License: MIT License Copyright (c) 2020-2024 Akio Taniguchi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 2.0.1
published about 1 year ago
Rankings
Maintainers (1)
Dependencies
- Babel 2.10.3 develop
- Jinja2 3.1.2 develop
- MarkupSafe 2.1.1 develop
- PyYAML 6.0 develop
- Sphinx 5.1.1 develop
- alabaster 0.7.12 develop
- attrs 22.1.0 develop
- beautifulsoup4 4.11.1 develop
- black 22.8.0 develop
- certifi 2022.6.15.1 develop
- charset-normalizer 2.1.1 develop
- click 8.1.3 develop
- docutils 0.18.1 develop
- idna 3.3 develop
- imagesize 1.4.1 develop
- importlib-metadata 4.12.0 develop
- iniconfig 1.1.1 develop
- markdown-it-py 2.1.0 develop
- mdit-py-plugins 0.3.0 develop
- mdurl 0.1.2 develop
- mypy-extensions 0.4.3 develop
- myst-parser 0.18.0 develop
- nodeenv 1.7.0 develop
- pathspec 0.10.1 develop
- platformdirs 2.5.2 develop
- pluggy 1.0.0 develop
- py 1.11.0 develop
- pydata-sphinx-theme 0.9.0 develop
- pyright 1.1.270 develop
- pytest 7.1.3 develop
- requests 2.28.1 develop
- snowballstemmer 2.2.0 develop
- soupsieve 2.3.2.post1 develop
- sphinxcontrib-applehelp 1.0.2 develop
- sphinxcontrib-devhelp 1.0.2 develop
- sphinxcontrib-htmlhelp 2.0.0 develop
- sphinxcontrib-jsmath 1.0.1 develop
- sphinxcontrib-qthelp 1.0.3 develop
- sphinxcontrib-serializinghtml 1.1.5 develop
- typed-ast 1.5.4 develop
- urllib3 1.26.12 develop
- zipp 3.8.1 develop
- Pillow 9.2.0
- Pygments 2.13.0
- appnope 0.1.3
- asttokens 2.0.8
- backcall 0.2.0
- colorama 0.4.5
- cycler 0.11.0
- decorator 5.1.1
- executing 1.0.0
- fonttools 4.37.1
- ipython 7.34.0
- ipython 8.5.0
- jedi 0.18.1
- kiwisolver 1.4.4
- matplotlib 3.5.3
- matplotlib-inline 0.1.6
- numpy 1.21.6
- packaging 21.3
- pandas 1.3.5
- pandas 1.4.4
- parso 0.8.3
- pexpect 4.8.0
- pickleshare 0.7.5
- prompt-toolkit 3.0.31
- ptyprocess 0.7.0
- pure-eval 0.2.2
- pyparsing 3.0.9
- python-dateutil 2.8.2
- pytz 2022.2.1
- setuptools 65.3.0
- setuptools-scm 6.4.2
- six 1.16.0
- stack-data 0.5.0
- tomli 2.0.1
- traitlets 5.3.0
- typing-extensions 4.3.0
- wcwidth 0.2.5
- ipython --- - !ruby/hash:ActiveSupport::HashWithIndifferentAccess version: ">=7.10, <8.0" python: ">=3.7.1, <3.8" - !ruby/hash:ActiveSupport::HashWithIndifferentAccess version: "^8.0" python: ">=3.8, <3.11"
- matplotlib ^3.1
- pandas --- - !ruby/hash:ActiveSupport::HashWithIndifferentAccess version: ">=1.2, <1.4" python: ">=3.7.1, <3.8" - !ruby/hash:ActiveSupport::HashWithIndifferentAccess version: "^1.4" python: ">=3.8, <3.11"
- python >=3.7.1, <3.11