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 Python3, 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):

{"truely": boolean, "msg": str}

For pylitex.run_batch(), the return type is a python list[pylitexResult] like:

[
    {"truely": boolean, "msg": str},
    {"truely": boolean, "msg": str},
    ...
]

For pylitex.RunnerPool().get_results(), the return type is a python dict[list[pylitexResult]] like:

{
    "id1": [
        {"truely": boolean, "msg": str},
        {"truely": boolean, "msg": str},
        {"truely": boolean, "msg": str},
        ...
    ],
    "id2": [
        {"truely": boolean, "msg": str},
        {"truely": boolean, "msg": 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.9.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.9-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pylitex-0.1.9.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.9.tar.gz
Algorithm Hash digest
SHA256 18ed5644c135a39d39081cc8563382f8173d03bcd768dfe68ad888ae950e32c9
MD5 1b6952696cbc2ed4d0f4c07119414596
BLAKE2b-256 1e7b43ae1860d5df1500ac0fc7e463ea2a05938973ae2360afc1af988eb79e58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylitex-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8ce5723709c986e0515c259ddae8a7d3fd5028bc6190d0120eadf2bf6ec65d44
MD5 5077f5e1b41468ee30918511756db862
BLAKE2b-256 bfb6d6f7b2a3af7ee8754e489fe57bc47d12683ff5d8ede22317a7f8fbd9b5d3

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