SysMaid 
SysMaid is a high-level win32 api abstraction layer for Windows, allowing users to discover and optimize the system's background environment by writing simple Python scripts. It acts like a uBlock Origin for process management, designed to address the background resource abuse by "must-use software" and aims to become the most comprehensive AutoRun ecosystem on Windows.
Downloaded file disappeared?
Due to SysMaid's behavior involving system-level process monitoring and operations, some antivirus software (like Windows Defender) may misreport it as a potential threat. To ensure the program runs correctly, it is strongly recommended to add your script, the packaged .exe file, or its directory to your antivirus software's whitelist.
Core Features
- Concise Rule Definition: Intuitively define monitoring rules using Python decorators.
- Process and Service Monitoring: Easily monitor the status of specified processes, such as whether a window exists or if a process has exited.
- Automated Actions: Automatically execute actions when conditions are met, such as killing a process, stopping a service, or locking an encrypted volume.
- Extensibility: Easily add new conditions and actions to meet more complex needs.
Quick Start
Installation
pip install sysmaid
Requires Python 3.10 or higher
Usage
Create a Python file (e.g., my_rules.py) and add your rules:
import sysmaid as maid
if __name__ == "__main__":
# Rule 1: Kill Canva.exe if it's running without a window
Canva = maid.attend('Canva.exe')
@Canva.has_no_window
def _():
maid.kill_process('Canva.exe')
# Rule 2: Stop the related service when GameViewer.exe exits
GameViewer = maid.attend('GameViewer.exe')
@GameViewer.is_exited
def _():
maid.stop_service('GameViewerService')
# Rule 3: Kill CrossDeviceResume.exe when it is running
CrossDeviceResume = maid.attend('CrossDeviceResume.exe')
@CrossDeviceResume.is_running
def _():
maid.kill_process('CrossDeviceResume.exe')
# Rule 4: When Macrium Reflect finishes a backup or exits, automatically lock the backup drive (D:) and close the program
# (Requires BitLocker to be enabled on drive D)
Screen = maid.attend('Screen')
Screen.stop() # The screen listener is resource-intensive, so it's disabled by default
@Screen.has_windows_look_like('samples\\MacriumSuccess.png')
def _():
maid.kill_process('Reflect.exe')
Macrium = maid.attend('Reflect.exe')
@Macrium.is_running
def _():
Screen.start() # maid.attend instances can be started and stopped by rules
@Macrium.is_exited
def _():
maid.lock_volume('D')
Screen.stop() # Stop has lower priority than Start and is reference-counted, ensuring safe parallel use
# Rule 5: When CPU usage exceeds 80% for 10 consecutive seconds, report the top 5 CPU-consuming processes and log them.
Cpu = maid.attend('cpu')
@Cpu.is_too_busy(over=80, duration=10)
# You can also specify per-logical-processor thresholds to resolve average utilization calculation errors on heterogeneous CPUs.
# @Cpu.is_too_busy(over=[40,40,40,40,70,70,70,70], duration=5)
def _():
TopProcesses = maid.get_top_processes(5)
maid.alarm(TopProcesses)
maid.write_file('logs/TopProcesses.log',TopProcesses)
# Set log level and start monitoring
maid.set_log_level('INFO')
maid.start()
Then run it:
python my_rules.py
Deployment: Packaging as a Background Service
To achieve true "background standby" and auto-start on boot, it is recommended to use Nuitka to package your rule script into a standalone .exe executable. Nuitka compiles the Python script into C code, generating an efficient, dependency-free program.
Install Nuitka:
pip install nuitka
Packaging Command:
nuitka --standalone --windows-uac-admin --windows-console-mode=disable --mingw64 your_rules.py
--standalone: Creates a standalone folder with all dependencies included.--windows-uac-admin: Requests administrator privileges, which are necessary for operations like stopping services.--windows-console-mode=disable: Creates a windowless background application that won't show a black console window when run.--mingw64: Force the use of the MinGW64 compiler to prevent errors caused by Nuitka failing to find a C compiler.your_rules.py: Your rule script filename.
The output folder after a successful build is named your_rules.dist . To enable auto-start on boot, create a shortcut for the .exe file inside this folder and move it to the system's "Startup" folder.
Future Plans
SysMaid's goal extends beyond simple process management. We hope to develop it into the most comprehensive AutoRun ecosystem on Windows, including but not limited to:
- Richer trigger conditions (e.g., network activity, CPU/memory usage).
- More diverse response actions (e.g., modifying the registry, file operations).
- Providing a graphical user interface to make it accessible for users unfamiliar with programming.
- ...
Contributing
Contributions of any kind are welcome! If you have good ideas or find a bug, please feel free to submit an Issue or Pull Request. To capture logs, you can run the script directly in a Python environment and ensure the logging level is set to INFO or higher.
License
This project is open-sourced under the GPLv3 License.
Metadata
Release files for sysmaid 0.7.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sysmaid-0.7.10.tar.gz | 73.0 kB | With provenance | Details for sysmaid-0.7.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sysmaid-0.7.10-py3-none-any.whl | Python 3 | none | any | Details for sysmaid-0.7.10-py3-none-any.whl |
Total release size: 106.2 kB
Release files / sysmaid-0.7.10.tar.gz
| Download URL | sysmaid-0.7.10.tar.gz |
|---|---|
| Size | 73.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f256a7cf029e5de3425048c000f138a68f3e214cd5262b17798edb1e97d7656d
|
|
BLAKE2b-256 checksum How to use checksums |
2d6c831b14bb43df7320648da8469890d699daef8ffa1c163a56773a46a63594
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / sysmaid-0.7.10-py3-none-any.whl
| Download URL | sysmaid-0.7.10-py3-none-any.whl |
|---|---|
| Size | 33.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c71805eacd48322e21ed7099caf774629a88bc6820f84517d4cc85280c5726af
|
|
BLAKE2b-256 checksum How to use checksums |
b07c60d91009689aa040b4a3bfbe48ca5dbfd529026288afb307fa2e23b8054c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for sysmaid 0.7.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sysmaid-0.7.10.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.