Skip to main content

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.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.7 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

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.

Additional Testing

As seen above, there are numerous tests besides the unittests. To run all the tests on Windows, much like the continuous integration systems do, you can run test.bat:

> check.bat

This will:

  • Check code style for both the library and tests.

  • Run all unittests.

  • Build the wheel file.

  • Build the documentation and treat warnings as errors.

Keep in mind that this will not setup the virtualenv or build environment for you. So if you can’t build the library or are missing a dependency then the above may fail.

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

Release files for pywincffi 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pywincffi 0.5.0
File Size Uploaded
pywincffi-0.5.0.zip 67.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pywincffi 0.5.0
File
pywincffi-0.5.0.win-amd64-py3.6.msi Details
pywincffi-0.5.0.win-amd64-py3.5.msi Details
pywincffi-0.5.0.win-amd64-py3.4.msi Details
pywincffi-0.5.0.win-amd64-py3.3.msi Details
pywincffi-0.5.0.win-amd64-py2.7.msi Details
pywincffi-0.5.0.win32-py3.6.msi Details
pywincffi-0.5.0.win32-py3.5.msi Details
pywincffi-0.5.0.win32-py3.4.msi Details
pywincffi-0.5.0.win32-py3.3.msi Details
pywincffi-0.5.0.win32-py2.7.msi Details
pywincffi-0.5.0-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
pywincffi-0.5.0-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details
pywincffi-0.5.0-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
pywincffi-0.5.0-cp35-cp35m-win32.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-32 Details
pywincffi-0.5.0-cp34-cp34m-win_amd64.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-64 Details
pywincffi-0.5.0-cp34-cp34m-win32.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-32 Details
pywincffi-0.5.0-cp33-cp33m-win_amd64.whl CPython 3.3 CPython 3.3 pymalloc Windows x86-64 Details
pywincffi-0.5.0-cp33-cp33m-win32.whl CPython 3.3 CPython 3.3 pymalloc Windows x86-32 Details
pywincffi-0.5.0-cp27-cp27m-win_amd64.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-64 Details
pywincffi-0.5.0-cp27-cp27m-win32.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-32 Details

Total release size: 2.8 MB

Release files / pywincffi-0.5.0.zip

Download URL pywincffi-0.5.0.zip
Size 67.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6a982f43e15474f737b9b89c3cce39470ae647df469258629214a83a2493706a
BLAKE2b-256 checksum
How to use checksums
f2fd12298c7f36b585e6870bee0d8921dc74b3d9dc5ff57fed3416c6f2c58dd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0.win-amd64-py3.6.msi

Download URL pywincffi-0.5.0.win-amd64-py3.6.msi
Size 167.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8f3488c8557408d687d8b63acf5d7f60b3e58ed9b3f2263e6b7a013b5c287793
BLAKE2b-256 checksum
How to use checksums
ea562ef7f95ea473d54610e0a4f853ac822c41178762b91e74a511e4b5ea45fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0.win-amd64-py3.5.msi

Download URL pywincffi-0.5.0.win-amd64-py3.5.msi
Size 167.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2d445f3b51aea51ee9df6f5b34e9075cb46c6270bb9ecaa18caad93209d9e808
BLAKE2b-256 checksum
How to use checksums
3c16b483b3c53caef7b3a2af9310303aa09824d9f188a9207ebae15d9bde229e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0.win-amd64-py3.4.msi

Download URL pywincffi-0.5.0.win-amd64-py3.4.msi
Size 163.8 kB
Tags Source
SHA-256 checksum
How to use checksums
08bc28290475fe4515c76caea5b4dcaf8a453edc9e0a1d2e1975414eda3365b1
BLAKE2b-256 checksum
How to use checksums
0e057d8aeac520483bf4842e3b8243c33c9159a9c9136aca54e0a0ce4acce9ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0.win-amd64-py3.3.msi

Download URL pywincffi-0.5.0.win-amd64-py3.3.msi
Size 229.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b8f1194d94b7ff49b76472b8e15d14adb9005238183a6012bf531b3019bf706a
BLAKE2b-256 checksum
How to use checksums
fc3c87089bcec0d2f6f5a2aa0bcd9f096198c996e78c5a9eb58db1b74c91d961
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0.win-amd64-py2.7.msi

Download URL pywincffi-0.5.0.win-amd64-py2.7.msi
Size 229.4 kB
Tags Source
SHA-256 checksum
How to use checksums
859710f3085eb65ac2b8ff7984d46df5abc207a80319e028b9ecbd53174c3625
BLAKE2b-256 checksum
How to use checksums
32a3ccb0b6cccd9fc3b35cb261663fec4e90748fb75abd16a0c890c3493f400d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0.win32-py3.6.msi

Download URL pywincffi-0.5.0.win32-py3.6.msi
Size 163.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f7de02dd9ea4bba667fd22ff729054803abd05f011f440a34bccc896c05ba5c7
BLAKE2b-256 checksum
How to use checksums
847042cc64a25ad3f01d0b4b6716f2116da8fa10e72b847cb3dbd0ab120a1d87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0.win32-py3.5.msi

Download URL pywincffi-0.5.0.win32-py3.5.msi
Size 163.8 kB
Tags Source
SHA-256 checksum
How to use checksums
63b034c7f7031eba9d73ff92920ea3c4c8730f1f341efd0dbe517f7eec6fb26f
BLAKE2b-256 checksum
How to use checksums
dad791fbc7dd2af76ff73a3d6182b90caa9b613f4b1d5ff92d16f496d2fec4ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0.win32-py3.4.msi

Download URL pywincffi-0.5.0.win32-py3.4.msi
Size 163.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e0c10cd68a8e4037ac83006167790525db5b68ed9ff850fd1c4d770f94f4f7d8
BLAKE2b-256 checksum
How to use checksums
dae6579daa91a913d20665ca5dffd9a4ad548a346a5c45fc0085023f7893b18f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0.win32-py3.3.msi

Download URL pywincffi-0.5.0.win32-py3.3.msi
Size 229.4 kB
Tags Source
SHA-256 checksum
How to use checksums
115280f1940104c024e8589c446024afc8721898c99312e45e3384eea8a211e4
BLAKE2b-256 checksum
How to use checksums
919361e8f0ec2691de92014b84def9eca148ea0f0cfb27e5b0e98ea95de19050
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0.win32-py2.7.msi

Download URL pywincffi-0.5.0.win32-py2.7.msi
Size 229.4 kB
Tags Source
SHA-256 checksum
How to use checksums
77ac06199e6e2060843c08a45914ebf8086df14067798887eafddcfb4fa465c7
BLAKE2b-256 checksum
How to use checksums
f46f1e7d5224a6828cfa6ab7d4dfb86ddddf476146e30373e9a2a9eb9709b8f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0-cp36-cp36m-win_amd64.whl

Download URL pywincffi-0.5.0-cp36-cp36m-win_amd64.whl
Size 83.9 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
ae8595b8d6fcca5fd03f56f94d780e1cb79dc63310020334487e6b1a34afd903
BLAKE2b-256 checksum
How to use checksums
7d63d736993a087ce2bc47fb2f4e549290620e016e47bb430225dcc9c5d9f164
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0-cp36-cp36m-win32.whl

Download URL pywincffi-0.5.0-cp36-cp36m-win32.whl
Size 81.0 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
868ec9c8ef01a2916fbe200adf4ba380f6beded0c87a6c7a218dc904f9d2ecbb
BLAKE2b-256 checksum
How to use checksums
e0cbcf33f4b7c3c2edbb13a8376e03ae62d70acd48fcad8448497b71386e95e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0-cp35-cp35m-win_amd64.whl

Download URL pywincffi-0.5.0-cp35-cp35m-win_amd64.whl
Size 83.9 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
471dba8c751ec3c981ebb162dbb37a439b6798917cf71eadcfa1da57d622e89e
BLAKE2b-256 checksum
How to use checksums
f5a5a9d27caa4e41b6bcdba8db54e9fef373d204c87482eece589359fe31cb84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0-cp35-cp35m-win32.whl

Download URL pywincffi-0.5.0-cp35-cp35m-win32.whl
Size 81.0 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
a2b948d5e2859f32b95cf3a394efa4bca3673e0cd7fdd2d5792d1d7292ea347e
BLAKE2b-256 checksum
How to use checksums
f9fe53fa8d1516a76b67b73a291391d39b9764b34b9516961aaf8900555c2bdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0-cp34-cp34m-win_amd64.whl

Download URL pywincffi-0.5.0-cp34-cp34m-win_amd64.whl
Size 81.5 kB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
8b62ea8027d95c4aa7d4bd4dcadc579827974463253eb7f07bed1f3a39f3fb8b
BLAKE2b-256 checksum
How to use checksums
4592b670a15f908eb0b4563900d201c23dd202f3813970dba45cb094d2fa26cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0-cp34-cp34m-win32.whl

Download URL pywincffi-0.5.0-cp34-cp34m-win32.whl
Size 79.6 kB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
0f19167130f07d090bee3d11746ee0a2ba42453579b1d35bf4e343b4d286ac74
BLAKE2b-256 checksum
How to use checksums
54e6ca5be63163e48e867dc47cf03d3e190a7a8bc30e7a85422fa6efbb5f2a63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0-cp33-cp33m-win_amd64.whl

Download URL pywincffi-0.5.0-cp33-cp33m-win_amd64.whl
Size 81.5 kB
Tags CPython 3.3 CPython 3.3 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
6aa728632369269bd3fa0c98a08fe216ecc172b6550b241173836de42c91bfdf
BLAKE2b-256 checksum
How to use checksums
2c89f71486776deb5566ad4702f0fb2a3b3a7624ee92b14c11e25765452aea66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0-cp33-cp33m-win32.whl

Download URL pywincffi-0.5.0-cp33-cp33m-win32.whl
Size 79.6 kB
Tags CPython 3.3 CPython 3.3 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
ad94756ac650aa7741f03763da3fa25fe034c370ce9c1169554dfa1a158cc5af
BLAKE2b-256 checksum
How to use checksums
da231a418fa1612cb40373292d80e7f6547760f861b6088597e14f329553b538
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0-cp27-cp27m-win_amd64.whl

Download URL pywincffi-0.5.0-cp27-cp27m-win_amd64.whl
Size 81.6 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
9ef0f3ccaf69b202df81c21915807b1154b4cffa25057576653fe8ec765be035
BLAKE2b-256 checksum
How to use checksums
136daa44a2f87ab86f77c6a9b2f19c1a23be0f44db749b2fe57154fa4bdf5572
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pywincffi-0.5.0-cp27-cp27m-win32.whl

Download URL pywincffi-0.5.0-cp27-cp27m-win32.whl
Size 79.6 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
58e31cca17f8f60893c700eb516135ec4ec83e725fe0f7701b3f2dbcbfd0bc32
BLAKE2b-256 checksum
How to use checksums
7d2d59b593a064f662fb76ab5b65f2831587dd68ff1ac81e37e05880a9d13a51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.5.0 This release

21 release files

0.4.0

21 release files

0.3.0

21 release files

0.2.0

9 release files

0.1.2

17 release files

0.1.1

17 release files

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page