-
Notifications
You must be signed in to change notification settings - Fork 4
/
demo.py
40 lines (34 loc) · 1.28 KB
/
demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#-*- coding: utf-8 -*-
from manager import Manager
import datetime
test_manager = Manager() # avec proxy
test_manager = Manager(how_to_auth='cert') # avec cert
other_params = {
'requestedFlightFields': [
'flightState',
'cfmuFlightType'
]
}
# startTime et endTime peuvent être des objets datetime.datetime ou des str au format AAAA-MM-JJ HH:MM
# attention : startTime et endTime doivent être exprimées en heures UTC
startTime=datetime.datetime(year=2019, month=10, day=21, hour=14, minute=30, tzinfo=datetime.timezone.utc)
endTime= datetime.datetime(year=2019, month=10, day=21, hour=15, minute=30, tzinfo=datetime.timezone.utc)
# démo queryFlightsByAirspace
flight_list = test_manager.queryFlightsByAirspace(
airspace="LFFFTH",
startTime=startTime, endTime=endTime,
other_params=other_params)
print(flight_list.data)
# démo queryFlightsByAerodrome
flight_list = test_manager.queryFlightsByAerodrome(
aerodrome="LFPG",
aerodromeRole="DEPARTURE",
startTime=startTime, endTime=endTime,
other_params=other_params)
print(flight_list.data)
# démo queryFlightsByTrafficVolume
flight_list = test_manager.queryFlightsByTrafficVolume(
trafficVolume='LFFTN',
startTime=startTime, endTime=endTime,
other_params=other_params)
print(flight_list.data)