HFortix - Python SDK for Fortinet Products#
HFortix is a modern, fully-typed Python SDK ecosystem for Fortinet products.
Complete FortiOS API client with 1,348 endpoints (561 CMDB + 490 Monitor + 286 Log + 11 Service). Available Now - v0.5.151 Beta
Foundation HTTP client and exception handling. Available Now - v0.5.151 Beta
Key Features#
- ✨ Complete API Coverage
100% coverage of FortiOS 7.6.5 API (1,348 endpoints: 561 CMDB + 490 Monitor + 286 Log + 11 Service)
- 🎯 Fully Typed
Complete type hints with .pyi stubs for excellent IDE support. 100% type coverage for CMDB endpoints; partial coverage for Monitor/Log endpoints.
- ⚡ Modern & Fast
Async/await support with httpx, HTTP/2, connection pooling, and circuit breakers
- 🛡️ Production Ready
Comprehensive error handling, validation, retry logic, rate limiting, and 2,566+ test functions across 318 test files
- 🔄 Flexible Interface
Simple list format auto-converts to FortiOS dict format - use
["internal"]instead of[{"name": "internal"}]- � Enhanced Developer Experience
FortiObject responses with attribute access (
addr.subnetinstead ofaddr['subnet'])Multiple response formats (
.dict,.json,.raw)Built-in validation and error handling
FortiManager proxy support for managing multiple devices
Quick Example - FortiOS#
from hfortix_fortios import FortiOS
# Connect with context manager (automatic cleanup)
with FortiOS(host="192.168.1.99", token="your-api-token") as fgt:
# Create firewall address
fgt.api.cmdb.firewall.address.post(
name="web-server",
subnet="10.0.1.100/32",
comment="Production web server"
)
# Create firewall policy - simple list format (auto-converted)
fgt.api.cmdb.firewall.policy.post(
name="Allow-Web-Traffic",
srcintf=["internal"], # Converted to [{"name": "internal"}]
dstintf=["wan1"], # Converted to [{"name": "wan1"}]
srcaddr=["all"], # Converted to [{"name": "all"}]
dstaddr=["web-server"], # Converted to [{"name": "web-server"}]
service=["HTTP", "HTTPS"], # Converted to [{"name": "..."}]
action="accept",
nat="enable"
)
See Quick Start Guide for more examples.
Installation#
# Install all available packages
pip install hfortix
# Or install specific packages
pip install hfortix-fortios # FortiOS/FortiGate
pip install hfortix-core # Core framework only
See Installation for detailed instructions.
Documentation#
Additional Information
- Changelog
- [0.5.153] - 2026-02-02
- [0.5.152] - 2026-02-02
- [0.5.151] - 2026-02-02
- [0.5.150] - 2026-02-02
- [0.5.149] - 2026-02-02
- [0.5.148] - 2026-01-31
- [0.5.147] - 2026-01-28
- [0.5.146] - 2026-01-24
- [0.5.145] - 2026-01-24
- [0.5.144] - 2026-01-24
- [0.5.143] - 2026-01-23
- [0.5.142] - 2026-01-23
- [0.5.141] - 2026-01-22
- [0.5.140] - 2026-01-22
- [0.5.139] - 2026-01-22
- [0.5.137] - 2026-01-22
- Changelog
- Security
- License
Coverage Status#
FortiOS 7.6.5 API Coverage (February 2026)
561 endpoints
100% coverage - Configuration database management (100% type coverage)
🔷 v0.5.151 Beta
490 endpoints
100% coverage - Real-time monitoring and statistics (partial type coverage)
🔷 v0.5.151 Beta
286 endpoints
100% coverage - Log retrieval with full parameterization (partial type coverage)
🔷 v0.5.151 Beta
11 endpoints
100% coverage - Service operations (100% type coverage)
🔷 v0.5.151 Beta
Overall: 1,348 API methods across all categories (100% coverage) 🎉
561 CMDB endpoints - Configuration database management (100% typed)
490 Monitor endpoints - Real-time monitoring and statistics (partial types)
286 Log endpoints - Log retrieval and analysis (partial types)
11 Service endpoints - Service operations (100% typed)
100% auto-generated - Complete schema coverage with intelligent generation
Package Status#
Package |
Version |
Status |
Description |
|---|---|---|---|
|
0.5.151 |
Beta |
Meta package - installs all available packages |
|
0.5.151 |
Beta |
HTTP client, error handling, circuit breaker, observability |
|
0.5.151 |
Beta |
FortiOS/FortiGate SDK - 1,348 endpoints (561 CMDB + 490 Monitor + 286 Log + 11 Service) |
Community & Support#
GitHub: hermanwjacobsen/hfortix
Issues: hermanwjacobsen/hfortix#issues
License#
Proprietary license. See the License page for details.