Skip to main content

Python module designed to streamline interactions with filebrowser

Project description

Deployments

Python

book pypi

none-shall-pass Delete old workflow runs

PyPI version shields.io Pypi-format Pypi-status

PyFileBrowser

Introducing pyfilebrowser, a Python library designed to streamline interactions with filebrowser

This wrapper simplifies integration and automation tasks, enabling seamless interaction with your local file system via filebrowser's web interface.

All the required configuration, settings, and user profiles are loaded using .env files. This provides a more centralized way of handling the configuration and initialization.

pyfilebrowser automatically downloads the system specific executable during startup.

Download custom-built executables

Additionally, custom source (to download binaries) can be configured by specifying the environment variables, GIT_OWNER and GIT_REPO
For this custom source feature to work, the executable should be uploaded to releases as assets, and follow the naming convention below.

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.start()

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
  • .user*.env - Loads each user's profile specific configuration. Reference: users

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. For nested configuration settings, refer the runbook

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.start()

Object level instantiation might be complex for configuration settings. So it is better to use .env files instead.

Coding Standards

Docstring format: Google
Styling conventions: PEP 8 and isort

Release Notes

Requirement

pip install gitverse

Usage

gitverse-release reverse -f release_notes.rst -t 'Release Notes'

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

pypi-module

https://pypi.org/project/pyfilebrowser/

Runbook

made-with-sphinx-doc

https://thevickypedia.github.io/pyfilebrowser/

License & copyright

© Vignesh Rao

Licensed under the MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pyfilebrowser-0.0.8-py3-none-any.whl (17.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page