Use VHDL library

In _ToVHDL.py, function _writeModuleHeader() there is :

    if lib != "work":
        print("library %s;" % lib, file=f)
    if useClauses is not None:
        f.write(useClauses)
        f.write("\n")
    else:
        print("use %s.pck_myhdl_%s.all;" % (lib, _shortversion), file=f)
    print(file=f)
    if needPck:
        print("use %s.pck_%s.all;" % (lib, intf.name), file=f)
        print(file=f)

lib is set to “work” (default) at init then to library parameter if not None.
useClauses is set to use_clauses parameter.
needPck is True when enums are used in top level interface.

You can forget library parameter and only use use_clauses parameter.
use_clauses="library my_library;\nuse my_library.component;\n\nuse work.pck_myhdl_011.all;"

WARNING : pck_myhdl_011.vhd is automatically generated. The corresponding use clause is automatically inserted in the generated VHDL file except when use_clauses parameter is used. This is why you have to add it in use_clauses. The generated package contains MyHDL version number ! pck_myhdl_ 011 .vhd. Changing MyHDL version implies modifying your script for it to continue to generate correct output.