Skip to main content

A Python library which wraps Windows functions using CFFI

Project description

Python Windows Wrapper Using CFFI

build status build status (pylint and pep8) code coverage documentation badge

pywincffi is a wrapper around some Windows API functions using Python and the cffi library. This project was originally created to assist the Twisted project in moving away from its dependency on pywin32. Contributions to expand on the APIs which pywincffi offers are always welcome however.

The core objectives and design principles behind this project are:

  • It should be easier to to use Windows API functions both in terms of implementation and distribution.

  • Python 2.6, 2.7 and 3.x should be supported from a single code base and not require a consumer of pywincffi to worry about how they use the library.

  • Type conversion, error checking and other ‘C like’ code should be the responsibility of the library where possible.

  • APIs provided by pywincffi should mirror their Windows counterparts as closely as possible so the MSDN documentation can be more easily used as reference.

  • Documentation and error messages should be descriptive, consistent, complete and accessible. Examples should be provided for more complex use cases.

  • For contributors, it should be possible to develop and test regardless of what platform the contributor is coming from.

Development

This section gives a basic overview of the development process including the major goals. This is not comprehensive but should be a good introduction before submitting a pull request.

Support and Documentation

Besides this readme there are two other locations you can go to receive some help:

Python Version Support

This project supports Python 2.6 and up including Python 3.x. 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, six or other libraries for the most part.

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
pip install -r dev_requirements.txt
pip install -e .
cd docs
make html

The build process also builds the documentation to ensure there are not any obvious problems (including broken links).

Function Documentation

Windows API Functions are typically documented in the following format:

def DuplicateHandle(arg1, kwarg1=None):
    """
    A brief message about this function.

    .. seealso::

        <url to the MSDN API documentation for this function>

    :param type arg1:
        Brief information about this argument

    :keyword type kwarg1:
        Brief information about this keyword include it's default
        and how it's handled within the function.

    :raises SomeException:
        Some information on when this exception will be raised

    :rtype: type
    :return:
        Information about the data that's returned
    """

It’s important to note that the docs contain a seealso stanza. This is typically used to reference the MSDN documentation but may also be used to reference examples, white papers or other reference which may be useful in describing the function.

Adding new functions is covered in greater detail here

Testing

Nosetests

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 -r dev_requirements.txt
pip install -e .
nosetests tests

Continuous Integration

To consistently ensure the highest quality code, the following services are utilized to test or analyze every commit and pull request:

  • AppVeyor - Runs the unittests, builds wheel files, MSIs and other output artifacts which can be published in a release.

  • Travis - Runs the pep8 and pylint command line tools on the code base and tests. This also builds the docs so documentation problems are easily spotted.

  • Codecov - Analyses and displays code coverage results after tests have run on AppVeyor. Results are posted back to pull requests.

  • ReadTheDocs. - The official location where documentation is built and posted. This is generally for merges into the master branch however.

Vagrant

The continuous integration services above negate most of the need to setup your local workstation to handle development for pywincffi, even if you’re not running Windows. In some cases however it can be faster or easiear to work on your local machine.

If you’re not running Windows or you don’t have the tools necessary to develop pywincffi on your machine you can use Vagrant to build a Windows machine and start developing. There’s a more in depth explanation of this process located here:

https://pywincffi.readthedocs.org/en/latest/dev/vagrant.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywincffi-0.2.0.zip (44.6 kB view details)

Uploaded Source

Built Distributions

pywincffi-0.2.0-cp34-cp34m-win_amd64.whl (51.4 kB view details)

Uploaded CPython 3.4mWindows x86-64

pywincffi-0.2.0-cp34-cp34m-win32.whl (50.4 kB view details)

Uploaded CPython 3.4mWindows x86

pywincffi-0.2.0-cp33-cp33m-win_amd64.whl (51.4 kB view details)

Uploaded CPython 3.3mWindows x86-64

pywincffi-0.2.0-cp33-cp33m-win32.whl (50.4 kB view details)

Uploaded CPython 3.3mWindows x86

pywincffi-0.2.0-cp27-cp27m-win_amd64.whl (51.6 kB view details)

Uploaded CPython 2.7mWindows x86-64

pywincffi-0.2.0-cp27-cp27m-win32.whl (50.5 kB view details)

Uploaded CPython 2.7mWindows x86

pywincffi-0.2.0-cp26-cp26m-win_amd64.whl (51.8 kB view details)

Uploaded CPython 2.6mWindows x86-64

pywincffi-0.2.0-cp26-cp26m-win32.whl (50.8 kB view details)

Uploaded CPython 2.6mWindows x86

File details

Details for the file pywincffi-0.2.0.zip.

File metadata

  • Download URL: pywincffi-0.2.0.zip
  • Upload date:
  • Size: 44.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pywincffi-0.2.0.zip
Algorithm Hash digest
SHA256 5898e65acebaa356fb8667af7ab3e1662fc4bd30db43be102bec594e3a973af8
MD5 2a2645894d35678e94f6c45c12a11fad
BLAKE2b-256 f999c18e83080687bf0e01694ea6d5abb0252c9a08c6db0aae733bdaf3cc645b

See more details on using hashes here.

File details

Details for the file pywincffi-0.2.0-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for pywincffi-0.2.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 e16f3c48b53fce13243f855f4dc7cdac11e5291399f8fba5b931befb0d68530a
MD5 a0a3ef9561a16dba94fa314c5fbc0770
BLAKE2b-256 2f8ccf9980da1f5eca518372dad232cc66a0b44e855051886fbaeb39199ab2b0

See more details on using hashes here.

File details

Details for the file pywincffi-0.2.0-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for pywincffi-0.2.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 71a45db32767d4f9608c4568539e0bf1e7eb4e48bd325a6b71c3b81da3723db6
MD5 20b1a96c60ed679c076ca3e38aa6d01a
BLAKE2b-256 45255f02da1669f5fe8ed354003c1fa43ad891d3119f8dfaff676e24424fc654

See more details on using hashes here.

File details

Details for the file pywincffi-0.2.0-cp33-cp33m-win_amd64.whl.

File metadata

File hashes

Hashes for pywincffi-0.2.0-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 caf34a033f38f7e675cf497ba56c9d70a189bc8c1631320abbd63e00aceb54ea
MD5 4adf70c68728b8cf6fab83b6dc21dea2
BLAKE2b-256 8188b7bffad436b415fea7c7cdf28e68f863b319deee825cc26e798634f0b1f6

See more details on using hashes here.

File details

Details for the file pywincffi-0.2.0-cp33-cp33m-win32.whl.

File metadata

File hashes

Hashes for pywincffi-0.2.0-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 7acb89ec953de628629898311d8ba15ba9b07923a74a8514faf13c6acb38f0f9
MD5 ce1e32836f21c6642bffe473b5ca8311
BLAKE2b-256 cbffd8eda7aaa1b61a9c36f1b68b2e318f7d13b2ba4631e6390a8faad97749bd

See more details on using hashes here.

File details

Details for the file pywincffi-0.2.0-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for pywincffi-0.2.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 ef37ce4d156f9c1279266774dfd76e19d33fa624c6885a8c19961c3a0bf2fcdc
MD5 a8277e9fe70ca495d7524d34f1beb1c4
BLAKE2b-256 d4988b63d0fc1bc21148f48e29f3f4bb5536d4d86483c76b9c6ede924507449d

See more details on using hashes here.

File details

Details for the file pywincffi-0.2.0-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for pywincffi-0.2.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 314b2ea85d0df520e19141f51b395892015889c85f4d14923bee259b6e91568f
MD5 1be8f9db2e883a0cdd5d1856e82b762e
BLAKE2b-256 56ec418b1ad2c0fa5023bb7a1b026a1546c1540d8e35dbc8c36464efcb0c3bb5

See more details on using hashes here.

File details

Details for the file pywincffi-0.2.0-cp26-cp26m-win_amd64.whl.

File metadata

File hashes

Hashes for pywincffi-0.2.0-cp26-cp26m-win_amd64.whl
Algorithm Hash digest
SHA256 48e3b38eef8b4347c279fec5b5542c79056486e5b662049ed44d64d7bfaf80aa
MD5 c84a2c7cbd0b1f00c708417bf423ac23
BLAKE2b-256 5d115990f1b9e123ed4b68d521171a749d014c8177b56f95eafb1c8739265ffb

See more details on using hashes here.

File details

Details for the file pywincffi-0.2.0-cp26-cp26m-win32.whl.

File metadata

File hashes

Hashes for pywincffi-0.2.0-cp26-cp26m-win32.whl
Algorithm Hash digest
SHA256 830695a8524d29fa4fc819b6cac5acc95d96e2de763aaf84a20b7369fcc35b94
MD5 6d34a2593a9de8837305dedf914b1dad
BLAKE2b-256 d3137883bb421b398efc5f057e06f0e7c372b607015c0c5ad6acf4cd47d5b7b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page