This project/library contains common elements related to HTTP & API services...
Project description
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file core_https-3.1.0.tar.gz.
File metadata
- Download URL: core_https-3.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
845f833e07a94f26340a6ec6c8851d61024c31511b09a9a3d17cfeae3004c2ba
|
|
| MD5 |
91f60f6f1711c1874f4ca1a7bc5dac2e
|
|
| BLAKE2b-256 |
16ee58a368ba62ca7ad8afc0868c40c61a3603610952e453c9879efad02ad44a
|
File details
Details for the file core_https-3.1.0-py3-none-any.whl.
File metadata
- Download URL: core_https-3.1.0-py3-none-any.whl
- Upload date:
- Size: 37.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cca2d2c9f2deae40614129b1eed54c1f17041fff94a53afe0a82fa6731b9f21a
|
|
| MD5 |
b257c208ef46a9af51c176f7d71d0ea8
|
|
| BLAKE2b-256 |
795f82a7f29970b62b6c78844614ec55740689b706c8f400306ea1d79d05189a
|