I'd like to create a repository for a proprietary python module, similarly how this python package mlfinlabs. They have emptied out all functions like this:
def bet_size_dynamic(current_pos, max_pos, market_price, forecast_price, cal_divergence=10, cal_bet_size=0.95,
func='sigmoid'):
pass
def bet_size_budget(events_t1, sides):
pass
I found the libcst module, that parses the source code and you can do operations on it.
Is there a better practice of doing this? eg.: github actions? I can't find any other good solution.
Github action to sync from private to public repo. Using this github action: https://github.com/marketplace/actions/github-repo-sync
libcst
(project site) to strip functions afterwards (also as a github action step). Below is the codemod that you should put either\Lib\site-packages\libcst\codemod\commands
).libcst.codemod.yaml
(this is needed if you run the codemod on github actions):put your codemod then under:
In
replace_functions.py
put this snippet: