Mita client for Python.
Project description
Mita
Mita, named as Multi-Tangled, is a web application for monitoring runtime status and data of multiple machines (clients).
Demo: https://mita-demo.controlnet.space
Get Started
Run Server
The server is used to accept client post data and host the web UI.
Docker
docker run \
-p <PORT>:9000 \
-e MITA_PASSWORD=<PASSWORD> \
[-e MITA_GUEST_PASSWORD=<GUEST_PASSWORD>] \
controlnet/mita[:<VERSION>]
Environment Variables
MITA_PASSWORD: Password for admin accessing the api and web for read/write.MITA_GUEST_PASSWORD: Password for guest accessing the api and web for read only.REACT_APP_PASSWORD: Optional, set the default password for the frontend.MITA_SECRET_KEY: Optional, Server secret key for CRSF token.MITA_TOKEN_SECRET: Optional, Server secret key for JWT authentication token.
Run Client
The client is the interface to post data to the server.
Now the python client is available. The other clients (nodejs, java, cli, ...) are in plan.
Python Client
Install the client from pypi:
pip install mita_client
Use the tqdm integrated client (require tqdm for progress bar):
from mita_client import mita_tqdm
import time
for i in mita_tqdm(range(1000), ADDRESS, PASSWORD):
time.sleep(0.1)
Use the fully client:
from mita_client.client import Mita
from mita_client.component import *
from mita_client.view import View
# initialize components
view = View("python_view")
logger = Logger("python_logger")
line_chart = LineChart("python_line_chart")
progress_bar = ProgressBar("python_progress_bar", total=100)
var = Variable("python_var", 100)
# register components to view
view.add(
var,
progress_bar,
logger,
line_chart
)
# update data in the runtime, and post to the client
with Mita(ADDRESS, PASSWORD) as client:
client.add(view)
for i in range(10):
logger.log(f"some msg {i}")
line_chart.add(1 + i, 1 + i, "pos")
line_chart.add(1 + i, 3.5 - i, "neg")
progress_bar.set(i * 8 + 1)
client.push()
License
| Module | License |
|---|---|
| server | AGPL |
| client | MIT |
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mita_client-0.0.7.tar.gz.
File metadata
- Download URL: mita_client-0.0.7.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23edacb095447c9b32835832764c82180b3119d861e7ba76409ee3b3f6970713
|
|
| MD5 |
7c4e2e4324f1e6d229bda3fae38ae2d0
|
|
| BLAKE2b-256 |
6eef89c3ef5e18aab50f1618ade1ce10ccc5d51d7a115e58d5f0c3e7430bb9a0
|
File details
Details for the file mita_client-0.0.7-py3-none-any.whl.
File metadata
- Download URL: mita_client-0.0.7-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b378744c79a939087f240e0ddfa5638851a090975981d5eb43cf042db473e525
|
|
| MD5 |
ffafd3b21b1f0bdb10475844e5e8e973
|
|
| BLAKE2b-256 |
cc617e8309641b7c7e44c7965727a3e59e68437bee5ddb9eb94db3548e61354a
|