This library was developed to simplify handling HTTP requests, logging responses, and deriving statistics from them. It provides tools for testing and monitoring the performance of endpoints and generating detailed reports on successful and non-successful responses.
Project description
API Arsenal
Description
This library was developed to simplify handling HTTP requests, logging responses, and deriving statistics from them. It provides tools for testing and monitoring the performance of endpoints and generating detailed reports on successful and non-successful responses.
Core Features
HTTP Request Handling:
- Log HTTP responses into an array for further analysis.
- Check if a response is successful (status code 2xx).
Response Statistics:
- Calculate minimum, maximum, and average response times.
- Display statistics about all logged responses.
Logging:
- Securely log usernames and passwords to a file using encryption.
- Log response statistics to a file.
Response Printing:
- Print detailed information about a response, including the response body.
- Print brief information about a response (status code, elapsed time, etc.).
- Print all logged responses with details.
- Print only successful responses with details.
- Print only non-successful responses with details.
Utility Functions:
- Generate random usernames, passwords, letters, numbers, and symbols for testing.
History Logging:
- Display a history of logged credentials.
- Display a history of logged statistics.”
Installation
To install the library, you can use pip:
pip install api-arsenal
Usage
Simple Example
from api_arsenal import api_arsenal import requests # Create a utility object utility = api_arsenal() # Send an HTTP request response = requests.get('https://api.example.com/data') utility.push_response(response, 'Example Endpoint') # Print statistics utility.print_stats()
More Examples
# Print all responses with details utility.print_all_detailed() # Print only successful responses utility.print_successful_detailed_only() # Log credentials to a file utility.log_user_credentials_in_file(comments='Test User')
License
This project is licensed under the MIT License.
Contact
If you have any questions or inquiries, you can contact me via email. iabdullahban@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file api_arsenal_iabdullahban-0.0.2.tar.gz.
File metadata
- Download URL: api_arsenal_iabdullahban-0.0.2.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc2b28144863617d02d378726043305547d3acf30aac0d1e0fd0fbe4937cdf66
|
|
| MD5 |
a6b9c7827b3582c28afbe1a9b07102f5
|
|
| BLAKE2b-256 |
5e754880f2043a9cf0e3bc6b6e14cad4ff61601fb931c5373e0434eadcd0f03f
|
File details
Details for the file api_arsenal_iabdullahban-0.0.2-py3-none-any.whl.
File metadata
- Download URL: api_arsenal_iabdullahban-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f08de6edff8770939331edb184002a066fa39681b3d969860e82a7ba38934bc
|
|
| MD5 |
7e1530ae884ea1bc379eb39b6dbbba75
|
|
| BLAKE2b-256 |
fbdec16037589c23b9e3a6bcd81e50e7c5f45af520487e21899bcbcaaeeb802c
|