Skip to main content

Useful functionality for managing Microsoft Windows.

Project description

Casement

A Python library that provides useful functionality for managing Microsoft Windows systems.

Features

  • App Model Id management for shortcuts and inside python applications to allow for taskbar grouping.
  • Finding, creating and moving shortcuts.
  • Pinning shortcuts to the taskbar and start menu.
  • Flashing a window to get a users attention.

Shortcut management

A interface for manipulating Windows shortcut files including pinned.

Pinning shortcuts to the start menu and task bar in windows is extremely complicated. You can find and edit shortcuts in the User Pinned directory for for all users, but adding, modifying or removing those shortcuts does not affect the pinned shortcuts. You need to point to a copy of the pinned shortcut, and run windows verbs on that shortcut.

Here is a example of pinning a shortcut to the start menu:

from casement.shortcut import Shortcut
with Shortcut(r'C:\Users\Public\Desktop\My Shortcut.lnk') as sc:
    sc.pin_to_start_menu()

Command line interface

The features of this class can be used from the command line using casement shortcut [command] [arguments].

To find shortcuts in common places with a given name:

    C:\blur\dev\casement>casement shortcut list "VLC media player.lnk"
    c:\ProgramData\Microsoft\Windows\Start Menu\Programs\VideoLAN\VLC media player.lnk
    c:\Users\Public\Desktop\VLC media player.lnk

Pinning/unpinning a shortcut to the taskbar:

    C:\blur\dev\casement>casement shortcut pin "C:\Users\Public\Desktop\My Shortcut.lnk" -t
    C:\blur\dev\casement>casement shortcut unpin "C:\Users\Public\Desktop\My Shortcut.lnk" -t

Installing

Casement can be installed by the standard pip command pip install casement. There is also an optional extras_require option pip install casement[pil] to allow creating shortcut icons by converting image files to .ico files.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

casement-0.1.0-py2.py3-none-any.whl (18.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file casement-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: casement-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for casement-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9ea6301c8b29983712ea05a88028cc77884b25b12a62a50b130817b94e99ae20
MD5 3507c9a8e489a74ef3ecf46f27b9294a
BLAKE2b-256 1764c6357c92af55d2b61ba1deb97a0b6fd848279f033a2a454a8998f277ddc2

See more details on using hashes here.

Supported by

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