whatisgithub

What is crossxattr?

trevorcash/crossxattr — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · developerComplexity · 2/5Setup · easy

In one sentence

A Python script that saves file extended attributes like tags into a JSON file so they survive being moved between Windows, macOS, and Linux.

Mindmap

mindmap
  root((repo))
    What it does
      Saves extended file attributes
      Cross platform JSON format
      Restores native attributes
    Tech stack
      Python
    Use cases
      Preserve file tags across OS
      Track file metadata in git
      Backup extended attributes
    Audience
      Developers
      Power users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Save a project's file tags and comments to a trackable JSON file before copying it to another OS

USE CASE 2

Restore extended attributes onto files after cloning a git repository on a different platform

USE CASE 3

Keep file metadata like KDE tags consistent when moving files between Windows, macOS, and Linux

What is it built with?

Python

How does it compare?

trevorcash/crossxattr0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultyeasymoderatemoderate
Complexity2/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires Python 3.13 or newer for the os.getxattr and os.setxattr functions.

So what is it?

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.

Copy-paste prompts

Prompt 1
Explain how to run this script in fromFiles mode to back up my extended attributes
Prompt 2
Walk me through restoring attributes from a .xattr.json file with toFiles mode
Prompt 3
Help me check whether my Python version supports the getxattr and setxattr functions this script needs

Frequently asked questions

What is crossxattr?

A Python script that saves file extended attributes like tags into a JSON file so they survive being moved between Windows, macOS, and Linux.

What language is crossxattr written in?

Mainly Python. The stack also includes Python.

How hard is crossxattr to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is crossxattr for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.