Skip to main content

HTTP State, 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 real-time 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.

  • read(uuid)
    Alias for get.

  • set(uuid, data)
    Set state of UUIDv4.

  • write(uuid, data)
    Alias for set.

HttpState Class

  • HttpState(uuid)
    Create a reactive state instance of UUIDv4.

  • <HttpState>.get()
    Get state.
  • <HttpState>.read()
    Alias for get.
  • <HttpState>.set(data)
    Set state.
  • <HttpState>.write(data)
    Alias for set.

  • <HttpState>.off(type, callback)
    Unsubscribe from real-time updates.
  • <HttpState>.on(type, callback)
    Subscribe to real-time updates (type = change).

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

httpstate-0.0.12.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

httpstate-0.0.12-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file httpstate-0.0.12.tar.gz.

File metadata

  • Download URL: httpstate-0.0.12.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for httpstate-0.0.12.tar.gz
Algorithm Hash digest
SHA256 a8aadbf9fac59e2a6abd92c808a8430aeb3bc1c556ff240dd4e8cc6600940fac
MD5 3a216c303680382e1eebddc3a000a357
BLAKE2b-256 88bbd2e90e7f68e72b22333f7f5d34493f40196482b5ef4788ec154c9507dc5d

See more details on using hashes here.

File details

Details for the file httpstate-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: httpstate-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for httpstate-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 528bb7aa16059dc7bfc4671850ed793c27b98f19371ad15d04b59db793323105
MD5 541846bda05b9e803dbcccf93135b1b8
BLAKE2b-256 1a1112fc4999a8d4b0557e28b14e34774581f6274daac9c5027b663d442d1fb7

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