Una herramienta que verifica si una lista de sitios web está activa y disponible.
Project description
wstatus
wstatus is a simple and effective tool to check the status of multiple websites. With this tool, you can verify whether websites are active and available, choose between HTTP GET or POST methods, and save the results to a file for later analysis.
Installation
To install web_status_checker, use pip:
pip install wstatus
Usage
Using in Code
You can use web_status_checker directly in your Python code. Here’s an example:
from wstatus import check_websites
urls = [
"https://www.google.com",
"https://www.example.com",
"https://www.nonexistentwebsite.com"
]
results = check_websites(urls)
for result in results:
print(result)
Command Line Usage
You can use wstatus from the command line to check the status of websites.
wstatus [options] <url>
Here are some examples:
GET Method (default)
Check the status of websites using the GET method:
wstatus https://www.google.com https://www.example.com
POST Method
Check the status of websites using the POST method:
wstatus -p https://www.google.com https://www.example.com
Long Option
You can also use the long option for the POST method:
wstatus --post https://www.google.com https://www.example.com
Save Results to a File
To save the results to a file, use the -o option:
wstatus -o results.txt https://www.google.com https://www.example.com
POST Method and Save to a File
Combine the POST method with saving the results to a file:
wstatus -p -o results.txt https://www.google.com https://www.example.com
Error Handling
wstatus provides detailed error messages to help you diagnose issues with website connectivity. For example:
- If a URL is invalid or cannot be resolved, you will receive an error message indicating the problem.
- Common errors like typos or incorrect URL formats will be flagged with descriptive messages.
Example Errors
- Invalid URL Format:
Invalid URL format: wwww.example.com - Connection Error:
https://www.nonexistentwebsite.com is down! Error: HTTPSConnectionPool(host='www.nonexistentwebsite.com', port=443): Max retries exceeded with url: / (Caused by NameResolutionError: Failed to resolve 'www.nonexistentwebsite.com')
Running Tests
To run the unit tests for the package, use the following command:
python -m unittest
This will execute all the tests defined in tests.py to ensure everything is working correctly.
Contributing
If you want to contribute to the development of wstatus, please follow these steps:
- Fork the repository.
- Create a branch for your feature or bug fix (
git checkout -b feature/new-feature). - Make your changes and commit (
git commit -am 'Add new feature'). - Push the changes to your repository (
git push origin feature/new-feature). - Create a pull request to the original repository.
...
Thank you for using wstatus!
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
File details
Details for the file wstatus-1.0.tar.gz.
File metadata
- Download URL: wstatus-1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e30d37e21dabd64577226e737aad30f43db1d9c9550a9117b1d608376401b206
|
|
| MD5 |
88cea6631b6eb1f8eca253282a3b4975
|
|
| BLAKE2b-256 |
1a0f84d3d9e1109c78cbcc9dd3d413e4c0e03cae91294ced3a5b385ef74d0d14
|