r/Python • u/RomfordNavy • Oct 29 '26
Discussion Alternative to libCST
Looking for a suggestion of an alternative CST parser to libcst. Have been trying to install libcst for over two days now but still unable to do so, I think the issue might be that there is no PyYaml `wheel` for Python 3.15.
So now wondering if there might be some other alternative CST parser available. I need to parse comments as well as other code so standard AST won't work as far as I know.
15
Upvotes
View all comments
1
u/RomfordNavy Oct 30 '26
Thanks for the suggestion u/michallandry62 but looks like Parso doesn't support 3.15 yet.
u/Wurstinator thanks for proving that libcast wouild install if I had a C compiler instaled. Was just about to install that but before I did was now considering whether libCST is actually the correct tool for what I want to do.
u/AleDev99 It's primary job is to modify source code and as part of that process one of it's tasks is to replace a holder, say '#replaceThis' with a block of code. I am now trying to establish whether libCST will allow that sort of replacement or whether that needs to be done a separate parse first.