]> git.k1024.org Git - pyxattr.git/blob - README.md
tests: stop trying to set user attributes on symlinks
[pyxattr.git] / README.md
1 # pyxattr
2
3 This is the pyxattr module, a Python extension module which gives access
4 to the extended attributes for filesystem objects available in some
5 operating systems.
6
7 [![Travis](https://img.shields.io/travis/iustin/pyxattr)](https://travis-ci.org/iustin/pyxattr)
8 [![Coveralls github](https://img.shields.io/coveralls/github/iustin/pyxattr)](https://coveralls.io/github/iustin/pyxattr)
9 [![Read the Docs](https://img.shields.io/readthedocs/pyxattr)](http://pyxattr.readthedocs.io/en/latest/?badge=latest)
10 [![GitHub issues](https://img.shields.io/github/issues/iustin/pyxattr)](https://github.com/iustin/pyxattr/issues)
11 ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/iustin/pyxattr)
12 [![GitHub release (latest by date)](https://img.shields.io/github/v/release/iustin/pyxattr)](https://github.com/iustin/pyxattr/releases)
13 [![PyPI](https://img.shields.io/pypi/v/pyxattr)](https://pypi.org/project/pyxattr/)
14 ![Debian package](https://img.shields.io/debian/v/python-pyxattr)
15 ![Ubuntu package](https://img.shields.io/ubuntu/v/python-pyxattr)
16 ![GitHub Release Date](https://img.shields.io/github/release-date/iustin/pyxattr)
17 ![GitHub commits since latest release](https://img.shields.io/github/commits-since/iustin/pyxattr/latest)
18 ![GitHub last commit](https://img.shields.io/github/last-commit/iustin/pyxattr)
19
20 Downloads: go to <https://pyxattr.k1024.org/downloads/>. The source
21 repository is either at <http://git.k1024.org/pyxattr.git> or at
22 <https://github.com/iustin/pyxattr>.
23
24 ## Requirements
25
26 The current supported Python versions are 3.4+.
27
28 The library has been written and tested on Linux, kernel v2.4 or
29 later, with XFS and ext2/ext3/ext3 file systems. If any other platform
30 implements the same behaviour, pyxattr could be used.
31
32 You need to have the setuptools tool installed in order to build and
33 install the module, and for building the documentation you need to
34 have Sphinx installed.
35
36 Alternatively, you can install directly from pip:
37
38     $ pip install pyxattr
39
40 Or from your distribution, e.g. in Debian:
41
42     $ sudo install python3-pyxattr
43
44 ## Basic example
45
46     >>> import xattr
47     >>> xattr.listxattr("file.txt")
48     ['user.mime_type']
49     >>> xattr.getxattr("file.txt", "user.mime_type")
50     'text/plain'
51     >>> xattr.setxattr("file.txt", "user.comment", "Simple text file")
52     >>> xattr.listxattr("file.txt")
53     ['user.mime_type', 'user.comment']
54     >>> xattr.removexattr ("file.txt", "user.comment")
55
56 ## License
57
58 pyxattr is Copyright 2002-2008, 2012-2015 Iustin Pop.
59
60 pyxattr is free software; you can redistribute it and/or modify it under the
61 terms of the GNU Lesser General Public License as published by the Free
62 Software Foundation; either version 2.1 of the License, or (at your option) any
63 later version. See the COPYING file for the full license terms.
64
65 Note that previous versions had different licenses: version 0.3 was licensed
66 under LGPL version 3 (which, I realized later, is not compatible with GPLv2,
67 hence the change to LGPL 2.1), and even older versions were licensed under GPL
68 v2 or later.