Currenly, I'm using fonttools(https://github.com/fonttools/fonttools) to convert font file ttf to woff2 by ttx command with 2 steps
- convert 
ttftottx - then convert 
ttxtowoff2 
But it's too slow and ttx file to big, is there any way to convert ttf to woff2 directly by using fonttools to improve performance?
                        
With fonttools installed in your Python (virtualenv, pipenv, etc):
NOTE: you might need to install other
fontToolsdependencies ('brotli', others) to allow saving withflavor=woff2to work correctly.