This is a super-simple project to read the global.index-url config value of pip without extra processes.
from indexurl import get_index_url
print(get_index_url())
indexurl is copyright Tim Hatch, and licensed under
the MIT license. I am providing code in this repository to you under an open
source license. This is my personal repository; the license you receive to
my code is from me and not from my employer. See the LICENSE
file for details.