Skip to main content

This project/library contains common elements related to HTTP & API services...

Project description

core-https

This project/library contains common elements related to HTTP…


Python Versions License Pipeline Status Docs Status Security

Installation

Install from PyPI using pip:

pip install core-https
uv pip install core-https  # Or using UV...

Features

  • HTTP Status Codes & Methods - Comprehensive enums with backward compatibility for Python < 3.11, including utility methods for status checking (is_success, is_error, etc.) and method properties (is_safe, is_idempotent, is_cacheable)

  • Status Classification - StatusInfo enum for categorizing HTTP responses as success (1xx-3xx), error (4xx), or failure (5xx)

  • Exception Hierarchy - Structured exception classes for handling HTTP errors with automatic status code mapping: AuthenticationException (401), AuthorizationException (403), RateLimitException (429), and RetryableException for temporary failures

  • HTTP Requesters - Abstract interface (IRequester) with concrete implementations for multiple HTTP libraries (requests, urllib3, aiohttp), supporting connection pooling, timeouts, retries, and backoff strategies

  • Testing Utilities - Base test classes and decorators for mocking HTTP requests/responses across different HTTP client libraries

Quick Start

Installation

Install the package:

pip install core-https
uv pip install core-https  # Or using UV...
pip install -e ".[dev]"    # For development...

Setting Up Environment

  1. Install required libraries:

pip install --upgrade pip
pip install virtualenv
  1. Create Python virtual environment:

virtualenv --python=python3.12 .venv
  1. Activate the virtual environment:

source .venv/bin/activate

Install packages

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

Check tests and coverage

# Unit tests (mocked, no network):
python manager.py run-tests

# Functional tests (real HTTP requests — requires network):
python manager.py run-tests --test-type functional --pattern "*.py"

# Coverage:
python manager.py run-coverage

Contributing

Contributions are welcome! Please:

  1. Fork the repository

  2. Create a feature branch

  3. Write tests for new functionality

  4. Ensure all tests pass: pytest -n auto

  5. Run linting: pylint core_https

  6. Run security checks: bandit -r core_https

  7. Submit a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

For questions or support, please open an issue on GitLab or contact the maintainers.

Authors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

core_https-3.0.0.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

core_https-3.0.0-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file core_https-3.0.0.tar.gz.

File metadata

  • Download URL: core_https-3.0.0.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for core_https-3.0.0.tar.gz
Algorithm Hash digest
SHA256 ed2ee495ae6ed17a231b2ab152866024878d90c7523b88ca27bf86a5ff651733
MD5 09dae07b0c064b22dbbc2f83f34f6001
BLAKE2b-256 40500b9d7625e74a7a2e110873747ffc6f2dde1ce0288252a4d79efb8c18ba97

See more details on using hashes here.

File details

Details for the file core_https-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: core_https-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for core_https-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f53a55dda7b89824e43f8ee2424eacc58ac59e992af8193cf271055cde621256
MD5 2a3c01883a635cb2dc890bafdd6ffe4d
BLAKE2b-256 671a61453d6d9c0333e5d8b3dc4ea2e895232712d31f5c96fb54f078fda5413c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page