Skip to main content

Control a PiShock via the API.

Project description

pishockpy

Comfortably use the PiShock API in Python.
This requires at least Python 3

Usage

Import the package:

from pishockpy import PishockAPI

Declare a new shocker instance:

pishock = PishockAPI("YOUR_API_KEY", "YOUR_USERNAME", "SHARECODE", "YOUR_APP_NAME")

Run actions on a shocker:

# Send a shock - intensity (float between 0 and 1) and duration in seconds (integer between 1 and 15)
pishock.shock(INTENSITY, DURATION)

# Send a mini shock - intensity (float between 0 and 1)
pishock.minishock(INTENSITY)

# Send a vibration - intensity (float between 0 and 1) and duration in seconds (integer between 1 and 15)
pishock.vibrate(INTENSITY, DURATION)

# Send a sound - duration in seconds
pishock.beep(DURATION)

Check if an action was successful:

if(pishock.shock(INTENSITY, DURATION)):
    print("Shock was successful")
else:
    print("Shock was not successful")

Disclaimer

I'm not affiliated with PiShock in any way. I am also not responsible for any damage caused by this library.

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

pishockpy-0.0.4.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

pishockpy-0.0.4-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file pishockpy-0.0.4.tar.gz.

File metadata

  • Download URL: pishockpy-0.0.4.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for pishockpy-0.0.4.tar.gz
Algorithm Hash digest
SHA256 09a59a5ce10a83a701ded523bf3a55e9f1c5130efa308326beb18f6677f60072
MD5 61377d9187d72b6ffcb0fe1c16a1d741
BLAKE2b-256 c2a0879a4eca77f831dee0203d69bbf38908c7be2b157767a5731862b7526bf7

See more details on using hashes here.

File details

Details for the file pishockpy-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pishockpy-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for pishockpy-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fc24ed304fc541e52ae39cd03537531537d7a4e454dab4374e5cbf097e594ab3
MD5 efc2a12ae7d35518c15ab790e066d6bb
BLAKE2b-256 e1084a45b332200c170810d5e1b2887f5c67180e37155a9266de0c85830c02c9

See more details on using hashes here.

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