I would like to perform some factor backtesting in python using a rank analysis, i.e. rank all of the stocks in a certain month based on some factor (say P/E ratio, attractiveness of CEO etc.) and then report an aggregate percentile performance (as in top 10% on average return was x% etc.). There is a package that does exactly that in R:
https://cran.r-project.org/web/packages/backtest/vignettes/backtest.pdf
The packages bt in python are providing an overall performance rather than the performance of the individual buckets.
To reiterate, my main goal is to obtain the performance of the buckets. A lot of the backtesting packages for python only provide overall performance.