IF you have a sufficiently recent version of Audacity, Audacity may be controlled, including applying effects, by sending commands to Audacity over a named pipe. Typically you would do this from Python, though it could also be done from bash, Perl, or any other scripting language that supports named pipes.
There is further information in the Audacity 2.3.2 manual here: Scripting - Audacity Manual