Skip to main content

web.sh

https://img.shields.io/travis/westurner/web.sh.svg https://img.shields.io/pypi/v/web.sh.svg

web.sh is a cross-platform script (web) and API for launching a browser (with x-www-browser (Linux, Unix), open (OSX), start (Windows), or python -m webbrowser)

Features

  • Open the configured default system web browser with one or more paths or URIs

  • Open to a relative path

  • Open to an absolute path

Installation

Install the web (and x-www-browser-) scripts:

pip install web.sh
pip install -e https://github.com/westurner/web.sh

Usage

The web script commandline interface:

web .
web ./index.html
web $WORKON_HOME/dotfiles/src/dotfiles/docs/_build/html/index.html
web localhost:8082   #  pgs docs/_build/html  # pypi:pgs
web https://westurner.org/dotfiles/
web westurner.org/dotfiles github.com/westurner/dotfiles  # !HTTPS!
x-www-browser- .

web --help commandline help:

Usage: websh.py [-b|-x|-o|-s] [-v|-q] <url1> [<url_n>]

Open paths or URIS as tabs in the configured system default webbrowser

Options:
  -h, --help           show this help message and exit
  -b, --webbrowser     Open with `python -m webbrowser`
  -x, --x-www-browser  Open with `x-www-browser` (Linux, X)
  -o, --open           Open with `open` (OSX)
  -s, --start          Open with `start` (Windows)
  -v, --verbose
  -q, --quiet
  -t, --test

API

  • Instances of websh.websh.WebBrowser implement open_new_tab()

  • websh.websh.WebBrowser.x_www_browser calls open_new_tab() with a list of paths and/or URIs

  • web <urls> calls websh.websh.WebBrowser.x_www_browser to open new tabs for each path or URI:

    urls = (["https://westurner.org/dotfiles/",
             "https://github.com/westurner/dotfiles",
             "https://waffle.io/westurner/dotfiles"])
    output = list(WebBrowser.x_www_browser(urls))
    print(output)

Platform Notes

  • OSX: web -o ./README.rst and web -b ./README.rst open README.rst in the configured editor (not the configured system browser).

    Workarounds:

    • Specify the full path to a specific browser application followed by a quoted URI, for each URI in a newline-delimited list

History

0.1.1 (2015-06-21)

  • DOC: README.rst: links, Features, Usage, API

  • BLD: setup.py console_script entrypoint web = websh.web:main

  • BLD: setup.py console_script entrypoint x-www-browser- = websh.web:main

  • BUG,REF: websh.py: logging, logging config [07f9a0f]

  • BUG,CLN,DOC,REF,TST: websh.py: match_domain, :PymodeLintAuto, argv, logging config [4b33395]

  • ENH: websh.py: https://github.com/westurner/dotfiles/blob/master/scripts/web [29c0ca7]

  • BLD,RLS: *, setup.py, __init__.py: cookiecutter gh:audreyr/cookiecutter-pypackage [e288536]

0.1.2 (2015-06-21)

  • DOC: README.rst: API docs

  • RLS: setup.py, __init__.py: __version__ = 0.1.2

  • First release on PyPI

0.1.3 (2015-06-21)

  • DOC: README.rst, HISTORY.rst: formatting, links, release notes

0.1.4 (2015-06-21)

  • RLS: setup.py, __init__.py: __version = ‘0.1.4’ [8e33773]

  • BUG: websh.py: py26, py34 compat [a6ed31a]

  • BLD: tox.ini, .travis.yml: commands = python websh/websh.py -v -t [295abab]

  • DOC: websh.py, README.rst: usage docstrings [d054b43]

  • DOC: README.rst: links [bc1d06c]

Release files for web.sh 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for web.sh 0.1.4
File Size Uploaded
web.sh-0.1.4.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for web.sh 0.1.4
File Interpreter ABI Platform
web.sh-0.1.4-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 25.2 kB

Release files / web.sh-0.1.4.tar.gz

Download URL web.sh-0.1.4.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ea5c326d4f3f00979964f2a3edc97ac7d2e5ff86062af4ea32daa90bfef4f8e8
BLAKE2b-256 checksum
How to use checksums
afee27213b8a40979c620e896c5ae02ad8eed76b4f1b34a882fd90b093109e08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / web.sh-0.1.4-py2.py3-none-any.whl

Download URL web.sh-0.1.4-py2.py3-none-any.whl
Size 9.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
22f5c1ee2f45c4cc87d6e6f56301b6bb7b87c5f4cb0ac84f0fdbd5c121e89276
BLAKE2b-256 checksum
How to use checksums
9b336cbfe52d3e98ff717fb9da24562b19b110cb1130302317611d23c1264663
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page