Python and AFSDK project
Please check this blog post too. (OSIsoft : PI Square) https://pisquare.osisoft.com/community/developers-club/pi-net-framework-pi-af-sdk/blog/2017/03/30/python-36-and-afsdk-example
For using this code, it requires .net function. http://pythonnet.github.io/