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.12.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.12-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pylitex-0.1.12.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.12.tar.gz
Algorithm Hash digest
SHA256 4d60bed811f228331f388f44f93e5cacc4b3a315a6381ef95ffcaa4e5db0caad
MD5 c7a4e60d9eb9258f7257cc988ec870d5
BLAKE2b-256 d33b68a5d7d8f69ecd2e8e76cdec1c0fc35909cd54213203b934082147178afd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylitex-0.1.12-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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 c0b8fd0feb46504b8739f01e25248e337e30d245a6234f0279c28597f0a18a25
MD5 2e4f96ce26dd40115eb0a0355db567cb
BLAKE2b-256 7edf49509301fa4a96cbdf7cd33be49c900acdf9661facc3fadf4bcd8e17af57

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