Save a project's file tags and comments to a trackable JSON file before copying it to another OS
Restore extended attributes onto files after cloning a git repository on a different platform
Keep file metadata like KDE tags consistent when moving files between Windows, macOS, and Linux
| trevorcash/crossxattr | 0xallam/my-recipe | 0xhassaan/nn-from-scratch | |
|---|---|---|---|
| Stars | 0 | — | 0 |
| Language | Python | Python | Python |
| Last pushed | — | 2022-11-22 | — |
| Maintenance | — | Dormant | — |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 2/5 | 4/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Python 3.13 or newer for the os.getxattr and os.setxattr functions.
crossxattr is a small Python script for saving and restoring extended file attributes, a feature offered by most operating systems that lets you attach extra metadata such as tags or comments to a file beyond its normal contents. Extended attributes are normally stored in a way that is specific to each operating system, so they do not survive being copied between Windows, macOS, and Linux, or being tracked in a git repository. This tool works around that by converting those attributes into a plain JSON file that can travel anywhere. The script works in two directions. In one mode, it scans a folder and all its subfolders, reads whatever extended attributes each file and directory already has, and writes them into a hidden file called dot xattr dot json, using names that are meant to work the same way across operating systems. In the other mode, it reads that JSON file back and applies the attributes to the real files, translating the generic names into whatever format the current operating system actually uses. If a project has more than one xattr JSON file at different folder depths, the script attaches each file's attributes to the closest one rather than always the top level file. Files that live inside a git repository automatically get their attributes stored in a JSON file at the root of that repository. So far the author has only tested this against a small set of KDE desktop attributes, namely user tags and user comments, so wider attribute support across operating systems appears to still be a work in progress. The script needs Python 3.13 or newer, since it depends on functions for reading and writing extended attributes that were added to Python's standard library at that version. This tool suits developers or power users who want their file tags and comments to survive being copied across operating systems or checked into version control, rather than general users.
A Python script that saves file extended attributes like tags into a JSON file so they survive being moved between Windows, macOS, and Linux.
Mainly Python. The stack also includes Python.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.