Simple web file browser using flask
Features
Simple, like Python’s SimpleHTTPServer or Apache’s Directory Listing.
Downloadable directories, streaming tarballs on the fly.
Optional remove for files under given path.
Optional upload for directories under given path.
Player a simple player plugin is provided (without transcoding).
Install
It’s on pypi so…
pip install browsepy
You can get the development version from our github repository.
pip install git+https://github.com/ergoithz/browsepy.git
Usage
Serving $HOME/shared to all addresses
python -m browsepy 0.0.0.0 8080 --directory $HOME/shared
Showing help
python -m browsepy --help
Command-line arguments
–directory=PATH : directory will be served, defaults to current path
–initial=PATH : starting directory, defaults to –directory
–removable=PATH : directory where remove will be available, disabled by default
–upload=PATH : directory where upload will be available, disabled by default
–plugins=PLUGIN_LIST : comma-separated plugin modules
–debug : enable debug mode
Using as library
It’s a python module, so you can import browsepy, mount app, and serve it (it’s wsgi compliant) using your preferred server.
Browsepy is a Flask application, so it can be served along with any wsgi app just setting APPLICATION_ROOT in browsepy.app config to browsepy prefix url, and mounting browsepy.app on the appropriate parent url-resolver/router.
Browsepy app config (available at browsepy.app.config) provides the following configuration options.
directory_base, directory will be served
directory_start, starting directory
directory_remove, directory where remove will be available, defaults to None
directory_upload, directory where upload will be available, defaults to None
directory_tar_buffsize, directory tar streaming buffer size (must be multiple of 512), defaults to 262144
directory_downloadable whether enable directory download or not, defaults to True
use_binary_multiples wheter use binary units (-bibytes, like KiB) or not (bytes, like KB), defaults to True
plugin_modules module names (absolute or relative to plugin_namespaces) which comply the plugin spec
plugin_namespaces namespaces where relative plugin_modules are searched
Plugins
Starting from version 0.4.0, browsepy is extensible via plugins. An functional ‘player’ plugin is provided as example, and some more are planned.
Plugins are able to load Javascript and CSS files on browsepy, add Flask endpoints, and add links to them on the file browser (modifying the default link or adding buttons) based on the file mimetype. Look at tests and bundled plugins for reference.
Screenshots
Release files for browsepy 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| browsepy-0.4.0.tar.gz | 157.7 kB | Details |
Release files / browsepy-0.4.0.tar.gz
| Download URL | browsepy-0.4.0.tar.gz |
|---|---|
| Size | 157.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
149f5f8ecf1307cbb897ad14765ff79a34fe8b0fc18b840be8c1a6e91ad5f9f2
|
|
BLAKE2b-256 checksum How to use checksums |
82c1fab3f385c9ce8bd152d8247f5c1e67e07eac2917b4da6a73359ef1297749
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |