GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - databox/databox-python: Databox bindings for Python

BranchesTags
Open more actions menu

Latest commit

 

History

85 Commits
85 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
examples
examples
 
 
src
src
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 

Repository files navigation

databox

Push API resources Open API documentation

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.4.1
  • Package version: 2.2.2
  • Generator version: 7.6.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import databox

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import databox

Tests

Execute pytest to run the tests.

Basic example

Please follow the installation procedure and then run the following:

# Configuration setup for the Databox API client
# The API token is used as the username for authentication
# It's recommended to store your API token securely, e.g., in an environment variable
configuration = databox.Configuration(
    host = "https://push.databox.com",
    username = "<YOUR-CUSTOM-DATA-TOKEN>",
    password = ""
)      

# It's crucial to specify the correct Accept header for the API request
with databox.ApiClient(configuration, "Accept", "application/vnd.databox.v2+json",) as api_client:    
    api_instance = databox.DefaultApi(api_client)    

    # Define the data to be pushed to the Databox Push API# Prepare the data you want to push to Databox
    # The 'key' should match a metric in your Databox account, 'value' is the data point, 'unit' is optional, and 'date' is the timestamp of the data point    
    push_data = [{"key": "sales2", "value": 100, "unit": "USD", "date": "2021-01-01T00:00:00Z" }]

    try:
        api_instance.data_post(push_data=push_data)        
    except ApiException as e:
        # Handle exceptions that occur during the API call, such as invalid data or authentication issues
        pprint("API Exception occurred: %s\n" % e)
    except Exception as e:
        # Handle any other unexpected exceptions
        pprint("An unexpected error occurred: %s\n" % e)
    

About

Databox bindings for Python

databox.com

Topics

databoxpythonsdk

Resources

Readme
MIT license
Activity
Custom properties

Stars

6 stars

Watchers

11 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.