
    _Og'                     >    S SK JrJrJrJr  SSKJr   " S S\5      rg)    )AnyDictListOptional   )Entityc                      ^  \ rS rSrSrS\S\\   4U 4S jjrS\4S jr	S\4S jr
SS\S
\\   S\4S jjrS\S\4S jrS\4S jrS\4S jrS\4S jrS\4S jrS\4S jrS\SS	4S jrSrU =r$ )Flight   z
Flight representation.
	flight_idinfoc                   > [         TU ]  U R                  US   5      U R                  US   5      S9  Xl        U R                  US   5      U l        U R                  US   5      U l        U R                  US   5      U l        U R                  US   5      U l        U R                  US   5      U l        U R                  US	   5      U l	        U R                  US
   5      U l
        U R                  US   5      U l        U R                  US   5      U l        U R                  US   5      U l        U R                  US   5      U l        U R                  US   SS 5      U l        U R                  US   5      U l        U R                  US   5      U l        U R                  US   5      U l        U R                  US   5      U l        g)z
Constructor of the Flight class.

:param flight_id: The flight ID specifically used by FlightRadar24
:param info: Dictionary with received data from FlightRadar24
r      )latitude	longituder                  	   
            N            )super__init___Flight__get_infoid
icao_24bitheadingaltitudeground_speedsquawkaircraft_coderegistrationtimeorigin_airport_iatadestination_airport_iatanumberairline_iata	on_groundvertical_speedcallsignairline_icao)selfr   r   	__class__s      b/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/FlightRadar24/entities/flight.pyr!   Flight.__init__   s    	__T!W-ood1g. 	 	

 //$q'2tAw/Q0 OODG4ood1g.!__T!W5 OODG4OODH-	#'??48#< (,R(A%ood2h/ OODHRaL9b2"ood2h7R1 OODH5    returnc                 "    U R                  5       $ N)__str__r4   s    r6   __repr__Flight.__repr__)   s    ||~r8   c                     SnUR                  U R                  U R                  U R                  U R                  U R
                  5      $ )Nz9<({}) {} - Altitude: {} - Ground Speed: {} - Heading: {}>)formatr)   r*   r&   r'   r%   )r4   templates     r6   r<   Flight.__str__,   s<    Nt1143D3DdmmUYUfUfhlhthtuur8   Ndefaultc                 P    Ub  UOU R                   nUb  XR                   :w  a  U$ U$ r;   )_default_text)r4   r   rD   s      r6   
__get_infoFlight.__get_info0   s/    $0'd6H6H'D4F4F,FtSGSr8   c                 T   [         [        S.nUR                  5        H  u  p4USS S:X  d	  USS S:X  a  UR                  SSS9OSU4u  pSU(       a.  X0R                  ;   a  X%   " X@R                  U   5      U:w  a    g	Mb  X0R                  ;   d  Ms  X@R                  U   :w  d  M    g	   g
)z
Check one or more flight information.

You can use the prefix "max_" or "min_" in the parameter
to compare numeric data with ">" or "<".

Example: check_info(min_altitude = 6700, max_altitude = 13000, airline_icao = "THY")
)maxminNr   max_min__r   )maxsplitFT)rJ   rK   itemssplit__dict__)r4   r   comparison_functionskeyvalueprefixs         r6   
check_infoFlight.check_info4   s     (+37**,JC 9<BQ68ISQSRSWX^M^#))C!)4eikndoKF #.'/}}S7IJeS\aS %%==3E*Ee ' r8   c                 8    SR                  U R                  5      $ )z:
Return the formatted altitude, with the unit of measure.
z{} ft)rA   r&   r=   s    r6   get_altitudeFlight.get_altitudeN   s     ~~dmm,,r8   c                 x    U R                   S:  a  [        U R                   5      SS S-   $ U R                  5       $ )z>
Return the formatted flight level, with the unit of measure.
i'  Nr   z FL)r&   strrZ   r=   s    r6   get_flight_levelFlight.get_flight_levelT   s8     26%1Gs4==!"1%-`TM^M^M``r8   c                 f    SR                  U R                  5      U R                  S:  a  S-   $ S-   $ )z>
Return the formatted ground speed, with the unit of measure.
z{} ktr   s )rA   r'   r=   s    r6   get_ground_speedFlight.get_ground_speedZ   s4     ~~d//04;L;Lq;PCYYVXYYr8   c                 2    [        U R                  5      S-   $ )z9
Return the formatted heading, with the unit of measure.
   °)r]   r%   r=   s    r6   get_headingFlight.get_heading`   s     4<< 4''r8   c                 8    SR                  U R                  5      $ )z@
Return the formatted vertical speed, with the unit of measure.
z{} fpm)rA   r1   r=   s    r6   get_vertical_speedFlight.get_vertical_speedf   s     t2233r8   flight_detailsc                    U R                  UR                  S5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S5      [        5       5      n	U R                  UR                  S	5      [        5       5      n
U R                  UR                  S
5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S	5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S5      [        5       5      nU R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        UR                  S[        5       5      U l        UR                  S[        5       5      U l        U R                  U R                  UR                  S5      [        5       5      R                  S5      5      U l        U R                  UR                  S5      5      U l	        U R                  UR                  S5      5      U l
        U R                  UR                  S5      5      U l        U R                  U	R                  S5      5      U l        U R                  U	R                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  U
R                  S5      5      U l        U R                  U
R                  S5      5      U l        U R                  U
R                  S5      5      U l        U R                  U
R                  S5      5      U l        U R                  U
R                  S 5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l        U R                  UR                  S5      5      U l         U R                  UR                  S5      5      U l!        U R                  UR                  S5      5      U l"        U R                  UR                  S5      5      U l#        U R                  UR                  S5      5      U l$        U R                  UR                  S5      5      U l%        U R                  UR                  S5      5      U l&        U R                  UR                  S5      5      U l'        U R                  UR                  S5      5      U l(        U R                  UR                  S5      5      U l)        U R                  UR                  S5      5      U l*        U R                  UR                  S5      5      U l+        U R                  UR                  S 5      5      U l,        U R                  UR                  S!5      5      U l-        U R                  UR                  S5      5      U l.        U R                  UR                  S"5      [        5       5      U l/        UR                  S#[        5       5      U l0        g$)%zd
Set flight details to the instance. Use FlightRadar24API.get_flight_details(...) method to get it.
aircraftairlineairportdestinationcoder   positioncountrytimezoneoriginflightHistorystatusage	countryIdimagesmodeltextnameshortr&   r   r   icaobaggagegateterminalvisiblewebsiteabbrabbrNameoffsetoffsetHoursiconr+   trailN)1r"   getdictaircraft_ageaircraft_country_idlistaircraft_historyaircraft_imagesaircraft_modelairline_nameairline_short_namedestination_airport_altitude destination_airport_country_code destination_airport_country_namedestination_airport_latitudedestination_airport_longitudedestination_airport_icaodestination_airport_baggagedestination_airport_gatedestination_airport_namedestination_airport_terminaldestination_airport_visibledestination_airport_website!destination_airport_timezone_abbr&destination_airport_timezone_abbr_name!destination_airport_timezone_name#destination_airport_timezone_offset)destination_airport_timezone_offset_hoursorigin_airport_altitudeorigin_airport_country_codeorigin_airport_country_nameorigin_airport_latitudeorigin_airport_longitudeorigin_airport_icaoorigin_airport_baggageorigin_airport_gateorigin_airport_nameorigin_airport_terminalorigin_airport_visibleorigin_airport_websiteorigin_airport_timezone_abbr!origin_airport_timezone_abbr_nameorigin_airport_timezone_nameorigin_airport_timezone_offset$origin_airport_timezone_offset_hoursstatus_iconstatus_texttime_detailsr   )r4   rl   rn   ro   rp   dest_airportdest_airport_codedest_airport_infodest_airport_positiondest_airport_countrydest_airport_timezoneorig_airportorig_airport_codeorig_airport_infoorig_airport_positionorig_airport_countryorig_airport_timezonehistoryrx   s                      r6   set_flight_detailsFlight.set_flight_detailsl   s:   
 ??>#5#5j#A46J //."4"4Y"?H //."4"4Y"?H w{{='A46J OOL,<,<V,DdfM OOL,<,<V,DdfM $0@0@0Ldf U#/D/H/H/SUYU[\ $0@0@0Ldf U w{{8'<dfE OOL,<,<V,DdfM OOL,<,<V,DdfM $0@0@0Ldf U#/D/H/H/SUYU[\ $0@0@0Ldf U //."4"4_"EtvN !3!3H!=tvF !OOHLL,?@#'??8<<3L#M  'J ?'||Hdf="oodoohll7>SUYU[.\.`.`ag.hi !OOGKK,?@"&//'++g2F"G -1OO<Q<U<UV`<a,b)04@T@X@XY_@`0a-04@T@X@XY_@`0a-,0OO<Q<U<UV`<a,b)-1__=R=V=VWb=c-d* )-8I8M8Mf8U(V%+/??;L;P;PQZ;[+\((,8I8M8Mf8U(V%(,8H8H8P(Q%,0OO<M<Q<QR\<],^)+/??<;K;KI;V+W(+/??<;K;KI;V+W( 26AVAZAZ[aAb1c.6:ooF[F_F_`jFk6l315AVAZAZ[aAb1c.37??CXC\C\]eCf3g09=I^IbIbcpIq9r6 (,7L7P7PQ[7\']$+/??;O;S;STZ;[+\(+/??;O;S;STZ;[+\('+7L7P7PQ[7\']$(,8M8Q8QR]8^(_% $(??3D3H3H3P#Q &*oo6G6K6KI6V&W##'??3D3H3H3P#Q #'??<3C3CF3K#L '+7H7L7LZ7X'Y$&*ool6F6Fy6Q&R#&*ool6F6Fy6Q&R# -1OO<Q<U<UV\<],^)15AVAZAZ[eAf1g.,0OO<Q<U<UV\<],^).2oo>S>W>WX`>a.b+48OODYD]D]^kDl4m1  ??6::f+=>??6::f+=> !OON,>,>v,FO $''8
r8   )>r   r)   r   r   r   r   r/   r3   r   r   r&   r2   r   r   r   r   r   r-   r   r   r   r   r   r   r   r   r   r   r   r   r'   r%   r$   r#   r.   r0   r   r   r   r   r   r,   r   r   r   r   r   r   r   r   r   r   r   r   r*   r(   r   r   r+   r   r   r1   r;   )__name__
__module____qualname____firstlineno____doc__r]   r   r   r!   r>   r<   r   r"   boolrW   rZ   r^   rc   rg   rj   r   r   __static_attributes____classcell__)r5   s   @r6   r
   r
      s    6# 6T#Y 6<# v vTs TXc] Tc T  4-c -a# aZ# Z(S (4C 4d9 d9$ d9 d9r8   r
   N)typingr   r   r   r   entityr   r
    r8   r6   <module>r      s    - , I9V I9r8   