core-https
This project/library contains common elements related to HTTP…
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
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 auto
Run linting: pylint core_https
Run security checks: bandit -r core_https
Submit a pull request
License
This project is licensed under the MIT License. See the LICENSE file for details.
Links
Support
For questions or support, please open an issue on GitLab or contact the maintainers.
Metadata
Release files for core-https 3.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| core_https-3.1.1.tar.gz | 31.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| core_https-3.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 68.8 kB
Release files / core_https-3.1.1.tar.gz
| Download URL | core_https-3.1.1.tar.gz |
|---|---|
| Size | 31.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c53227d195453372f1827907b816848c667cbd6c04b6baced7e2dbc4ff5e6616
|
|
BLAKE2b-256 checksum How to use checksums |
f6876f965bfd97f398eb09d6c879c99d30bf72e0677fa7a4f31ec48a3d262c6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / core_https-3.1.1-py3-none-any.whl
| Download URL | core_https-3.1.1-py3-none-any.whl |
|---|---|
| Size | 37.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e919d0d30d19048ef279a0c8edb558352cba57ae727f9db092b87ce1a5f81916
|
|
BLAKE2b-256 checksum How to use checksums |
f5e01d495299ece315e8ffb0f67ad74a1a59b35cee409e939454848214553a00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|