Skip to main content

core-https

This project/library contains common elements related to HTTP…


PyPI Downloads 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

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)

Source distribution for core-https 3.1.1
File Size Uploaded
core_https-3.1.1.tar.gz 31.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for core-https 3.1.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

3.1.1 This release

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page