> For the complete documentation index, see [llms.txt](https://riteshs4hu.gitbook.io/infosec-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://riteshs4hu.gitbook.io/infosec-notes/language/python/library.md).

# Library

A **library** is a **collection of modules** (and packages) that provide ready-to-use functionality.

* Example: `requests` (for HTTP requests), `numpy` (for math), `pandas` (for data analysis).
* Libraries are usually installed from **PyPI** using `pip`.

#### **Example with Requests Library**

```python
import requests

response = requests.get("https://httpbin.org/get")
print(response.status_code)
print(response.json())
```

**Output:**

```
200
{'args': {}, 'headers': {...}, 'url': 'https://httpbin.org/get'}
```

Here:

* `requests` is a library that contains many modules for HTTP handling.
