xattr
Python wrapper for extended filesystem attributes
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- 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.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute xattr freely in commercial and private projects with minimal restrictions.
last release 2025-10-13 (305 days) · last repo commit 2025-10-13 · 220 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 17,560,946 downloads/mo, #1,111 on PyPI
Alternatives
Verify before relying
pip install xattr
import xattr
x = xattr.xattr('/path/to/file')
x['user.myattr'] = b'value'
print(x['user.myattr'])- 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
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 on this page. Verify before relying on it.
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
xattr on PyPI
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.
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.
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'])
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 the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagecffi |
| Maintenance | Aging 305 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 17,560,946 / month, #1,111 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: ConsoleIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: POSIX :: BSD :: FreeBSDOperating System :: POSIX :: LinuxOperating System :: POSIX :: SunOS/SolarisProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules |
Evidence: xattr-1.3.0-cp310-cp310-macosx_10_9_universal2.whl; xattr-1.3.0-cp310-cp310-macosx_10_9_x86_64.whl; xattr-1.3.0-cp310-cp310-macosx_11_0_arm64.whl; xattr-1.3.0-cp310-cp310-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; xattr-1.3.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; xattr-1.3.0-cp310-cp310-musllinux_1_2_aarch64.whl; xattr-1.3.0-cp310-cp310-musllinux_1_2_x86_64.whl; xattr-1.3.0-cp311-cp311-macosx_10_9_universal2.whl; xattr-1.3.0-cp311-cp311-macosx_10_9_x86_64.whl; xattr-1.3.0-cp311-cp311-macosx_11_0_arm64.whl; xattr-1.3.0-cp311-cp311-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; xattr-1.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; xattr-1.3.0-cp311-cp311-musllinux_1_2_aarch64.whl; xattr-1.3.0-cp311-cp311-musllinux_1_2_x86_64.whl; xattr-1.3.0-cp312-cp312-macosx_10_13_universal2.whl; xattr-1.3.0-cp312-cp312-macosx_10_13_x86_64.whl; xattr-1.3.0-cp312-cp312-macosx_11_0_arm64.whl; xattr-1.3.0-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; xattr-1.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; xattr-1.3.0-cp312-cp312-musllinux_1_2_aarch64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “extended filesystem attributes python”
- xattrxattr is a Python wrapper for reading and writing extended filesystem…
- pyxattrProvides Python access to extended attributes (xattr) on filesystem…
- glob2glob2 extends Python's built-in glob module with recursive **…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also fatfs-ng · pyxattr · xrootd · pathmagic · extra-platforms · attrdict · YORM · scantree · uptime · pathlib