Skip to main content

UNOFFICIAL Lightweight Python client for the OpenShock API

Reason this release was yanked:

Version has mild typing issues, please use 0.0.0.2 instead

Project description

OpenShock Python

Unofficial, lightweight helper for the OpenShock API. Designed to be easy to use for anyone, with optional advanced controls for developers.

What this project offers

  • Simple Python client to list devices/shockers and send actions (shock, vibrate, beep).
  • Optional CLI for quick checks without writing code.
  • Keeps your API key in memory only; the CLI can store it securely via your system keyring.

License TL;DR (see full LICENSE.md for full terms)

  • Free for non-commercial, ethical use; you may study, modify, and share it.
  • You can include it in other open-source projects as a separate library component.
  • You must share source code for adaptations you distribute.
  • No commercial use, monetization, or commercial AI training without a separate license.
  • Adaptations must keep this license (unless used as a distinct component as allowed in Section 6A).

Quick start (Python)

  1. Install the library:

    pip install Nanashi-OpenShockPY
    
  2. Get your OpenShock API key from your account dashboard.

  3. Create a client with a User-Agent and your API key:

    from OpenShockPY import OpenShockClient
    
    client = OpenShockClient(
        api_key="YOUR_API_KEY",
        user_agent="YourAppName/1.0",
    )
    
  4. List devices or send an action:

    print(client.list_devices())
    client.shock("YOUR_SHOCKER_ID", intensity=50, duration=1000)
    

Optional CLI (no coding needed)

Install with CLI support:

pip install Nanashi-OpenShockPY[cli]

Store your API key securely, then list devices:

python -m OpenShockPY.cli login --api-key YOUR_KEY
python -m OpenShockPY.cli devices

Send a command (use a shocker ID, not a device ID):

python -m OpenShockPY.cli shock --shocker-id YOUR_SHOCKER_ID --intensity 40 --duration 1500

The CLI automatically sets an appropriate User-Agent.

Installation options

  • Library only (most people): pip install Nanashi-OpenShockPY
  • Library + CLI extras (adds keyring): pip install Nanashi-OpenShockPY[cli]
  • Development/editable install from this repo: pip install -e . (or pip install -e ".[cli]" for CLI)

Responsible use and licensing

  • This project is for non-commercial, ethical use only. Commercial use requires a separate license.
  • Respect local laws and the rights and safety of others when issuing control commands.
  • Full terms: LICENSE.md.

Need more detail?

Advanced options, API notes, and developer tips are available in ADVANCED.md.

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

nanashi_openshockpy-0.0.0.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nanashi_openshockpy-0.0.0.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file nanashi_openshockpy-0.0.0.1.tar.gz.

File metadata

  • Download URL: nanashi_openshockpy-0.0.0.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.9

File hashes

Hashes for nanashi_openshockpy-0.0.0.1.tar.gz
Algorithm Hash digest
SHA256 7a909385d30f1e5653b4b38d3466a81ae2f835eb7c027ffd93f385f250ca3cba
MD5 bab182f3cc85187f989874d1f8f19501
BLAKE2b-256 a4c090c2d91bb25efd508faadcb59e43cf34bfe7d43270c6f2c3e16baa883279

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanashi_openshockpy-0.0.0.1.tar.gz:

Publisher: python-publish.yml on NanashiTheNameless/OpenShockPY

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanashi_openshockpy-0.0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nanashi_openshockpy-0.0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 59d0139a616a3d3e3a427f44518e0b289e32b9e9d2fa3e35aac12f8dce60f4c7
MD5 7bc5f8b3c67198f7456dcbde00d55b9e
BLAKE2b-256 72398dc04feada586d83c70d6aa30a7e0a7a8bc6fa2b4ab2a7853ea51dd7c237

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanashi_openshockpy-0.0.0.1-py3-none-any.whl:

Publisher: python-publish.yml on NanashiTheNameless/OpenShockPY

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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