No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

149 líneas
4.8 KiB

  1. Metadata-Version: 2.4
  2. Name: watchfiles
  3. Version: 1.1.0
  4. Classifier: Development Status :: 5 - Production/Stable
  5. Classifier: Environment :: Console
  6. Classifier: Programming Language :: Python
  7. Classifier: Programming Language :: Python :: 3
  8. Classifier: Programming Language :: Python :: 3 :: Only
  9. Classifier: Programming Language :: Python :: 3.9
  10. Classifier: Programming Language :: Python :: 3.10
  11. Classifier: Programming Language :: Python :: 3.11
  12. Classifier: Programming Language :: Python :: 3.12
  13. Classifier: Programming Language :: Python :: 3.13
  14. Classifier: Programming Language :: Python :: 3.14
  15. Classifier: Intended Audience :: Developers
  16. Classifier: Intended Audience :: Information Technology
  17. Classifier: Intended Audience :: System Administrators
  18. Classifier: License :: OSI Approved :: MIT License
  19. Classifier: Operating System :: POSIX :: Linux
  20. Classifier: Operating System :: Microsoft :: Windows
  21. Classifier: Operating System :: MacOS
  22. Classifier: Environment :: MacOS X
  23. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  24. Classifier: Topic :: System :: Filesystems
  25. Classifier: Framework :: AnyIO
  26. Requires-Dist: anyio>=3.0.0
  27. License-File: LICENSE
  28. Summary: Simple, modern and high performance file watching and code reload in python.
  29. Home-Page: https://github.com/samuelcolvin/watchfiles
  30. Author-email: Samuel Colvin <s@muelcolvin.com>
  31. License: MIT
  32. Requires-Python: >=3.9
  33. Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
  34. Project-URL: Homepage, https://github.com/samuelcolvin/watchfiles
  35. Project-URL: Documentation, https://watchfiles.helpmanual.io
  36. Project-URL: Funding, https://github.com/sponsors/samuelcolvin
  37. Project-URL: Source, https://github.com/samuelcolvin/watchfiles
  38. Project-URL: Changelog, https://github.com/samuelcolvin/watchfiles/releases
  39. # watchfiles
  40. [![CI](https://github.com/samuelcolvin/watchfiles/actions/workflows/ci.yml/badge.svg)](https://github.com/samuelcolvin/watchfiles/actions/workflows/ci.yml?query=branch%3Amain)
  41. [![Coverage](https://codecov.io/gh/samuelcolvin/watchfiles/branch/main/graph/badge.svg)](https://codecov.io/gh/samuelcolvin/watchfiles)
  42. [![pypi](https://img.shields.io/pypi/v/watchfiles.svg)](https://pypi.python.org/pypi/watchfiles)
  43. [![CondaForge](https://img.shields.io/conda/v/conda-forge/watchfiles.svg)](https://anaconda.org/conda-forge/watchfiles)
  44. [![license](https://img.shields.io/github/license/samuelcolvin/watchfiles.svg)](https://github.com/samuelcolvin/watchfiles/blob/main/LICENSE)
  45. Simple, modern and high performance file watching and code reload in python.
  46. ---
  47. **Documentation**: [watchfiles.helpmanual.io](https://watchfiles.helpmanual.io)
  48. **Source Code**: [github.com/samuelcolvin/watchfiles](https://github.com/samuelcolvin/watchfiles)
  49. ---
  50. Underlying file system notifications are handled by the [Notify](https://github.com/notify-rs/notify) rust library.
  51. This package was previously named "watchgod",
  52. see [the migration guide](https://watchfiles.helpmanual.io/migrating/) for more information.
  53. ## Installation
  54. **watchfiles** requires Python 3.9 - 3.14.
  55. ```bash
  56. pip install watchfiles
  57. ```
  58. Binaries are available for most architectures on Linux, MacOS and Windows ([learn more](https://watchfiles.helpmanual.io/#installation)).
  59. Otherwise, you can install from source which requires Rust stable to be installed.
  60. ## Usage
  61. Here are some examples of what **watchfiles** can do:
  62. ### `watch` Usage
  63. ```py
  64. from watchfiles import watch
  65. for changes in watch('./path/to/dir'):
  66. print(changes)
  67. ```
  68. See [`watch` docs](https://watchfiles.helpmanual.io/api/watch/#watchfiles.watch) for more details.
  69. ### `awatch` Usage
  70. ```py
  71. import asyncio
  72. from watchfiles import awatch
  73. async def main():
  74. async for changes in awatch('/path/to/dir'):
  75. print(changes)
  76. asyncio.run(main())
  77. ```
  78. See [`awatch` docs](https://watchfiles.helpmanual.io/api/watch/#watchfiles.awatch) for more details.
  79. ### `run_process` Usage
  80. ```py
  81. from watchfiles import run_process
  82. def foobar(a, b, c):
  83. ...
  84. if __name__ == '__main__':
  85. run_process('./path/to/dir', target=foobar, args=(1, 2, 3))
  86. ```
  87. See [`run_process` docs](https://watchfiles.helpmanual.io/api/run_process/#watchfiles.run_process) for more details.
  88. ### `arun_process` Usage
  89. ```py
  90. import asyncio
  91. from watchfiles import arun_process
  92. def foobar(a, b, c):
  93. ...
  94. async def main():
  95. await arun_process('./path/to/dir', target=foobar, args=(1, 2, 3))
  96. if __name__ == '__main__':
  97. asyncio.run(main())
  98. ```
  99. See [`arun_process` docs](https://watchfiles.helpmanual.io/api/run_process/#watchfiles.arun_process) for more details.
  100. ## CLI
  101. **watchfiles** also comes with a CLI for running and reloading code. To run `some command` when files in `src` change:
  102. ```
  103. watchfiles "some command" src
  104. ```
  105. For more information, see [the CLI docs](https://watchfiles.helpmanual.io/cli/).
  106. Or run
  107. ```bash
  108. watchfiles --help
  109. ```