Skip to content

API/Lib #891

Open
Open

Description

@Muhammad-Ayan-No1

Is there a way to specify libraries? like I could specify that theirs an js equivalent library for this etc... Or at least to also transcrypt the Py libraries used? for system related tasks you can just emulate it and add function where we have global variables in js side containing them so as a dev I could edit them easily as well
Secondly a option for web/node for simple apis like multi threading and reading writing a file , creating a localhost (blob in web or using window.location method etc) etc...
Like this is a very useful py lib I also had to use some hacks to use it programtically, is there a API for that?

Activity

  1. JennaSys commented on May 24, 2025

    @JennaSys
    Collaborator

    I'm not completely sure exactly what you are asking, but I will answer the best I can.

    If you are wanting to substitute an equivalent JS library when you run the Transcrypt'd code and be able to also run the Python source code using a Python library, you can use the skip and ecom transpiler directives to conditionally use the JS library or the Python library depending on which environment is running. So, Python-only code would go in a skip/noskip block and JS-only code would go in an ecom/noecom block.

    As far as the second question, you are really only limited by whatever JavaScript can do.

    As of right now, there is no external API for transcrypt. If you wanted to programatically transpile Python code to JS, you would have to use a shell command via something like Python's subprocess module, like I mentioned on another thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions