Skip to main content

The Requests like WS module

Project description

RequestsWS

The Requests like WS module

Installation

pip install requestsWS

Usage

Sessions is not documented yet, but it works like requests

import requestsWS

payload = {
    "message": "hello world!"
}
resp = requestsWS.post("wss://localhost:8765", identifiers={"message": "Hi there!"}, json=payload)
print(resp.text)

payload = {
    "method": "server.ping"
}
requestsWS.keepConnection('ws://localhost:8765', interval=20, json=payload)

payload = "hello world"
resp = requestsWS.post("ws://localhost:8765", data=payload)
print(resp.json())

TO DO

  • Multiple connections at once (Use array instead of string), until then use Sessions
  • Add support for identifiers that are deeper into the json
  • Add string support for identifier (Check if identifier in string)
  • Add string support for identifier (Check if identifier in string)
  • Fix timeout

Documentation

Coming soon!

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

requestsWS-0.0.4.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

requestsWS-0.0.4-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: requestsWS-0.0.4.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.0.1 keyring/23.0.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for requestsWS-0.0.4.tar.gz
Algorithm Hash digest
SHA256 2af4ebaaeee34d75412faa5550390918dda46845e734c01a62245c512a2f8c75
MD5 b72a1f5d0455928ae4954c37b0adff2c
BLAKE2b-256 d6b7f378ac5d787e7e25774e3ccb41656357ee084458c1feb91e4096a5d70f4a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: requestsWS-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.0.1 keyring/23.0.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for requestsWS-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7aa56f776b33c3d6f4a81dc9c63850dd3e45f2a7daa743048d4591d27e20820e
MD5 4da84347c6913a84fe84cdc564683235
BLAKE2b-256 92b7fd8884e2d34e884e40f9bd4d7ede0c802154c7199be18bc237abcd0acf43

See more details on using hashes here.

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