herolib_python/_archive/openrpc
2025-08-05 15:15:36 +02:00
..
generator ... 2025-08-05 15:15:36 +02:00
model ... 2025-08-05 15:15:36 +02:00
parser ... 2025-08-05 15:15:36 +02:00
tools ... 2025-08-05 15:15:36 +02:00
__init__.py ... 2025-08-05 15:15:36 +02:00
factory_model.py ... 2025-08-05 15:15:36 +02:00
factory.py ... 2025-08-05 15:15:36 +02:00
readme.md ... 2025-08-05 15:15:36 +02:00

example how to use


from openrpc import openrpc_spec_write

#load all the specs and write the result in a dir
openrpc_spec = openrpc_spec_write(
    path="~/code/git.threefold.info/projectmycelium/hero_server/generatorexamples/example1/specs"
    dest="/tmp/openrpc/example1"
)

internal process

  • first we clean the code to only have relevant parts
  • then we find the blocks, can be function, enum or struct
  • then we parse the blocks