Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Readme with better formatting and a qucik little guide #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions README.rst → README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
iwlib - interface with wireless tools in Linux
==============================================
# iwlib - interface with wireless tools in Linux

iwlib is a package for interfacing with iwlib, providing an implementation to
the wireless tools in Linux.
Expand All @@ -15,16 +14,20 @@ back from a device.

http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html

Installation
## Installation
------------

Installation requires the Python developer tools, and wireless_tools package
for compilation. If Python.h and iwlib.h exist on your system, you should be
good to go.

$ pip install iwlib
`$ pip install iwlib`

Change History
Depending on your linux distro, the package name may change. But this is tested on Ubuntu 17
`$ sudo apt-get install libiw-dev`


## Change History
--------------

1.5 (1st October 2014)
Expand All @@ -46,3 +49,24 @@ Change History

1.2.1 (21st March 2013)
- Initial release of code, as it was when I inherited it.

## Quick Guide
--------------
Run following command in a bash shell to see the available wireless interfaces
`$ iwconfig `

('wlan0' is very common, so that is what we will use for this quick guide)

Now in the python interactive Shell,
`>> import iwlib`
`>> interface = 'wlan0'`
`>> iwlib.get_iwconfig(interface)`
` {'BitRate': b'72.2 Mb/s', 'ESSID': b'AP_SSID', 'Access Point': b'AP_MAC', 'stats': {'quality': 45, 'noise': 0, 'updated': 75, 'level': 191}, 'Frequency': b'2.422 GHz', 'Mode': b'Managed'}`

The dict's values are byte strings. You can use `b'xyz'.decode('utf-8')` to decode them into python strings.

Finally, here's the docstring for the function
`>> print(iwlib.get_iwconfig.__doc__)`
` Retrieve the current configuration of an interface. `
` Arguments:`
` - device to work on (e.g. eth1, wlan0). `