Skip to main content

Glaium SDK in Python for managing your Systems and Optimization

Project description

Glaium SDK

Install

Classes & Methods

Optimizer

optimizer(api_token,user,pw)

params:

  • api_token - Glaium API token for the organization
  • user - Username (manager or owner) for the organization
  • pw - Password for user login

return: json {error_code:response}

  • error code: 0 (ok) or not 0 (error)
  • response: {}

optimizer.model( oper, name)

params:

  • oper - Operation type:
    • get - Load a specific Model. Current available models:
      • Mobile Gaming
      • AdTech
      • SaaS (coming soon)
      • eCommerce (coming soon)
    • set - Update or save the current systems set in a new or existent Model.
    • del - Delete a specific Model.
  • name - Name for the model

return: json {error_code:response}

  • error code: 0 (ok) or not 0 (error)
  • response - json containing all systems (agents) from the model: {agent_name_1:agent_id_1,…agent_name_N:agent_id_N}

optimizer.goal(name, description, objective, constraints, resources)

params:

  • name - Goal name
  • description - Goal description
  • objective - json containing {’system’:system_id, ’target’:’metric_name’, ’comparison’: comparison operator (>, ≥, =, ≤, <) , ’outcome’: value expected, ’by’:date}
  • constraints - json containing {system_id_1:conditionals,…,system_id_N:conditionals}
  • resources - json containing {system_id_1:{resource_1:availability, … resource_N:availability}, … system_id_N:{resource_1:availability, … resource_N:availability}}

return: json {error_code:response}

  • error code: 0 ok or not 0 error
  • response - goal_id

System (Agents)

system(oper,name)

params:

  • oper - Operation type: add or del
  • name - Name for the system (agent)

return: json {error_code:response}

  • error code: 0 ok or not 0 error
  • response - system_id (ok) or error message

system.config(system_id, inputs, output, frequency, duration, constraints, resources)

params:

  • inputs - json containing {system_id_1:units needed,…,system_id_N:units needed}
    • units needed - An specific amount (float) or np.inf for all that is available
  • output - json containing {’name’: output_name, ‘unity’: type of unity, ’cumulative’:yes/no for accumulation between cycles, ‘returns’; yes/no for returning units from other systems}
  • frequency - when to start each cycle: ‘every hour’, ‘daily’, ‘every other day’, ‘every 1st day of month’…
  • duration - max duration to use as watchdog timer.
  • constraints - conditionals formula
  • resources - json containing {system_id_1:{resource_1:usage, … resource_N:usage}, … system_id_N:{resource_1:usage, … resource_N:usage}}

return: json {error_code:response}

  • error code: 0 (ok) or not 0 (error)
  • response - None (ok) or error message

system.optimization(system_id )

params:

  • system_id

return: json {error_code:response}

  • error code: 0 (ok) or not 0 (error)
  • response - json containing {’next_cycle’ : cycle number, ‘next_when’: datetime to start next cycle, ‘output’ : units expected for output, ‘inputs’: {‘input_1_name’ : units suggested for input 1, … ’input_N_name’ : units suggested for input N}}

system.start(system_id, cycle)

params:

  • system_id - Id of the system (agent) starting its process
  • cycle (optional) - number of cycle starting

return: json {error_code:response}

  • error code: 0 (ok) or not 0 (error)
  • response - None (ok) or error message

system.stop( system_id, status, stock, cycle)

params:

  • system_id - Id of the system (agent) starting its process
  • status - json containing {status_type:status_msg}
    • status_type: ok, halt (motive of halting process), hands-up (requires human intervention for <status_msg>) and error (type of error)
  • stock - current volume of units available in the output
  • cycle (optional) - number of cycle starting

return: json {error_code:response}

  • error code: 0 (ok) or not 0 (error)
  • response - None (ok) or error message

system.performance(system_id)

params:

  • system_id - Id of the system (agent) requesting performance information

return: json {error_code:response}

  • error code: 0 (ok) or not 0 (error)
  • response - json containing {’effectiveness’:%, ‘efficiency’:%, ‘average_duration’: number of seconds}

Data

data.integration( oper, integration)

params:

  • oper - Operation type
    • add - Add one or more new Integration(s)
    • del - Delete one or more existent Integration(s)
  • integration - json containing {name:integrator,… name_N:integrator}
    • name - Name of the Integration
    • integrator - Type of the Integration. See https://glaium.io/integrators/ for list available. Optional for del operation.

return: json {error_code:response}

  • error code: 0 (ok) or not 0 (error)
  • response - None (ok) or error message

data.pull(metrics,dimensions,conditional,period)

params:

  • metrics - Numeric primitives (float)
  • dimensions - Categorical primitives (string)
  • conditional - formula
  • period - initial and end datetimes or temporal expressions ("last 10 days", "end of year", "next 2 months", "yesterday", …)

return: json {error_code:response}

  • error code: 0 (ok) or not 0 (error)
  • response - pd.DataFrame (ok) or error message

data.normalize(data,primitive,how)

params:

  • data - pd.DataFrame
  • primitive - Primitive to normalize
  • how - json containing {’normalization_function’:’params’,…} with the following available functions:
    • automatic: list of terms to detect
    • custom: json containing {search_value:replace_value,…}
    • conditional: json containing {’if_condition’:value,…’else’:default_value}

return: json {error_code:response}

  • error code: 0 (ok) or not 0 (error)
  • response - pd.DataFrame (ok) or error message

data.push(data, integrations, when, frequency)

params:

  • data - pd.DataFrame
  • integrations - list of Integrations to push data to
  • when - datetime to push data to the list of integrations.
  • frequency - temporal expression. Ex: ‘every hour’, ‘daily’, ‘every other day’, ‘every 1st day of month’…

return: json {error_code:response}

  • error code: 0 (ok) or not 0 (error)
  • response - None or error message

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

glaium_sdk-0.1.2.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

glaium_sdk-0.1.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file glaium_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: glaium_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for glaium_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0a6d667d12ecd2cc44bbdf2b53b6e9b92fb48ee9c4ca2d50d7428d106c62f47a
MD5 60b420321a0e6e13ec9bb164315b3539
BLAKE2b-256 01eab390ade3e36c89e106aefecdb6f30631866625834ec82cb941db6e87d233

See more details on using hashes here.

File details

Details for the file glaium_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: glaium_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for glaium_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 18adb19cc66bf57de0e04629fcba236090a1fecc67082dc1683620931fb490c5
MD5 fab3e454db6be7785f4ba0f9704012ff
BLAKE2b-256 8d3304b6cf85195acfb2a05fc5f86334c75745f9b0952f86178c636d67552f89

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