Yes, sysconfig
module provides such API through get_path()
function:
Linux:
pdobrogost@host:~/tmp$ venv/bin/python -c "import sysconfig; print(sysconfig.get_path('scripts'))"
/home/users/pdobrogost/tmp/venv/bin
Windows:
X:\>venv\Scripts\python.exe -c "import sysconfig; print(sysconfig.get_path('scripts'))"
X:\venv\Scripts
References:
https://groups.google.com/forum/#!topic/comp.lang.python/s3vLkVy2xJk
https://mail.python.org/pipermail/distutils-sig/2014-February/023867.html
Thank you Ned Batchelder, Oscar Benjamin, Paul Moore and Vinay Sajip for help.