METADATA 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. Metadata-Version: 2.0
  2. Name: pathlib
  3. Version: 1.0.1
  4. Summary: Object-oriented filesystem paths
  5. Home-page: https://pathlib.readthedocs.org/
  6. Author: Antoine Pitrou
  7. Author-email: solipsis@pitrou.net
  8. License: MIT License
  9. Download-URL: https://pypi.python.org/pypi/pathlib/
  10. Platform: UNKNOWN
  11. Classifier: Development Status :: 5 - Production/Stable
  12. Classifier: Intended Audience :: Developers
  13. Classifier: License :: OSI Approved :: MIT License
  14. Classifier: Operating System :: OS Independent
  15. Classifier: Programming Language :: Python :: 3
  16. Classifier: Programming Language :: Python :: 2.6
  17. Classifier: Programming Language :: Python :: 2.7
  18. Classifier: Programming Language :: Python :: 3.2
  19. Classifier: Programming Language :: Python :: 3.3
  20. Classifier: Programming Language :: Python :: 3.4
  21. Classifier: Topic :: Software Development :: Libraries
  22. Classifier: Topic :: System :: Filesystems
  23. pathlib offers a set of classes to handle filesystem paths. It offers the
  24. following advantages over using string objects:
  25. * No more cumbersome use of os and os.path functions. Everything can be
  26. done easily through operators, attribute accesses, and method calls.
  27. * Embodies the semantics of different path types. For example, comparing
  28. Windows paths ignores casing.
  29. * Well-defined semantics, eliminating any warts or ambiguities (forward vs.
  30. backward slashes, etc.).
  31. Requirements
  32. ------------
  33. Python 3.2 or later is recommended, but pathlib is also usable with Python 2.7
  34. and 2.6.
  35. Install
  36. -------
  37. In Python 3.4, pathlib is now part of the standard library. For Python 3.3
  38. and earlier, ``easy_install pathlib`` or ``pip install pathlib`` should do
  39. the trick.
  40. Examples
  41. --------
  42. Importing the module classes::
  43. >>> from pathlib import *
  44. Listing Python source files in a directory::
  45. >>> list(p.glob('*.py'))
  46. [PosixPath('test_pathlib.py'), PosixPath('setup.py'),
  47. PosixPath('pathlib.py')]
  48. Navigating inside a directory tree::
  49. >>> p = Path('/etc')
  50. >>> q = p / 'init.d' / 'reboot'
  51. >>> q
  52. PosixPath('/etc/init.d/reboot')
  53. >>> q.resolve()
  54. PosixPath('/etc/rc.d/init.d/halt')
  55. Querying path properties::
  56. >>> q.exists()
  57. True
  58. >>> q.is_dir()
  59. False
  60. Opening a file::
  61. >>> with q.open() as f: f.readline()
  62. ...
  63. '#!/bin/bash\n'
  64. Documentation
  65. -------------
  66. The full documentation can be read at `Read the Docs
  67. <https://pathlib.readthedocs.org/>`_.
  68. Contributing
  69. ------------
  70. Main development now takes place in the Python standard library: see
  71. the `Python developer's guide <http://docs.python.org/devguide/>`_, and
  72. report issues on the `Python bug tracker <http://bugs.python.org/>`_.
  73. However, if you find an issue specific to prior versions of Python
  74. (such as 2.7 or 3.2), you can post an issue on the
  75. `BitBucket project page <https://bitbucket.org/pitrou/pathlib/>`_.
  76. History
  77. -------
  78. Version 1.0.1
  79. ^^^^^^^^^^^^^
  80. - Pull requestion #4: Python 2.6 compatibility by eevee.
  81. Version 1.0
  82. ^^^^^^^^^^^
  83. This version brings ``pathlib`` up to date with the official Python 3.4
  84. release, and also fixes a couple of 2.7-specific issues.
  85. - Python issue #20765: Add missing documentation for PurePath.with_name()
  86. and PurePath.with_suffix().
  87. - Fix test_mkdir_parents when the working directory has additional bits
  88. set (such as the setgid or sticky bits).
  89. - Python issue #20111: pathlib.Path.with_suffix() now sanity checks the
  90. given suffix.
  91. - Python issue #19918: Fix PurePath.relative_to() under Windows.
  92. - Python issue #19921: When Path.mkdir() is called with parents=True, any
  93. missing parent is created with the default permissions, ignoring the mode
  94. argument (mimicking the POSIX "mkdir -p" command).
  95. - Python issue #19887: Improve the Path.resolve() algorithm to support
  96. certain symlink chains.
  97. - Make pathlib usable under Python 2.7 with unicode pathnames (only pure
  98. ASCII, though).
  99. - Issue #21: fix TypeError under Python 2.7 when using new division.
  100. - Add tox support for easier testing.
  101. Version 0.97
  102. ^^^^^^^^^^^^
  103. This version brings ``pathlib`` up to date with the final API specified
  104. in :pep:`428`. The changes are too long to list here, it is recommended
  105. to read the `documentation <https://pathlib.readthedocs.org/>`_.
  106. .. warning::
  107. The API in this version is partially incompatible with pathlib 0.8 and
  108. earlier. Be sure to check your code for possible breakage!
  109. Version 0.8
  110. ^^^^^^^^^^^
  111. - Add PurePath.name and PurePath.anchor.
  112. - Add Path.owner and Path.group.
  113. - Add Path.replace().
  114. - Add Path.as_uri().
  115. - Issue #10: when creating a file with Path.open(), don't set the executable
  116. bit.
  117. - Issue #11: fix comparisons with non-Path objects.
  118. Version 0.7
  119. ^^^^^^^^^^^
  120. - Add '**' (recursive) patterns to Path.glob().
  121. - Fix openat() support after the API refactoring in Python 3.3 beta1.
  122. - Add a *target_is_directory* argument to Path.symlink_to()
  123. Version 0.6
  124. ^^^^^^^^^^^
  125. - Add Path.is_file() and Path.is_symlink()
  126. - Add Path.glob() and Path.rglob()
  127. - Add PurePath.match()
  128. Version 0.5
  129. ^^^^^^^^^^^
  130. - Add Path.mkdir().
  131. - Add Python 2.7 compatibility by Michele Lacchia.
  132. - Make parent() raise ValueError when the level is greater than the path
  133. length.