Metadata-Version: 2.4
Name: win32session
Version: 0.2.1
Summary: Python bindings for Windows session cleanup management.
Home-page: https://github.com/LorenEteval/win32session
Author: Loren Eteval
Author-email: loren.eteval@proton.me
License: MIT
Project-URL: Source, https://github.com/LorenEteval/win32session
Project-URL: Issues, https://github.com/LorenEteval/win32session/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: System :: Operating System
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

# win32session

[![Deploy PyPI](https://github.com/LorenEteval/win32session/actions/workflows/deploy-pypi.yml/badge.svg?branch=main)](https://github.com/LorenEteval/win32session/actions/workflows/deploy-pypi.yml)

Python bindings for win32 session cleanup management. This is a Windows-only package.

It works exactly the same
as [sysproxy daemon](https://github.com/LorenEteval/sysproxy?tab=readme-ov-file#sysproxy-daemon).

## Install

```
pip install win32session
```

## API

```pycon
>>> import win32session
>>> help(win32session) 
Help on module win32session:                                                                                                                                                                                                                                                    

NAME
    win32session

FUNCTIONS
    off(...) method of builtins.PyCapsule instance
        off() -> bool

        Stop the session daemon and release its callback.

    run(...) method of builtins.PyCapsule instance
        run() -> bool

        Run the session daemon.

    set(...) method of builtins.PyCapsule instance
        set(callback: Callable) -> None

        Set the session shutdown callback.
```

`off()` should normally be called before application exit. As a safety net, the
callback is owned by per-module state and is also released during module teardown.
It is never stored in a process-static C++ object.

## Tested Platform

win32session supports CPython 3.6 through 3.14 on Windows.

The following builds are covered by [GitHub Actions](https://github.com/LorenEteval/win32session/actions).

| Platform / architecture | Python versions |
|-------------------------|-----------------|
| Windows Server 2022 / AMD64 | 3.6-3.14, including 3.13t and 3.14t |
| Windows 11 / ARM64 | 3.11-3.14, including 3.13t and 3.14t |

Python 3.6-3.8 use the final compatible pybind11 2.x toolchain. Python 3.9 and
newer use the current pybind11 and cibuildwheel toolchain.
