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 - loudml/loudml-python: loudml-py is a Python client for interacting with Loud ML

BranchesTags
Open more actions menu

Latest commit

 

History

53 Commits
53 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
ci
ci
 
 
docs
docs
 
 
loudml_py
loudml_py
 
 
.codecov.yml
.codecov.yml
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.rst
README.rst
 
 
docker-compose.yml
docker-compose.yml
 
 
publish.sh
publish.sh
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 
sonar-project.properties
sonar-project.properties
 
 
tox.ini
tox.ini
 
 

Repository files navigation

Loud ML - Python

The Python client interface to the Loud ML model server.

Latest version released on PyPI Build status Test coverage License

Installation

loudml-python requires a running Loud ML model server . See Loud ML's quickstart for installation instructions.

loudml-python can be installed using pip similar to other Python packages. Do not use sudo with pip. It is usually good to work in a virtualenv or venv to avoid conflicts with other package managers and Python projects. For a quick introduction see Python Virtual Environments in Five Minutes.

To install loudml-python, simply:

$ pip install loudml-python

or from source:

$ python setup.py install

Getting Started

If you’ve installed loudml-python locally, the loudml command should be available via the command line. Executing loudml will start the CLI and automatically connect to the local Loud ML model server instance (assuming you have already started the server with systemctl start loudmld or by running loudmld directly). The output should look like this:

$ loudml
Connected to localhost:8077 version 1.6.0-577c87de
Loud ML shell 1.6.0-42136d38
>

You can get a description of the available commands:

> help

Client Classes: Loud and Job

The main helper in the Python client library is the Loud class. You can create an instance that connects to a remote Loud ML model server and run queries.

>>> from loudml_py.client import Loud
>>> loud = Loud(hosts=['localhost:8077'])
>>> models = loud.models.get(
        model_names=['first_model'],
        fields=['settings', 'state'],
        include_fields=True,
    )
>>> len(models)
1
>>> print(models[0]['state'])
{'trained': False}

Long running commands eg training return a job name. Use loudml.jobs.id(job_name) to create a class instance and then track the progress of the job or cancel it. loudml uses tqdm to display progress information.

def cancel_job_handler(*args):
    job.cancel()
    print('Signal received. Canceled job: ', job.id)
    sys.exit()

signal.signal(signal.SIGINT, cancel_job_handler)

while not job.done():
    time.sleep(1)
    job.fetch()

Data generator: loudml-wave

The loudml-wave tool is included in this package. You can use the application to output time series data with a given pattern and write the data to a bucket.

The output should look like this:

$ loudml-wave -v -f now-1h -t now --shape sin --tags tag_one:foo,tag_two:bar output_bucket
INFO:root:generating data from 2019-09-21 07:23:51.350293 to 2019-09-21 08:23:51.350316
Connected to localhost:8077 version 1.5.0.88.g5ad0216
INFO:root:writing 131 points
timestamp                value                    tags
1569043431.35            38369.884                tag_one=foo,tag_two=bar
1569043431.85            70881.022                tag_one=foo,tag_two=bar
1569043491.35            33949.816                tag_one=foo,tag_two=bar
1569043551.35            30892.148                tag_one=foo,tag_two=bar
1569043551.6833332       10851.922                tag_one=foo,tag_two=bar

You can get a description of the available commands:

$ loudml-wave -h

Change Log

Please see CHANGELOG.md.

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker.

Author

Loud ML

loudml-python is developed and maintained by Sebastien Leger (@regel). It can be found here: https://github.com/loudml/loudml-python

Special thanks to:

  • Christophe Osuna (@osunac) for all the review and packaging support.

License

This project is licensed under the MIT license. See the LICENSE file for more info.

About

loudml-py is a Python client for interacting with Loud ML

Resources

Readme
License
Activity
Custom properties

Stars

6 stars

Watchers

4 watching

Forks

3 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.