Skip to main content

Library to interact with qcentroid agent api

Project description

qcentroid-agent-cli

deploy to pypi Python PyPI

Client library to interact with qcentroid agent API.

Functions

Functions:

  • obtain status, and context
  • obtain input data
  • send output data
  • set status
  • send execution logs

Install

pip install qcentroid-agent-cli

Use

As external agent:

from qcentroid_agent_cli import QCentroidSolverClient
base_url="https://api.qcentroid.xyz"
api_key="1234-4567-8910"
solver_id="123"

def main():
    
    print("Hello QCentroid Agent!")
    solver = QCentroidSolverClient(base_url, api_key, solver_id)

    while True: # put some escape function
        agent = solver.obtainJob()

        if agent :
            execute_job(agent)

        # Wait for 1 minute before the next iteration
        time.sleep(60)
   

if __name__ == "__main__":
    main()

As agent:

from qcentroid_agent_cli import QCentroidAgentClient

base_url = "https://api.qcentroid.xyz"
# job-id from EXECUTION_ID env var
# token from QCENTROID_TOKEN env var

agent = QCentroidAgentClient(base_url)
data = None
try:
  agent.start()
  data = agent.obtainData()
  #TODO job with data  
  agent.sendData(data)
  agent.end()
except BaseException as be:
  agent.error(be)
#end

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

qcentroid_agent_cli-0.3.9.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

qcentroid_agent_cli-0.3.9-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file qcentroid_agent_cli-0.3.9.tar.gz.

File metadata

  • Download URL: qcentroid_agent_cli-0.3.9.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for qcentroid_agent_cli-0.3.9.tar.gz
Algorithm Hash digest
SHA256 a0b05cc3ee4cf3e89ae9abdcd9da0bfa53cd77557641dcc68bf7a8094910dc2d
MD5 6e2176f27db0e38513d4b26215dccb99
BLAKE2b-256 6c4fcbeba738d8334ff0db5b1112d1c7475f4c9d1defb55eb593eb6b96c8c526

See more details on using hashes here.

File details

Details for the file qcentroid_agent_cli-0.3.9-py3-none-any.whl.

File metadata

File hashes

Hashes for qcentroid_agent_cli-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 2e716f77b332da5a8eec88a191c44ab17ad57826dca941a4a9c020080d12e644
MD5 2abf323b27a01317b0da03e121c0b8b9
BLAKE2b-256 42910d0d24dc015b9668c5a02c65a4cb109666dd0dd66ea6ede3804f680aa746

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