Skip to main content

A headless login / logout script for 10.0.0.55

Project description

bitsrun

Ruff Pre-commit PyPI Publish PyPI PyPI - Python Version PyPI - Downloads

A headless login / logout script for 10.0.0.55 at BIT.

:sparkles: Blazingly™ Fast Rust re-implementation of bitsrun available at spencerwooo/bitsrun, if you require or prefer a single compiled executable (or 🦀 Rust).

Install

You need at least Python 3.8. We recommend installing with pipx.

python3 -m pip install --user pipx
python3 -m pipx ensurepath

After which, install bitsrun with pipx.

pipx install bitsrun

Alternatively, you can download a self-contained executable from GitHub Releases if you are working from an environment that does not have internet access.

Usage

CLI

Check login status of your device.

bitsrun status

Usage: bitsrun status [OPTIONS]

  Check current network login status.

Options:
  --json / --no-json  Output in JSON format.
  --help  Show this message and exit.

Note: this is the output of bitsrun status --help.

Login or logout with your username and password.

bitsrun login

Usage: bitsrun login/logout [OPTIONS]

  Log into or out of the BIT network.

Options:
  -u, --username TEXT  Your username.
  -p, --password TEXT  Your password.
  -v, --verbose        Verbosely echo API response.
  --help               Show this message and exit.

Note: this is the output of bitsrun login/logout --help.

Credentials config

Create new file named bit-user.json:

{
    "username": "xxxx",
    "password": "xxxx"
}

This file should be put under the following directory:

  • Windows: %APPDATA%\bitsrun
  • macOS and Linux: ~/.config/bitsrun (Following the XDG spec)

On unix, set the file permission to 600, i.e., only read/writeable by the owner:

chmod 600 path/to/bit-user.json

Now you can simply call:

bitsrun login
bitsrun logout

Besides, a system-wide configuration file is supported, and the location also depends on your platform.

To list all possible paths for your system (including those only for backward compatibility), call:

bitsrun config-paths

Raycast script (macOS)

raycast screenshot

Import the two Raycast scripts from ./scripts and setup your config file in ~/.config/bit-user.json. The script uses /usr/bin/python3 by default, so you either need to install bitsrun with this Python interpreter or setup your own Python interpreter path in the script.

Developing

Create virtual environment and install deps:

python -m venv venv
source venv/bin/activate
pip install -e .

Running CLI entry:

python src/bitsrun/cli.py

Build:

pip install setuptools build
python -m build

Credits and related

License

WTFPL 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 Distribution

bitsrun-3.7.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

bitsrun-3.7.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file bitsrun-3.7.0.tar.gz.

File metadata

  • Download URL: bitsrun-3.7.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for bitsrun-3.7.0.tar.gz
Algorithm Hash digest
SHA256 a51d6b3db590826f3ab5333940ddbce87816fd1b42db9c573f6b5479ee74bbac
MD5 b71465fd3168cb54dcc5a1d22be5f0e2
BLAKE2b-256 a5af33d8a60c1119555c361813b3bc0ab52f81c67571c0f222e6f7aff5dc90ad

See more details on using hashes here.

Provenance

File details

Details for the file bitsrun-3.7.0-py3-none-any.whl.

File metadata

  • Download URL: bitsrun-3.7.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for bitsrun-3.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7b47b9e347b227dde6e963420946b13e9320892348ee492b91c9378f393d23e
MD5 3c1a4e725e96d92f1a7b0e146f8fec8c
BLAKE2b-256 34ee98a2ab3f0a5fca77461440136a50aec040af8f032fe3493a615447a6c2fd

See more details on using hashes here.

Provenance

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