Python module to, auto initialize and run filebrowser
Project description
Deployments
PyFileBrowser
Automatic initializer for filebrowser
The primary purpose of this repository is to make the installation and configuration of filebrowser
painless.
All the required configuration, settings, and user profiles are loaded using .env
files.
pyfilebrowser
downloads the appropriate executable automatically during startup.
Additionally, custom repository sources (in releases) can be configured by specifying the environment variables, GIT_OWNER
and GIT_REPO
Custom repository feature allows downloading the asset in latest release automatically.
asset naming convention:${operating system}-{architecture}-filebrowser-{extension}
example:darwin-amd64-filebrowser.tar.gz
Kick Off
Install
python -m pip install pyfilebrowser
Initiate
import pyfilebrowser
if __name__ == '__main__':
browser = pyfilebrowser.FileBrowser()
browser.kickoff()
Environment Variables
Env vars can either be loaded from .env
files or directly passed during object init.
.env
files
.config.env
- Loads the server's default configuration. Reference: config vars.user*.env
- Loads each user's profile specific configuration. Reference: user vars
Multiple user profiles can be loaded using .user1.env
, .user2.env
and so on.
User profile's permissions are automatically set based on the admin
flag.
Refer samples directory for sample .env
files.
:warning: Any configuration changes made in the UI will be lost, unless backed up manually.
Changes should always go through the.env
files.
[OR]
from pyfilebrowser import FileBrowser
if __name__ == '__main__':
file_browser = FileBrowser(
user_profiles=[
{"authentication": {"username": "admin", "password": "admin", "admin": True}},
{"authentication": {"username": "user123", "password": "pwd456", "admin": False}}
]
)
file_browser.kickoff()
:bulb: Object level instantiation might be complex for configuration settings. So it is better to use
.env
files instead.
Linting
pre-commit
will ensure linting, and generate runbook
Requirement
pip install sphinx==5.1.1 pre-commit recommonmark
Usage
pre-commit run --all-files
Pypi Package
https://pypi.org/project/pyfilebrowser/
Runbook
https://thevickypedia.github.io/pyfilebrowser/
License & copyright
© Vignesh Rao
Licensed under the MIT License
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.
Source Distributions
Built Distribution
Hashes for pyfilebrowser-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a809e8c60991fa481334dbe3f3e2df015c1e81ace751bd2d25f697c514ca4e0 |
|
MD5 | fb6901e58ad4b0067955eb1bd7459b3b |
|
BLAKE2b-256 | b0debe623e4cc88784f60263592fe64f87c6ab995238da7665708c2fd2f50f64 |