--snip--
Since you're the one who create the script, it should be safe. But if you have very serious security concern or writing script for business/enterprise usage, i'd recommend you to check whether library you use is malicious or not.
So running on local and connecting to rpc on local is safe, just i have to check the python library that's all?
Yes, but only when we're talking about the script. On bigger overview, you might need to pay attention to your OS/networking security
Assuming you don't have knowledge/experience to do it yourself, usually you either hire third party to perform security audit or use automated tool (such as
pip-audit).