OP, do you mind sharing why exactly you need create to create a transaction from PK using library/3rd party API? It sounds like XY problem and we could suggest better solution if you tell what's your goal.
If you value security, I'd suggest downloading a wallet like electrum (from electrum.org). The initial sync of a new wallet can take a few minutes and a few MB but it's a lot faster than bitcoin core.
Electrum also support CLI[1] if OP use-case involve server which doesn't have GUI. The documentation doesn't mention all command though, so you need to run
electrum help or check the source code[2]
[1]
https://electrum.readthedocs.io/en/latest/cmdline.html[2]
https://github.com/spesmilo/electrum/blob/master/electrum/commands.py