Skip to main content

Introduction

A Python module for managing Cloud Variables.

Examples:

Example 1 for the CloudVar class.

import cloud_variables as cv


cloudvar = cv.CloudVar("https://apparent-gopher-******.upstash.io", "******") # Use the actual values here.

# Basic assignment
cloudvar["string"] = "Hello, World!"

# Retrieving values
print(cloudvar["string"]) # 'Hello, World!'

# Advanced mutable objects
cloudvar["list"] = [1, 2, 3]
cloudvar["list"].append(4)

print(cloudvar["list"]) # [1, 2, 3, 4]

# Deleting and popping items
cloudvar["key1"] = "value1"
cloudvar["key2"] = "value2"

del cloudvar["key1"] # Deleting keys.
value = cloudvar.pop("key2") # Popping keys
print(value) # 'value2'

# Some more methods

# Retrieving Python key-value pairs as dictionaries
print(cloudvar.items()) # {'string': 'Hello, World!', 'list': [1, 2, 3, 4]}

# Clearing everything
cloudvar.clear()
print(cloudvar.items()) # {}

Example 2 for the class AsyncCloudVar.

import cloud_variables as cv
import asyncio


async def main(): # Use asynchronous functions for full functionality access.
    async_cloudvar = cv.AsyncCloudVar("https://apparent-gopher-******.upstash.io", "******") # Use your actual values again.
    async_cloudvar.start()

    # Basic assignment
    async_cloudvar["string"] = "Hello, World!"
    
    # Retrieving values
    print(async_cloudvar["string"]) # 'Hello, World!'
    
    # Advanced mutable objects
    async_cloudvar["list"] = [1, 2, 3]
    async_cloudvar["list"].append(4)
    
    print(async_cloudvar["list"]) # [1, 2, 3, 4]
    
    # Deleting and popping items
    async_cloudvar["key1"] = "value1"
    async_cloudvar["key2"] = "value2"
    
    del async_cloudvar["key1"] # Deleting keys.
    value = await async_cloudvar.pop("key2") # Popping keys
    print(value) # 'value2'
    
    # Some more methods
    
    # Retrieving Python key-value pairs as dictionaries
    print(await async_cloudvar.items()) # {'string': 'Hello, World!', 'list': [1, 2, 3, 4]}
    
    # Clearing everything
    await async_cloudvar.clear()
    print(await async_cloudvar.items()) # {}

asyncio.run(main())

Installation

You can easily install the module by typing the command:

pip install cloud-python-vars

Metadata

Release files for cloud-python-vars 0.1.0

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

Source distribution (sdist)

Source distribution for cloud-python-vars 0.1.0
File Size Uploaded
cloud_python_vars-0.1.0.tar.gz 16.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cloud-python-vars 0.1.0
File Interpreter ABI Platform
cloud_python_vars-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.6 kB

Release files / cloud_python_vars-0.1.0.tar.gz

Download URL cloud_python_vars-0.1.0.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
04021ec8cdd8ada2ee65bfc9a91aae40738631fb0e70400e0b6ed8baf59d0944
BLAKE2b-256 checksum
How to use checksums
ed9413f92d1aac28a803bc2961d02f8381468d0bc87917683f0be45ad1aaf5fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / cloud_python_vars-0.1.0-py3-none-any.whl

Download URL cloud_python_vars-0.1.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79f618d3822e94f51b03e9404f7b82eaa2d812276b19694f4e0fd559f647f75e
BLAKE2b-256 checksum
How to use checksums
59af2fbd785de83e9756b01cf126ba61bb40dd16a2ec05713d959d53907a2416
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

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