Modern, fully-typed Python SDK for FortiOS/FortiGate with complete API coverage (1,348 endpoints)
Project description
HFortix-FortiOS
HFortix-FortiOS is a modern, fully-typed Python SDK for FortiOS/FortiGate automation with complete API coverage.
🚀 Quick Start
pip install hfortix-fortios
from hfortix_fortios import FortiOS
# Connect to your FortiGate
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 with simplified syntax
fgt.api.cmdb.firewall.policy.post(
name="Allow-Web-Traffic",
srcintf=["internal"], # Auto-converted to FortiOS format
dstintf=["wan1"],
srcaddr=["all"],
dstaddr=["web-server"],
service=["HTTP", "HTTPS"],
action="accept",
nat="enable"
)
✨ Key Features
- 🎯 Complete API Coverage - 1,348 endpoints across CMDB, Monitor, Log, and Service APIs
- 💪 Fully Typed - Complete type hints with .pyi stubs for excellent IDE support
- ⚡ Modern & Fast - Async/await support with httpx, HTTP/2, connection pooling
- 🛡️ Production Ready - Comprehensive error handling, validation, retry logic, rate limiting
- 🔄 Simplified Syntax - Simple list format auto-converts to FortiOS dict format
- 📦 Batch Transactions - Atomic configuration changes with automatic commit/rollback (v0.5.152+)
- 🔍 API Inspection - Debug and audit API interactions (v0.5.152+)
- 🌐 FortiManager Proxy - Manage multiple FortiGates through FortiManager
📊 API Coverage
FortiOS 7.6.5 - 100% Coverage (1,348 endpoints)
- 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)
All endpoints are auto-generated with complete schema coverage.
📚 Documentation
- Full Documentation: https://hfortix-fortios.readthedocs.io
- Quickstart Guide: See QUICKSTART.md
- Examples: See EXAMPLES.md
- API Reference: https://hfortix-fortios.readthedocs.io/en/latest/api-reference/
🔗 Related Packages
This package is part of the HFortix SDK ecosystem:
- hfortix-core - Core HTTP client and utilities
- hfortix - Meta package to install all components
📄 License
Proprietary license. All rights reserved.
🤝 Support
- Issues: https://github.com/hermanwjacobsen/hfortix-fortios/issues
- PyPI: https://pypi.org/project/hfortix-fortios/
Version: 0.5.154-beta
FortiOS Support: 7.6.5
Python: 3.10+
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 Distributions
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 hfortix_fortios-0.5.161-py3-none-any.whl.
File metadata
- Download URL: hfortix_fortios-0.5.161-py3-none-any.whl
- Upload date:
- Size: 13.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a78ca59d316c751191e3f54b39117c84d0b131bcf00ebfe4a0769fa15f2e89f
|
|
| MD5 |
944ec95501f60007e0b1e1402eac7734
|
|
| BLAKE2b-256 |
d0c90171d4bf754b9dc606e4440c659859d35e9fc139bc08d99a3c00e617af7c
|