
    dh                    n    S r SSKJr  SSKJr  SSKJrJrJr  SSKJ	r	  SSK
Jr  SSKJr   " S S	\5      rg
)z=Simple reader that reads weather data from OpenWeatherMap API    )annotations)datetime)IteratorOptionalSequence)Document)
BaseLoaderOpenWeatherMapAPIWrapperc                  p   ^  \ rS rSrSr      S	U 4S jjr\SS.     S
S jj5       r  SS jrSr	U =r
$ )WeatherDataLoader   zLoad weather data with `Open Weather Map` API.

Reads the forecast & current weather of any location using OpenWeatherMap's free
API. Checkout 'https://openweathermap.org/appid' for more on how to generate a free
OpenWeatherMap API.
c                :   > [         TU ]  5         Xl        X l        g)zInitialize with parameters.N)super__init__clientplaces)selfr   r   	__class__s      d/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/document_loaders/weather.pyr   WeatherDataLoader.__init__   s     	    Nopenweathermap_api_keyc               $    [        US9nU " X15      $ )Nr   r
   )clsr   r   r   s       r   from_paramsWeatherDataLoader.from_params    s     *AWX6""r   c              #     #    U R                    H@  nS[        R                  " 5       0nU R                  R	                  U5      n[        X2S9v   MB     g7f)z1Lazily load weather data for the given locations.
queried_at)page_contentmetadataN)r   r   nowr   runr   )r   placer"   contents       r   	lazy_loadWeatherDataLoader.lazy_load'   sB      [[E$hlln5Hkkooe,GCC !s   AA)r   r   )r   r   r   Sequence[str]returnNone)r   r)   r   zOptional[str]r*   r   )r*   zIterator[Document])__name__
__module____qualname____firstlineno____doc__r   classmethodr   r'   __static_attributes____classcell__)r   s   @r   r   r      sm    (  
	 OS#"#?L#	# #D	D Dr   r   N)r0   
__future__r   r   typingr   r   r   langchain_core.documentsr   )langchain_community.document_loaders.baser	   ,langchain_community.utilities.openweathermapr   r    r   r   <module>r:      s+    C "  / / - @ Q D
  Dr   