--- id: xattr version: "1.3.0" license: MIT license_treatment: permissive maintenance: aging --- # xattr — Python wrapper for extended filesystem attributes License: permissive · Maintenance: aging · Downloads: 17.6M/mo ## What it is and what it does xattr is a Python wrapper around the extended filesystem attributes available on modern Unix-like systems (macOS 10.4+, Linux 2.6+, BSD, Solaris). It lets you read, write, and delete metadata stored as name-value pairs directly on files and directories, beyond the standard file permissions and timestamps. The package depends on cffi for C bindings and includes both a Python API and a command-line tool for attribute manipulation. Extended attributes are useful for storing application-specific metadata, file tags, or custom properties without modifying file content. On Linux, attribute keys must be prefixed with 'user.' namespace. The package supports current Python versions (3.9+) and is available as precompiled wheels for common platforms, though it requires a filesystem and OS that support extended attributes. Use it for: - Store application-specific metadata or tags on files without modifying file content or using sidecar files. - Implement file tagging or classification systems that persist in the filesystem independently of the file itself. - Migrate or inspect extended attributes across systems using the command-line tool or Python API. - Access macOS file metadata like creation date or file kind via extended attributes (though osxmetadata is recommended for Spotlight metadata). - Build tools that need to associate custom properties with directories or symlinks in a filesystem-native way. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. xattr is a Python wrapper for reading and writing extended filesystem attributes on macOS, Linux, BSD, and Solaris, with a command-line tool included. Yes, if you need to work with extended filesystem attributes on macOS, Linux, or BSD. The package is stable, permissively licensed, and has no known vulnerabilities. Install friction is moderate due to C compilation, but wheels are available for modern Python versions. Maintenance has slowed (last release 305 days ago), so verify that your use case doesn't require active development or recent bug fixes. ## Install pip install xattr uv add xattr poetry add xattr ## Installing xattr Before you install: Medium install friction due to compiled C extensions (cffi dependency); wheels are available for modern Python versions (3.9+) and common platforms. Last release was 305 days ago; repository is active and not archived, though maintenance appears to have slowed. License in practice: MIT license is permissive; you can use, modify, and distribute xattr freely in commercial and private projects with minimal restrictions. Quickstart: pip install xattr import xattr x = xattr.xattr('/path/to/file') x['user.myattr'] = b'value' print(x['user.myattr']) Requires Python 3.9+. On Linux, custom xattr keys must be prefixed with the 'user' namespace (e.g., 'user.your_attr'). Extended attributes must be supported by the filesystem and operating system. Verify before relying: - Whether cffi is pre-installed or if compilation is required on your platform - Performance characteristics when working with many attributes or large attribute values - Compatibility with all filesystems that claim to support extended attributes ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: aging - Downloads: 17.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags extended filesystem attributes python, xattr read write metadata, file extended attributes wrapper, posix xattr access, filesystem metadata attributes, macos linux file xattr, extended file properties, filesystem-metadata, posix-systems [View on SkillFed](https://skillfed.io/packages/xattr) · [View on PyPI](https://pypi.org/project/xattr/)