pyxattr
Filesystem extended attributes for python
Decision gist · record as of 2026-08-14
Yes, if you need direct access to extended file attributes on Linux or macOS and are willing to handle the compilation requirement. The package is stable and production-ready with no known vulnerabilities. No, if you cannot install a C compiler or Python development headers in your environment, or if your filesystem does not support extended attributes. Consider pre-built distributions from your OS package manager to avoid building from source.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a C compiler and Python development libraries installed before pip install will succeed.
- Linux (kernel v2.4 or later) or macOS with xattr-supporting filesystems (XFS, ext2/ext3/ext4, etc.) required at runtime.
- High install friction: requires a C compiler and Python development headers to build from source.
License · maintenance · safety
LGPL (copyleft) — Licensed under LGPL 2.1 or later (copyleft). You may use and modify the package freely, but any derivative works must also be distributed under LGPL 2.1 or a compatible license. Linking against this library in a proprietary application requires careful license review.
last release 2023-04-17 (1215 days) · last repo commit 2025-09-14 · 33 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 86,334 downloads/mo, #13,870 on PyPI
Alternatives
Verify before relying
pip install pyxattr
import xattr
xattr.setxattr('file.txt', 'user.comment', 'My note')
print(xattr.getxattr('file.txt', 'user.comment'))- Whether pre-built wheels are available for common platforms to avoid compilation
- Current compatibility with Python versions beyond 3.12 (description notes testing up to 3.12)
- Whether the aging maintenance status (1215 days since last release) affects reliability for new use cases
What it is and what it does
pyxattr is a Python extension module that exposes the extended attributes API available on Linux and macOS filesystems. It wraps the underlying C functions to let you read, write, list, and delete metadata attributes attached to files and directories—attributes that live outside the standard Unix permission model. These are commonly used for storing MIME types, custom tags, access control lists, and other filesystem-level metadata.
The module is a thin, direct binding to the OS-level calls, with no runtime dependencies beyond the Python standard library. It requires compilation against your system's C headers and a C compiler at install time, which makes it less portable than pure-Python packages but necessary for direct filesystem access. It supports Python 3.7+ and PyPy 3.7+, is marked Production/Stable, and has no known vulnerabilities.
Use it for
- Store and retrieve custom metadata (MIME types, tags, comments) on files without modifying the files themselves
- Implement filesystem-level access control or security labels on Linux systems
- Build backup or archival tools that preserve extended attributes across systems
- Develop file management utilities that tag or annotate files with searchable attributes
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need direct access to extended file attributes on Linux or macOS and are willing to handle the compilation requirement.
The package is stable and production-ready with no known vulnerabilities. No, if you cannot install a C compiler or Python development headers in your environment, or if your filesystem does not support extended attributes. Consider pre-built distributions from your OS package manager to avoid building from source.
Install
pyxattr on PyPI
Before you install
High install friction: requires a C compiler and Python development headers to build from source. The package is aging (last release 2023-04-17), though the repository remains active with recent commits. Pre-built distributions may be available from your OS package manager, which sidesteps compilation.
Requires a C compiler and Python development libraries installed before pip install will succeed. Linux (kernel v2.4 or later) or macOS with xattr-supporting filesystems (XFS, ext2/ext3/ext4, etc.) required at runtime.
License in practice
Licensed under LGPL 2.1 or later (copyleft). You may use and modify the package freely, but any derivative works must also be distributed under LGPL 2.1 or a compatible license. Linking against this library in a proprietary application requires careful license review.
Quickstart
pip install pyxattr
import xattr
xattr.setxattr('file.txt', 'user.comment', 'My note')
print(xattr.getxattr('file.txt', 'user.comment'))
Verify before relying
- Whether pre-built wheels are available for common platforms to avoid compilation
- Current compatibility with Python versions beyond 3.12 (description notes testing up to 3.12)
- Whether the aging maintenance status (1215 days since last release) affects reliability for new use cases
Package facts
| License | LGPL copyleft |
| Python support | Supports the current Python release >=3.7 |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Aging 1,215 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 86,334 / month, #13,870 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)Operating System :: MacOS :: MacOS XOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Filesystems |
Evidence: pyxattr-0.8.1.tar.gz
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 › “python xattr module”
- pyxattrProvides Python access to extended attributes (xattr) on filesystem…
- xattrxattr is a Python wrapper for reading and writing extended filesystem…
- pyinvokeInvokes Python functions by full module path specifier, loading the…
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 xattr · fusepy · pathlib-abc · xrootd · pathlib2 · fatfs-ng · morefs · argparse-ext · pyobjc-framework-NetFS · littlefs-python