Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atrophaneura/desktop-parser
Python library for parsing .desktop files
https://github.com/atrophaneura/desktop-parser
desktop freedesktop python python-library
Last synced: 6 days ago
JSON representation
Python library for parsing .desktop files
- Host: GitHub
- URL: https://github.com/atrophaneura/desktop-parser
- Owner: Atrophaneura
- License: gpl-3.0
- Created: 2022-09-17T20:14:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-18T00:02:10.000Z (over 2 years ago)
- Last Synced: 2024-11-26T12:12:54.195Z (2 months ago)
- Topics: desktop, freedesktop, python, python-library
- Language: Python
- Size: 37.1 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Desktop Parser
This is a parser for the [`.desktop` file format](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). It's used in [Desktop Creator](https://github.com/DesktopCreatorTeam/DesktopCreator).
## Installation
### From pypi
```bash
pip install desktop-parser
```### From source
```bash
git clone https://github.com/DesktopCreatorTeam/desktop-parser
cd desktop-parser
poetry install
```### From the AUR
```bash
yay -S python-desktop-parser
```## Usage
```python
from desktop_parser import DesktopFile# Parse a file
desktop_file = DesktopFile.from_file("path/to/file.desktop")desktop_file.data["Name"] = "New Name"
desktop_file.data["Exec"] = "new-exec"# Save the file
desktop_file.save("path/to/file.desktop")
```## Documentation
The documentation is available [here](https://desktopcreatorteam.github.io/desktop-parser/).
## License
This project is licensed under the GNU GPLv3 license - see the [LICENSE.md](LICENSE.md) file for details.
## Acknowledgments
* [Desktop Entry Specification](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html)
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Authors and Contributors
* [Desktop Creator Team](https://github.com/DesktopCreatorTeam/DesktopCreator)
- **[0xMRTT](https://github.com/0xMRTT)**