Metadata-Version: 2.1
Name: tractus
Version: 0.5.3
Summary: Trace a HTTP request and gather the performance metrics.
Home-page: https://github.com/Navid2zp/tractus
Author: Navid Zarepak
Author-email: navid2zp@gmail.com
License: MIT
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown

# tractus

Trace HTTP requests and gather performance metrics.

### Install

```
pip install tractus
```

### Usage

```python

from tractus import Tracer

result = Tracer('https://google.com').trace()

print(f'Host IP: {result.ip}')
print(f'Status code: {result.status_code}')
print(f'DNS time: {result.dns:.2f} ms')
print(f'Handshake time: {result.handshake:.2f} ms')
print(f'First byte time: {result.first_byte:.2f} ms')
print(f'Full body time: {result.full_data:.2f} ms')
print(f'Body length: {result.data_length} bytes')
print(f'Headers length: {result.headers_length} bytes')

```

#### Helpers:
```python
# Get result as json
result.as_json()
# Get result as dict
result.as_dict()
```

License
----
MIT

#### Name
https://en.wiktionary.org/wiki/tractus

