Skip to main content

A python value api connector

Project description

Value API - Python Connector

A Python client for the Value API Server.

Install

pip install valueapiconnector

Usage

from valueapiconnector import ValueApiConnector, ValueDataType, ABCValue
connector = ValueAPIConnector("https://values.my-server.com/")
# The auth token is optional
context = connector.get_context("test",
        auth_token="<my_secret_token>",
    )
context.update_auth_token("<my_secret_token>")
x = context.get_value("my_int_list", ValueDataType.INTEGER_LIST)
print(x.pull().unwrap()) # []
x.push([1, 2, 3])
print(x.pull().unwrap()) # [1, 2, 3]
x.delete()
print(x.pull().unwrap()) # []

class TestValues(ABCValue):
    def __init__(self, identifier):
        super().__init__(context, identifier)

    def __str__(self) -> str:
        return str(self.__dict__)

test_obj = TestValues(1)
print(test_obj) # {}
test_obj.x = 24
test_obj.y = [4, 5]
print(test_obj) # {x: 24, y=[4,5]}
test_obj = TestValues(1)
print(test_obj) # {x: 24, y=[4,5]}
test_obj = TestValues(2)
print(test_obj) # {}

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

valueapiconnector-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

valueapiconnector-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file valueapiconnector-0.1.0.tar.gz.

File metadata

  • Download URL: valueapiconnector-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.11

File hashes

Hashes for valueapiconnector-0.1.0.tar.gz
Algorithm Hash digest
SHA256 93517b885f391a247979c3cae980b3079fb1e837b2caa83a0dff94a7b4cd4fe1
MD5 f2177803783326e8aa1b09f37b50b27a
BLAKE2b-256 37fd6341872f179313b2a224ad160170d0b97d45225702be0513d6b4463809e8

See more details on using hashes here.

File details

Details for the file valueapiconnector-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for valueapiconnector-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7eb61d315031899e2ee3de8ee084d2f9623c9a5a40a37ace431c851d7e5dc93c
MD5 abc22a6e7a52c7fbba94e5747388384c
BLAKE2b-256 3e7d4b959bfc8ab5ddbe56a0c02018bbf3603142f95e4650d1d945eca7cb2af9

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