Skip to main content
Loss of provenance

A previous release had provenance metadata, but this release does not. View details.

OpenShock Python Ask DeepWiki

PyPI - Version PyPI - Python Version PyPI - Implementation PyPI - Types

Tests

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 complete 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, OpenShockPYError
    
    client = OpenShockClient(
        api_key="YOUR_API_KEY",
        user_agent="YourAppName/YourAppVersion",
    )
    
  4. List devices or send an action:

    print(client.list_devices())
    client.shock("YOUR_SHOCKER_ID", intensity=50, duration=1000)
    
    # Or send to all shockers at once using "all" as the shocker ID
    client.shock("all", intensity=50, duration=1000)
    # Alternatively, use the explicit *_all methods
    client.shock_all(intensity=50, duration=1000)
    
  5. (Optional) Use as a context manager for automatic cleanup:

    with OpenShockClient(api_key="YOUR_API_KEY", user_agent="YourAppName/YourAppVersion") as client:
        client.list_devices()
    # Session is automatically closed when the block exits
    

    Note: The client also cleans up automatically when garbage collected, so the context manager is optional.

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

Or send a command to all shockers at once:

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

The CLI automatically sets an appropriate User-Agent.

Async client (opt-in)

If you prefer non-blocking operation, there is an experimental asynchronous client available: AsyncOpenShockClient. Install the optional dependencies:

pip install Nanashi-OpenShockPY[async]

Usage:

import asyncio
from OpenShockPY import AsyncOpenShockClient

async def main():
    async with AsyncOpenShockClient(api_key="YOUR_API_KEY", user_agent="YourAppName/YourAppVersion") as client:
        devices = await client.list_devices()
        await client.shock_all(intensity=50, duration=1000)

asyncio.run(main())

⚠️ Experimental / Unsupported: The AsyncOpenShockClient is an opt-in, experimental client provided for convenience. It is not officially supported or fully tested in production scenarios. Use at your own risk — APIs, behavior, or method signatures may change without notice. If stability and long-term support are required, prefer the synchronous OpenShockClient.

Installation options

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

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.

Metadata

Release files for Nanashi-OpenShockPY 0.0.1.9

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

Loss of provenance

These files do not have provenance metadata, despite files in a prior release including this data.

We recommend further investigation before installing these files. View details.

Source distribution (sdist)

Source distribution for Nanashi-OpenShockPY 0.0.1.9
File Size Uploaded Provenance Actions
nanashi_openshockpy-0.0.1.9.tar.gz 17.3 kB Without provenance Details for nanashi_openshockpy-0.0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Nanashi-OpenShockPY 0.0.1.9
File Interpreter ABI Platform Actions
nanashi_openshockpy-0.0.1.9-py3-none-any.whl Python 3 none any Details for nanashi_openshockpy-0.0.1.9-py3-none-any.whl

Total release size: 33.9 kB

Release files / nanashi_openshockpy-0.0.1.9.tar.gz

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL nanashi_openshockpy-0.0.1.9.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
604949c3aaaa28a5dd693f5180c33a696f15f9635a5178c0707fa563347bc06d
BLAKE2b-256 checksum
How to use checksums
2774ebc3eaf1becc4a8c70443aff368ee0e71b278130e561504cc0b2741e20f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / nanashi_openshockpy-0.0.1.9-py3-none-any.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL nanashi_openshockpy-0.0.1.9-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ce0b6e7815c661896a653bd872236cfa002fc86083cd58bb3b528951fe7a6a3
BLAKE2b-256 checksum
How to use checksums
bbb6551d39307076af2ab6c0078c4f78a3225d1a12fad8d78babebc9498c19c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.13.13

Security for Nanashi-OpenShockPY 0.0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Loss of provenance

A previous release of these files had provenance metadata, but this release does not.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Release comparison

  • Removed 0.0.1.7 2 files With provenance
  • Added 0.0.1.9 2 files Without provenance

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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