hfortix 0.5.75__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
hfortix/__init__.py
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""
|
|
2
|
+
HFortix - Python SDK for Fortinet Products
|
|
3
|
+
|
|
4
|
+
Meta-package providing convenient access to all Fortinet SDKs.
|
|
5
|
+
|
|
6
|
+
Install individual packages for smaller footprint:
|
|
7
|
+
pip install hfortix-core
|
|
8
|
+
pip install hfortix-fortios
|
|
9
|
+
pip install hfortix-fortimanager
|
|
10
|
+
pip install hfortix-fortianalyzer
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
# Re-export from core
|
|
14
|
+
from hfortix_core import (
|
|
15
|
+
APIError,
|
|
16
|
+
AuthenticationError,
|
|
17
|
+
AuthorizationError,
|
|
18
|
+
BadRequestError,
|
|
19
|
+
CircuitBreakerOpenError,
|
|
20
|
+
ConfigurationError,
|
|
21
|
+
DuplicateEntryError,
|
|
22
|
+
EntryInUseError,
|
|
23
|
+
FortinetError,
|
|
24
|
+
InvalidValueError,
|
|
25
|
+
MethodNotAllowedError,
|
|
26
|
+
NonRetryableError,
|
|
27
|
+
OperationNotSupportedError,
|
|
28
|
+
PermissionDeniedError,
|
|
29
|
+
RateLimitError,
|
|
30
|
+
ReadOnlyModeError,
|
|
31
|
+
ResourceNotFoundError,
|
|
32
|
+
RetryableError,
|
|
33
|
+
ServerError,
|
|
34
|
+
ServiceUnavailableError,
|
|
35
|
+
TimeoutError,
|
|
36
|
+
VDOMError,
|
|
37
|
+
fmt,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
# Re-export from fortios
|
|
41
|
+
from hfortix_fortios import FortiOS
|
|
42
|
+
|
|
43
|
+
__version__ = "0.5.75"
|
|
44
|
+
__author__ = "Herman W. Jacobsen"
|
|
45
|
+
|
|
46
|
+
__all__ = [
|
|
47
|
+
# FortiOS
|
|
48
|
+
"FortiOS",
|
|
49
|
+
# Formatting utilities
|
|
50
|
+
"fmt",
|
|
51
|
+
# Exceptions
|
|
52
|
+
"FortinetError",
|
|
53
|
+
"APIError",
|
|
54
|
+
"AuthenticationError",
|
|
55
|
+
"AuthorizationError",
|
|
56
|
+
"RetryableError",
|
|
57
|
+
"NonRetryableError",
|
|
58
|
+
"ConfigurationError",
|
|
59
|
+
"VDOMError",
|
|
60
|
+
"OperationNotSupportedError",
|
|
61
|
+
"ReadOnlyModeError",
|
|
62
|
+
"BadRequestError",
|
|
63
|
+
"ResourceNotFoundError",
|
|
64
|
+
"MethodNotAllowedError",
|
|
65
|
+
"RateLimitError",
|
|
66
|
+
"ServerError",
|
|
67
|
+
"ServiceUnavailableError",
|
|
68
|
+
"CircuitBreakerOpenError",
|
|
69
|
+
"TimeoutError",
|
|
70
|
+
"DuplicateEntryError",
|
|
71
|
+
"EntryInUseError",
|
|
72
|
+
"InvalidValueError",
|
|
73
|
+
"PermissionDeniedError",
|
|
74
|
+
]
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hfortix
|
|
3
|
+
Version: 0.5.75
|
|
4
|
+
Summary: Python SDK for Fortinet products (FortiOS, FortiManager, FortiAnalyzer)
|
|
5
|
+
Author-email: "Herman W. Jacobsen" <herman@wjacobsen.fo>
|
|
6
|
+
License: Proprietary
|
|
7
|
+
Project-URL: Homepage, https://github.com/hermanwjacobsen/hfortix
|
|
8
|
+
Project-URL: Repository, https://github.com/hermanwjacobsen/hfortix
|
|
9
|
+
Keywords: fortinet,fortigate,fortios,fortimanager,fortianalyzer,api,sdk
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: hfortix-core>=0.5.74
|
|
19
|
+
Provides-Extra: fortios
|
|
20
|
+
Requires-Dist: hfortix-fortios>=0.5.74; extra == "fortios"
|
|
21
|
+
Provides-Extra: all
|
|
22
|
+
Requires-Dist: hfortix-fortios>=0.5.74; extra == "all"
|
|
23
|
+
|
|
24
|
+
# HFortix
|
|
25
|
+
|
|
26
|
+
Complete Python SDK for Fortinet Products - Modular, type-safe, production-ready.
|
|
27
|
+
|
|
28
|
+
[](https://pypi.org/project/hfortix/)
|
|
29
|
+
[](https://www.python.org/downloads/)
|
|
30
|
+
|
|
31
|
+
> **⚠️ BETA STATUS - Version 0.5.45 (January 9, 2026)**
|
|
32
|
+
>
|
|
33
|
+
> **Breaking Changes**: v0.5.0 removes convenience wrappers. Use direct API access via `fgt.api.*`
|
|
34
|
+
> **Status**: Production-ready but in beta until v1.0 with comprehensive unit tests.
|
|
35
|
+
> **What's New**: Core `fmt` module with 13 formatting utilities, automatic key normalization!
|
|
36
|
+
|
|
37
|
+
**Version:** 0.5.45
|
|
38
|
+
**Status:** Beta (100% auto-generated, production-ready, pending comprehensive unit tests for v1.0)
|
|
39
|
+
|
|
40
|
+
## Overview
|
|
41
|
+
|
|
42
|
+
HFortix is a modular Python SDK that provides comprehensive, production-ready clients for Fortinet products. Starting with FortiOS/FortiGate, with future support planned for FortiManager, FortiAnalyzer, and more.
|
|
43
|
+
|
|
44
|
+
**Version 0.5.32** features major improvements to object response mode, auto-normalization for list fields, and enhanced IDE support with 15,000+ parameters having enum autocomplete.
|
|
45
|
+
|
|
46
|
+
This is a **meta-package** that provides convenient installation patterns for the HFortix ecosystem.
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
### Minimal Installation (Core Only)
|
|
51
|
+
```bash
|
|
52
|
+
pip install hfortix
|
|
53
|
+
```
|
|
54
|
+
Installs only `hfortix-core` - the shared foundation (exceptions, HTTP client, type definitions).
|
|
55
|
+
|
|
56
|
+
### FortiOS/FortiGate Support
|
|
57
|
+
```bash
|
|
58
|
+
pip install hfortix[fortios]
|
|
59
|
+
```
|
|
60
|
+
Installs `hfortix-core` + `hfortix-fortios` - Everything needed for FortiGate/FortiOS.
|
|
61
|
+
|
|
62
|
+
### Complete Installation
|
|
63
|
+
```bash
|
|
64
|
+
pip install hfortix[all]
|
|
65
|
+
```
|
|
66
|
+
Installs all current and future Fortinet product packages.
|
|
67
|
+
|
|
68
|
+
### Individual Packages
|
|
69
|
+
|
|
70
|
+
You can also install product packages directly:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Just FortiOS (includes core automatically)
|
|
74
|
+
pip install hfortix-fortios
|
|
75
|
+
|
|
76
|
+
# Just the core framework
|
|
77
|
+
pip install hfortix-core
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Quick Start
|
|
81
|
+
|
|
82
|
+
### FortiOS/FortiGate
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
from hfortix_fortios import FortiOS
|
|
86
|
+
|
|
87
|
+
# Connect to FortiGate
|
|
88
|
+
fgt = FortiOS(
|
|
89
|
+
host="192.168.1.99",
|
|
90
|
+
token="your-api-token",
|
|
91
|
+
verify=False
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
# Get system status
|
|
95
|
+
status = fgt.monitor.system.status()
|
|
96
|
+
print(f"Hostname: {status['hostname']}")
|
|
97
|
+
|
|
98
|
+
# Manage firewall addresses
|
|
99
|
+
fgt.api.cmdb.firewall.address.create(
|
|
100
|
+
name="web-server",
|
|
101
|
+
subnet="192.168.1.100 255.255.255.255"
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# Use convenience wrappers
|
|
105
|
+
fgt.firewall.service_custom.create(
|
|
106
|
+
name="HTTPS-8443",
|
|
107
|
+
tcp_portrange="8443",
|
|
108
|
+
protocol="TCP/UDP/SCTP"
|
|
109
|
+
)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Package Structure
|
|
113
|
+
|
|
114
|
+
HFortix uses a modular architecture:
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
hfortix (meta-package)
|
|
118
|
+
├── hfortix-core # Shared foundation
|
|
119
|
+
│ ├── Exception system (403+ error codes)
|
|
120
|
+
│ ├── HTTP client framework (sync & async)
|
|
121
|
+
│ ├── fmt module (13 formatting utilities)
|
|
122
|
+
│ ├── Type definitions (TypedDict, Protocols)
|
|
123
|
+
│ └── Debug utilities
|
|
124
|
+
│
|
|
125
|
+
└── hfortix-fortios # FortiOS/FortiGate client
|
|
126
|
+
├── Complete API coverage (1,348 endpoints)
|
|
127
|
+
├── 2,129 endpoint files with type stubs
|
|
128
|
+
├── Auto-generated validators
|
|
129
|
+
└── FortiObject response wrapper
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Future Packages:**
|
|
133
|
+
- `hfortix-fortimanager` - FortiManager API client
|
|
134
|
+
- `hfortix-fortianalyzer` - FortiAnalyzer API client
|
|
135
|
+
- `hfortix-fortiswitch` - FortiSwitch API client
|
|
136
|
+
- And more...
|
|
137
|
+
|
|
138
|
+
## Key Features
|
|
139
|
+
|
|
140
|
+
### 🎯 Modular Design
|
|
141
|
+
|
|
142
|
+
Install only what you need:
|
|
143
|
+
- Minimal footprint with `hfortix-core`
|
|
144
|
+
- Product-specific packages when needed
|
|
145
|
+
- Shared infrastructure across all products
|
|
146
|
+
|
|
147
|
+
### ⚡ Complete FortiOS Support
|
|
148
|
+
|
|
149
|
+
**API Coverage (FortiOS 7.6.5 - Schema v1.7.0):**
|
|
150
|
+
- **1,348 total endpoints** (100% auto-generated)
|
|
151
|
+
- 561 CMDB endpoints (configuration management)
|
|
152
|
+
- 490 Monitor endpoints (real-time data)
|
|
153
|
+
- 286 Log endpoints (disk, memory, FortiAnalyzer, FortiCloud)
|
|
154
|
+
- 11 Service endpoints (sniffer, security rating, system)
|
|
155
|
+
|
|
156
|
+
**Features:**
|
|
157
|
+
- Complete `.pyi` type stubs (2,129 files) for perfect IDE autocomplete
|
|
158
|
+
- Schema-based validation for all parameters
|
|
159
|
+
- Auto-generated tests for all endpoints
|
|
160
|
+
- Automatic key normalization (hyphens → underscores)
|
|
161
|
+
|
|
162
|
+
### 🏢 Enterprise Features
|
|
163
|
+
|
|
164
|
+
- **Async/Await Support**: Full async implementation with context managers
|
|
165
|
+
- **Error Handling**: 403+ specific error codes with comprehensive exception hierarchy
|
|
166
|
+
- **HTTP/2 Support**: Connection multiplexing for better performance
|
|
167
|
+
- **Automatic Retry**: Handles transient failures intelligently
|
|
168
|
+
- **Circuit Breaker**: Prevents cascade failures with automatic recovery
|
|
169
|
+
- **Type Safety**: Full type hints with IDE autocomplete
|
|
170
|
+
- **Read-Only Mode**: Safe testing without accidental changes
|
|
171
|
+
- **Operation Tracking**: Audit logging for all API calls
|
|
172
|
+
- **Performance Testing**: Built-in tools to optimize device communication
|
|
173
|
+
- **Formatting Utilities**: `fmt` module with 13 data conversion functions
|
|
174
|
+
|
|
175
|
+
## Import Patterns
|
|
176
|
+
|
|
177
|
+
### Recommended (New in v0.4.0-dev1)
|
|
178
|
+
```python
|
|
179
|
+
# Product packages
|
|
180
|
+
from hfortix_fortios import FortiOS
|
|
181
|
+
|
|
182
|
+
# Core exceptions
|
|
183
|
+
from hfortix_core import (
|
|
184
|
+
APIError,
|
|
185
|
+
ResourceNotFoundError,
|
|
186
|
+
DuplicateEntryError
|
|
187
|
+
)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Legacy (Still Supported)
|
|
191
|
+
```python
|
|
192
|
+
from hfortix import FortiOS
|
|
193
|
+
from hfortix.FortiOS import FortiOS
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Migration from v0.4.x
|
|
197
|
+
|
|
198
|
+
**Breaking Changes in v0.5.0:**
|
|
199
|
+
- All convenience wrappers have been removed
|
|
200
|
+
- Use direct API access via `fgt.api.cmdb.*`, `fgt.api.monitor.*`, `fgt.api.log.*`
|
|
201
|
+
|
|
202
|
+
**Old (v0.4.x):**
|
|
203
|
+
```python
|
|
204
|
+
from hfortix_fortios.firewall import FirewallAddress
|
|
205
|
+
addr = FirewallAddress(fgt)
|
|
206
|
+
result = addr.create(name="test", subnet="10.0.0.1/32")
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**New (v0.5.0):**
|
|
210
|
+
```python
|
|
211
|
+
result = fgt.api.cmdb.firewall.address.create(
|
|
212
|
+
name="test",
|
|
213
|
+
subnet="10.0.0.1/32"
|
|
214
|
+
)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
All methods work the same - just accessed directly through the endpoint.
|
|
218
|
+
|
|
219
|
+
## Documentation
|
|
220
|
+
|
|
221
|
+
**Getting Started:**
|
|
222
|
+
- [Quick Start Guide](https://github.com/hermanwjacobsen/hfortix/blob/main/QUICKSTART.md) - Installation and basic usage
|
|
223
|
+
- [Async Guide](https://github.com/hermanwjacobsen/hfortix/blob/main/docs/fortios/ASYNC_GUIDE.md) - Async/await patterns
|
|
224
|
+
- [API Reference](https://github.com/hermanwjacobsen/hfortix/blob/main/docs/fortios/ENDPOINT_METHODS.md) - Complete method reference
|
|
225
|
+
|
|
226
|
+
**Convenience Wrappers:**
|
|
227
|
+
- [Overview](https://github.com/hermanwjacobsen/hfortix/blob/main/docs/fortios/wrappers/CONVENIENCE_WRAPPERS.md) - All wrappers
|
|
228
|
+
- [Service Management](https://github.com/hermanwjacobsen/hfortix/blob/main/docs/fortios/wrappers/CONVENIENCE_WRAPPERS.md#service-management)
|
|
229
|
+
- [Schedules](https://github.com/hermanwjacobsen/hfortix/blob/main/docs/fortios/wrappers/SCHEDULE_WRAPPERS.md)
|
|
230
|
+
- [Traffic Shaping](https://github.com/hermanwjacobsen/hfortix/blob/main/docs/fortios/wrappers/SHAPER_WRAPPERS.md)
|
|
231
|
+
|
|
232
|
+
**Advanced Topics:**
|
|
233
|
+
- [Validation Guide](https://github.com/hermanwjacobsen/hfortix/blob/main/docs/fortios/VALIDATION_GUIDE.md) - Using validators
|
|
234
|
+
- [Error Handling](https://github.com/hermanwjacobsen/hfortix/blob/main/docs/fortios/ERROR_HANDLING_CONFIG.md) - Exception system
|
|
235
|
+
- [Performance Testing](https://github.com/hermanwjacobsen/hfortix/blob/main/docs/fortios/PERFORMANCE_TESTING.md) - Optimization
|
|
236
|
+
|
|
237
|
+
**Project Info:**
|
|
238
|
+
- [Changelog](https://github.com/hermanwjacobsen/hfortix/blob/main/CHANGELOG.md) - Version history
|
|
239
|
+
- [GitHub Repository](https://github.com/hermanwjacobsen/hfortix) - Complete docs
|
|
240
|
+
|
|
241
|
+
## Requirements
|
|
242
|
+
|
|
243
|
+
- Python 3.10+
|
|
244
|
+
- FortiOS 7.0+ (tested with 7.6.5)
|
|
245
|
+
|
|
246
|
+
## Development Status
|
|
247
|
+
|
|
248
|
+
**Beta** - All APIs are functional and tested against live Fortinet devices. The package remains in beta status until version 1.0.0 with comprehensive unit test coverage.
|
|
249
|
+
|
|
250
|
+
**Current Test Coverage:**
|
|
251
|
+
- 226 test files for FortiOS
|
|
252
|
+
- 75%+ pass rate
|
|
253
|
+
- ~50% of endpoints have dedicated tests
|
|
254
|
+
- All implementations validated against FortiOS 7.6.5
|
|
255
|
+
|
|
256
|
+
## Why Modular?
|
|
257
|
+
|
|
258
|
+
**Benefits of the split package architecture:**
|
|
259
|
+
|
|
260
|
+
1. **Smaller Dependencies**: Install only what you need
|
|
261
|
+
2. **Faster Updates**: Product packages can be updated independently
|
|
262
|
+
3. **Better Organization**: Clear separation of concerns
|
|
263
|
+
4. **Easier Maintenance**: Focused development per product
|
|
264
|
+
5. **Future Flexibility**: Easy to add new Fortinet products
|
|
265
|
+
|
|
266
|
+
## Version History
|
|
267
|
+
|
|
268
|
+
- **v0.4.0-dev1** (Current): Package split - modular architecture
|
|
269
|
+
- **v0.3.39**: Convenience wrappers (services, schedules, shaping, IP/MAC binding)
|
|
270
|
+
- **v0.3.38**: Firewall policy wrapper with 150+ parameters
|
|
271
|
+
- **v0.3.x**: Async support, error handling, performance tools
|
|
272
|
+
- **v0.1.x-v0.2.x**: Initial FortiOS API implementation
|
|
273
|
+
|
|
274
|
+
## License
|
|
275
|
+
|
|
276
|
+
Proprietary - See LICENSE file
|
|
277
|
+
|
|
278
|
+
## Support
|
|
279
|
+
|
|
280
|
+
- 📖 [Documentation](https://github.com/hermanwjacobsen/hfortix)
|
|
281
|
+
- 🐛 [Report Issues](https://github.com/hermanwjacobsen/hfortix/issues)
|
|
282
|
+
- 💬 [Discussions](https://github.com/hermanwjacobsen/hfortix/discussions)
|
|
283
|
+
|
|
284
|
+
## Author
|
|
285
|
+
|
|
286
|
+
**Herman W. Jacobsen**
|
|
287
|
+
- Email: herman@wjacobsen.fo
|
|
288
|
+
- LinkedIn: [linkedin.com/in/hermanwjacobsen](https://www.linkedin.com/in/hermanwjacobsen/)
|
|
289
|
+
- GitHub: [@hermanwjacobsen](https://github.com/hermanwjacobsen)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
hfortix/__init__.py,sha256=8b1l4uZpcTu33y1R1Bgq-XvtMkfR96bJPFew2RO5kBY,1625
|
|
2
|
+
hfortix-0.5.75.dist-info/METADATA,sha256=99oqTrT5OrC1lSn5_Nj28XOLJbvQ34W9cYWEVTDMFLA,9910
|
|
3
|
+
hfortix-0.5.75.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
4
|
+
hfortix-0.5.75.dist-info/top_level.txt,sha256=DGcxMrc_a9Uy2P4HF3U7MCUPJ9Har-sSZkMm9J5HnEI,8
|
|
5
|
+
hfortix-0.5.75.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hfortix
|