Skip to main content

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:

# 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylitex-0.1.11.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

pylitex-0.1.11-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file pylitex-0.1.11.tar.gz.

File metadata

  • Download URL: pylitex-0.1.11.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pylitex-0.1.11.tar.gz
Algorithm Hash digest
SHA256 677d13f0dda32638b4f89126d9656a81315fdfa1478c73ead204e1d41da36e48
MD5 7e5f5092a76b8875210d358a89c5e605
BLAKE2b-256 2e987d5b10b2fcf42790e2619e84d3aa9f1d84bd702cdcb58f56d651c9c126ef

See more details on using hashes here.

File details

Details for the file pylitex-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: pylitex-0.1.11-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

Hashes for pylitex-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 ef576601fefb06935cb86e28f8c8153a380de2d89d35eeb46b48e94a6b5fd488
MD5 a60c83b17e680247cf44e97e08846b3c
BLAKE2b-256 fc153f027c71340b31d68412069e35383a91eb712a6bd8b52244648720a46fc9

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