Metadata-Version: 2.4
Name: simple-http-checker-PedroLima
Version: 1.3.1
Summary: A simple CLI tool to check the status of URLs.
Author: Pedro Lima
Author-email: bizak.dev@outlook.com
License: MIT
Project-URL: Homepage, https://github.com/PedroBizachi/python-devops-cicd-project
Project-URL: Documentation, https://github.com/PedroBizachi/python-devops-cicd-project/blob/main/README.md
Project-URL: Repository, https://github.com/PedroBizachi/python-devops-cicd-project
Project-URL: Issues, https://github.com/PedroBizachi/python-devops-cicd-project/issues
Project-URL: Changelog, https://github.com/PedroBizachi/python-devops-cicd-project/blob/main/CHANGELOG.md
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: Portuguese (Brazilian)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click<9.0,>=8.0
Requires-Dist: requests<3.0,>=2.28
Requires-Dist: rich<16.0,>=15.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-mock; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: bandit; extra == "dev"
Requires-Dist: types-requests; extra == "dev"
Dynamic: license-file

[![Supported Python Versions](https://img.shields.io/pypi/pyversions/simple-http-checker-PedroLima)](https://pypi.org/project/simple-http-checker-PedroLima/)
[![PyPI version](https://img.shields.io/pypi/v/simple-http-checker-PedroLima)](https://pypi.org/project/simple-http-checker-PedroLima/)
[![Downloads](https://pepy.tech/badge/simple-http-checker-PedroLima/month)](https://pepy.tech/project/simple-http-checker-PedroLima)
[![CI/CD](https://github.com/PedroBizachi/python-devops-cicd-project/actions/workflows/python-ci.yaml/badge.svg)](https://github.com/PedroBizachi/python-devops-cicd-project/actions/workflows/python-ci.yaml)
[![Publish](https://github.com/PedroBizachi/python-devops-cicd-project/actions/workflows/publish.yaml/badge.svg)](https://github.com/PedroBizachi/python-devops-cicd-project/actions/workflows/publish.yaml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# Python for DevOps: CI/CD for Python Projects

This repo contains the code for the CI/CD section of my Python for DevOps course.

It packages a small command-line tool, `check-urls`, that checks one or more URLs
and prints their HTTP status.

## Workflow

![workflow-overview](public/media/workflow-overview.png)

## What we will implement in this repository

- [x] Implement the project (code files)
- [x] Add a simple GHA workflow and make sure it runs until completion
- [x] Add linting (ruff) and format checks (black)
- [x] Add typing (mypy) and security checks (bandit)
- [x] Add test automation
- [x] Build our Python project
- [x] Publish the project to both TestPyPI and PyPI when a new release is published

## Installation

Install the package from PyPI:

```bash
pip install simple-http-checker-PedroLima
```

Install from TestPyPI:

```bash
pip install --index-url https://test.pypi.org/simple/ simple-http-checker-PedroLima
```

For local development, clone the repository and install it in editable mode:

```bash
git clone <repo-url>
cd python-devops-cicd-project
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
```

## Usage

Check a single URL:

```bash
check-urls https://httpbin.org/status/200
```

Check multiple URLs:

```bash
check-urls https://httpbin.org/status/200 https://httpbin.org/status/404 https://httpbin.org/status/500
```

Set a custom timeout in seconds:

```bash
check-urls https://httpbin.org/delay/2 --timeout 5
```

Enable verbose logging:

```bash
check-urls https://httpbin.org/status/200 --verbose
```

Example output:

```text
--- Results ---
https://httpbin.org/status/200             -> 200 OK
https://httpbin.org/status/404             -> 404 NOT FOUND
https://httpbin.org/status/500             -> 500 INTERNAL SERVER ERROR
```

## Development

Install development dependencies:

```bash
pip install -e ".[dev]"
```

Run linting, formatting, typing, security checks, and tests:

```bash
ruff check .
black --check .
mypy src/
bandit -c pyproject.toml -r .
pytest
```

## Package Info

- Package name: `simple-http-checker-PedroLima`
- CLI command: `check-urls`
- Python version: `3.9 <= version <= 3.12`
