IPython file upload widget
Project description
An IPython notebook widget to upload files, using FileReader.
Installation
Install using pip:
pip install fileupload jupyter nbextension install --py fileupload jupyter nbextension enable --py fileupload
Usage
import io from IPython.display import display import fileupload def _upload(): _upload_widget = fileupload.FileUploadWidget() def _cb(change): decoded = io.StringIO(change['owner'].data.decode('utf-8')) filename = change['owner'].filename print('Uploaded `{}` ({:.2f} kB)'.format( filename, len(decoded.read()) / 2 **10)) _upload_widget.observe(_cb, names='data') display(_upload_widget) _upload()
Base64 data is synced to the data_base64 member, decoded data can be obtained from data. The name of the uploaded file is stored in filename.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Built Distribution
Close
Hashes for fileupload-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0cac0e89cd76035dfaa5b5463b40782a2a097821a5b3fda27076f6b84298ab5 |
|
MD5 | 89fe8d010089d43b2f51fdfdfb3860d1 |
|
BLAKE2-256 | 5c82ffbd9e947f413bc9870ed631e5819d7321913bd51475fb95161b1b40f572 |