A library for working with .desktop files
Project description
desktop-entry-lib
desktop-entry-lib allows reading and writing .desktop files according to the Desktop Entry Specification
import desktop_entry_lib
def write() -> None:
entry = desktop_entry_lib.DesktopEntry()
entry.Name.default_text = "My App"
entry.Comment.default_text = "A short description"
entry.Comment.translations["de"] = "A short german description"
entry.Type = "Application"
entry.Exec = "my-app"
entry.write_file("my_app.desktop")
def read() -> None:
entry = desktop_entry_lib.DesktopEntry.from_file("my_app.desktop")
print("Name: " + entry.Name.default_text)
print("Comment: " + entry.Comment.default_text)
print("German translation for Comment: " + entry.Comment.translations.get("de", "None"))
print("Type: " + entry.Type)
print("Exec: " + entry.Exec)
if __name__ == "__main__":
write()
read()
Features:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
desktop-entry-lib-4.0.tar.gz
(14.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file desktop-entry-lib-4.0.tar.gz.
File metadata
- Download URL: desktop-entry-lib-4.0.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfdaa115d3c7285ad7c8c6f3d454b42390c6bb71a1a2c13877c800998353206f
|
|
| MD5 |
f5583f37256ff669540b49a282e3399b
|
|
| BLAKE2b-256 |
f953a64735d9730c084af8220c417c70ce097d42e1afcadd941827bbf89674a1
|
File details
Details for the file desktop_entry_lib-4.0-py3-none-any.whl.
File metadata
- Download URL: desktop_entry_lib-4.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83269358bd850313c8e0c8d154b8f0e4240f23cf0096fa28e9126c370719f794
|
|
| MD5 |
18fe3987fd620d2491f74bf353bc4766
|
|
| BLAKE2b-256 |
dcb0baf6a47a445aa7b343cf5aa23a41a2d88e486d51dbf8771607d6bfecf1e5
|