METADATA 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Metadata-Version: 2.1
  2. Name: pywifi
  3. Version: 1.1.12
  4. Summary: A cross-platform module for manipulating WiFi devices.
  5. Home-page: https://github.com/awkman/pywifi
  6. Author: Jiang Sheng-Jhih
  7. Author-email: shengjhih@gmail.com
  8. License: MIT
  9. Download-URL: https://github.com/awkman/pywifi/archive/master.zip
  10. Keywords: wifi,wireless,Linux,Windows
  11. Platform: UNKNOWN
  12. Classifier: Intended Audience :: Developers
  13. Classifier: Topic :: Utilities
  14. Classifier: License :: OSI Approved :: MIT License
  15. Classifier: Programming Language :: Python :: 2.7
  16. Classifier: Programming Language :: Python :: 3.4
  17. Classifier: Programming Language :: Python :: 3.5
  18. Classifier: Programming Language :: Python :: 3.6
  19. Classifier: Programming Language :: Python :: 3.7
  20. Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
  21. Description-Content-Type: text/markdown
  22. # pywifi
  23. ![](https://img.shields.io/pypi/pyversions/pywifi.svg)
  24. [![Build Status](https://travis-ci.com/awkman/pywifi.svg?branch=master)](https://travis-ci.com/awkman/pywifi)
  25. [![PyPI version](https://badge.fury.io/py/pywifi.svg)](https://badge.fury.io/py/pywifi)
  26. pywifi provides a cross-platform Python module for manipulating wireless
  27. interfaces.
  28. * Easy to use
  29. * Supports Windows and Linux
  30. ## Prerequisites
  31. On Linux, you will need to run wpa_supplicant to manipulate the wifi devices,
  32. and then pywifi can communicate with wpa_supplicant through socket.
  33. On Windows, the [Native Wifi] component comes with Windows versions greater
  34. than Windows XP SP2.
  35. ## Installation
  36. After installing the prerequisites listed above for your platform, you can
  37. use pip to install from source:
  38. cd pywifi/
  39. pip install .
  40. ## Documentation
  41. For the details of pywifi, please refer to [Documentation].
  42. ## Example
  43. import pywifi
  44. wifi = pywifi.PyWiFi()
  45. iface = wifi.interfaces()[0]
  46. iface.disconnect()
  47. time.sleep(1)
  48. assert iface.status() in\
  49. [const.IFACE_DISCONNECTED, const.IFACE_INACTIVE]
  50. profile = pywifi.Profile()
  51. profile.ssid = 'testap'
  52. profile.auth = const.AUTH_ALG_OPEN
  53. profile.akm.append(const.AKM_TYPE_WPA2PSK)
  54. profile.cipher = const.CIPHER_TYPE_CCMP
  55. profile.key = '12345678'
  56. iface.remove_all_network_profiles()
  57. tmp_profile = iface.add_network_profile(profile)
  58. iface.connect(tmp_profile)
  59. time.sleep(30)
  60. assert iface.status() == const.IFACE_CONNECTED
  61. iface.disconnect()
  62. time.sleep(1)
  63. assert iface.status() in\
  64. [const.IFACE_DISCONNECTED, const.IFACE_INACTIVE]
  65. (C) Jiang Sheng-Jhih 2019, [MIT License].
  66. [Native Wifi]: https://msdn.microsoft.com/en-us/library/windows/desktop/ms706556.aspx
  67. [MIT License]: https://opensource.org/licenses/MIT
  68. [Documentation]: https://github.com/awkman/pywifi/blob/master/DOC.md