Python package for Litex core
Project description
Pylitex
This is a Python api library for Litex core, which aims to help Python users to interact with Litex core.
installation
This reuqires Litex core and Python(version >= 3.12), you could install Litex core follow the Installation.
After Litex core installation, you could install litex for your python environment:
# remember to install Litex core before install pylitex
# change your Python env to which your are using
# then run following commands
pip install pylitex
usage
Import pylitex as you installed.
import pylitex
run fill code
# run full code
result = pylitex.run("code...")
# run full codes with multi-process
results = pylitex.run_batch(["code1...", "code2..."], 2)
run continuous codes
# run continuous codes in one litex env
litex_runner = pylitex.Runner()
result1 = litex_runner.run("code1...")
result2 = litex_runner.run("code2...")
litex_runner.close()
# run continuous code in litex multi-process pool
litex_pool = pylitex.RunnerPool()
litex_pool.inject_code({id: "id1", code: "code1..."})
litex_pool.inject_code({id: "id2", code: "code2..."})
litex_pool.inject_code({id: "id1", code: "code3..."})
litex_pool.inject_code({id: "id1", code: "code4..."})
litex_pool.inject_code({id: "id2", code: "code5..."})
results = litex_pool.get_results()
litex_pool.close()
return type
For pylitex.run() and pylitex.Runner().run(), the return type is a python dict like (Call it pylitexResult):
{"success": boolean, "payload": str, "message": str}
For pylitex.run_batch(), the return type is a python list[pylitexResult] like:
[
{"success": boolean, "payload": str, "message": str},
{"success": boolean, "payload": str, "message": str},
...
]
For pylitex.RunnerPool().get_results(), the return type is a python dict[list[pylitexResult]] like:
{
"id1": [
{"success": boolean, "payload": str, "message": str},
{"success": boolean, "payload": str, "message": str},
{"success": boolean, "payload": str, "message": str},
...
],
"id2": [
{"success": boolean, "payload": str, "message": str},
{"success": boolean, "payload": str, "message": str},
...
],
...
}
Project details
Release history Release notifications | RSS feed
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 pylitex-0.1.13.tar.gz.
File metadata
- Download URL: pylitex-0.1.13.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
207d390ed244738a358a778949b4ccb621cdde014c43fc17491a692712ec9a84
|
|
| MD5 |
40f181ba7394688b4a1b34615776e07e
|
|
| BLAKE2b-256 |
21f3800d34c8b57b90b8ce5881ec3cd1e262781aebe2158c03fb3219f3565c04
|
File details
Details for the file pylitex-0.1.13-py3-none-any.whl.
File metadata
- Download URL: pylitex-0.1.13-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93491d6b26ef6bdef9114ee7b525e7999dce9b01b018a0d079c5655993a2edf8
|
|
| MD5 |
672039ae5f94b853430b0b2470bed806
|
|
| BLAKE2b-256 |
b36440fcf07389ad53d056bf7cce800b34e5ee476829f71274a3b96ae36798cf
|