core-https#
This project/library contains common elements related to HTTP…
Documentation Contents#
Index:
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 -
StatusInfoenum 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), andRetryableExceptionfor temporary failuresHTTP Requesters - Abstract interface (
IRequester) with concrete implementations for multiple HTTP libraries (requests,urllib3,aiohttp), supporting connection pooling, timeouts, retries, and backoff strategiesTesting Utilities - Base test classes and decorators for mocking HTTP requests/responses across different HTTP client libraries
Installation#
Install from PyPI using pip:
pip install core-https
uv pip install core-https # Or using UV...
pip install -e ".[dev]" # For development...
Setting Up Environment#
Install required libraries:
pip install --upgrade pip
pip install virtualenv
Create Python virtual environment:
virtualenv --python=python3.12 .venv
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:
Fork the repository
Create a feature branch
Write tests for new functionality
Ensure all tests pass:
pytest -n autoRun linting:
pylint core_httpsRun security checks:
bandit -r core_httpsSubmit a pull request
License#
This project is licensed under the MIT License. See the LICENSE file for details.
Links#
Documentation: https://core-https.readthedocs.io/en/latest/
Repository: bytecode-solutions/core/core-https
Changelog: bytecode-solutions/core/core-https/-/blob/master/CHANGELOG.md
Support#
For questions or support, please open an issue on GitLab or contact the maintainers.