There are two commands: create and parse which are the first argument.
pylnk create c:\dir\file.txt shortcut
This command creates a shortcut for a file.
pylnk parse c:\dir\shortcut
pylnk parse c:\dir\shortcut path hot_key
The parse command reads a shortcut file, parses it and prints all information to std out. If a space separated list of properties is given, those properties will be printed out, each on one line in the order they are given.
:::python
import pylnk
link = pylnk.parse("C:\\path\\to\\shortcut to file.lnk")
print link.description
print link.path
The parse function creates a Lnk object from an existing LNK file. Currently, only LNKs with paths that start with a drive letter are supported.
:::python
import pylnk
link = pylnk.for_file("C:\\path\\to\\some file")
link.hot_key = "CONTROL+ALT+F"
link.save("C:\\path\\to\\shortcut to some file")
for_file() takes as first argument the target file to create a shortcut for. As second, optional, argument you can specify the shortcut name and then omit it in the save() method.
:::python
import pylnk
link = pylnk.create("C:\\path\\to\\crafted shortcut")
...
# populate Lnk object here
...
link.save()
If you know how, you can create a shortcut file from scratch with create(). You can leave out the file name there and specify it when saving instead. Creating LNKs from scratch unfortunately needs some knowledge about their internals.