A Python library which wraps Windows functions using CFFI
Project description
Python Windows Wrapper Using CFFI
This library is a wrapper around some Windows functions using Python and CFFI. The repository was originally created to assist the Twisted project in moving away from pywin32 so installation does not require a compile step.
That said, contributions to this project to expand on the functionality are always welcome.
Development
Python Version Support
This project supports Python 2.6 and up including Python 3. PRs, patches, tests etc that don’t include support for both 2.x and 3.x will not be merged. The aim is also the support both major versions of Python within the same code base rather than rely on tools such as 2to3.
Documentation
The documentation for this this library is hosted on Read The Docs. It’s generated directly from this library using sphinx:
virtualenv env env/bin/activate PYWINCFFI_INSTALL_BUILD=1 pip install -e . cd docs make html
Function Documentation
Windows API Functions are typically documented in the following format:
def DuplicateHandle(arg1):
"""
A brief message about this function.
:param type arg1:
Brief information about this argument
.. seealso::
<url to the MSDN API documentation for this function>
"""
It’s important to note that the docs also contain a seealso link which points back to the original documentation provided by Microsoft. The link will contain more detailed information about a function’s specific behaviors and caveats than pywincffi’s docs may provide alone.
Testing
Tests are located in the tests/ directory. The tests themselves are run using nosetests either manually or using the setup.py file:
virtualenv env env/bin/activate pip install -e . python setup.py test
Every commit and pull request is also executed on AppVeyor. Tests can also be executed manually as well:
nosetests -v --with-coverage
You can also follow the documentation and use Vagrant to test locally on non-Windows platforms.