HTTPState, httpstate.com
Project description
httpstate (python)
Quick Start
Install
pip install httpstate
Import
import httpstate
Pick any valid UUID v4. You can generate one here.
We'll use 45fb3654-0e92-44da-aa21-ca409c6bdab3 or 45fb36540e9244daaa21ca409c6bdab3 (without dashes).
Store some data with
httpstate.set('45fb36540e9244daaa21ca409c6bdab3', 'Hi! 👋🏻')
and retrieve it with
data = httpstate.get('45fb36540e9244daaa21ca409c6bdab3')
You can also get realtime updates
hs = httpstate.HttpState('45fb36540e9244daaa21ca409c6bdab3')
hs.on('change', lambda data: print(f'This will change everytime data is set [{data}].'))
That's it! 🐙
API
Functions
-
get(uuid)Get state of UUIDv4. ReturnsNone|str. -
message.unpack(bytes)Unpack binary WebSocket message intoMessageType(uuid, timestamp, type, value). -
post(uuid, data=None)Alias forset. ReturnsNone|int. -
put(uuid, data=None)Alias forset. ReturnsNone|int. -
read(uuid)Alias forget. -
set(uuid, data=None)Set state of UUIDv4. ReturnsNone|int. IfdataisNone, defaults to''. -
write(uuid, data=None)Alias forset.
HttpState Class
HttpState(uuid)Create a reactive state instance of UUIDv4.<HttpState>.dataProperty with the most up-to-date state value.
<HttpState>.get()Get state. ReturnsNone|str.<HttpState>.post(data=None)Alias forset.<HttpState>.put(data=None)Alias forset.<HttpState>.read()Alias forget.<HttpState>.set(data=None)Set state. ReturnsNone|int. IfdataisNone, defaults to''.<HttpState>.write(data=None)Alias forset.
<HttpState>.off(type, callback)Unsubscribe from realtime updates.<HttpState>.on(type, callback)Subscribe to realtime updates.change: fired when state data changes. Callback receives current data as argument.
<HttpState>.delete()Cleanup and delete the instance.
About
Alex Morales, moralestapia.com
Copyright © Alex Morales, 2026
Contact
Comments, feature requests, etc. are welcome at inbox @ httpstate.com.
License
Unless otherwise stated in particular files or directories, this software is free software.
You can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
See LICENSE for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file httpstate-0.0.22.tar.gz.
File metadata
- Download URL: httpstate-0.0.22.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0984956c0ebe4112d7480a4a095f7e5934f6fea628153fdbef6e1c8cf96972f7
|
|
| MD5 |
462fb73cb32c06a70ef43a7d73947800
|
|
| BLAKE2b-256 |
5b7c207c40ddd6f922345aaec6699dad6f4bb68542dfc5482234c0d9534b6877
|
File details
Details for the file httpstate-0.0.22-py3-none-any.whl.
File metadata
- Download URL: httpstate-0.0.22-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbfe18d9d4010d768640fd992af67b28a2810b22fc67dbe88a817c127bf5bdbf
|
|
| MD5 |
198148d58e7dd3c44194780e6a2ad5e9
|
|
| BLAKE2b-256 |
aad094096bea15e2c3e203bfdf2b19b6d9ea0c795413f2a8f22c0557b70b77ae
|