TimeAtlas Client
The TimeAtlas client provides a Python interface for interacting with the TimeAtlas API.
Main Client Class
- class timeatlas.TimeAtlas.TimeAtlas[source]
Bases:
object- default_save_cache_filepath = 'rde_entity_cache.pkl'
- entity_cache = {}
- generate_obs_from_list_of_hr(hr_list)[source]
- Parameters:
hr_list (list[HistoricalRecord])
- Return type:
- generate_geoms_from_list_of_obs(obs_list)[source]
- Parameters:
obs_list (list[Observation])
- Return type:
- generate_pois_from_list_of_obs(obs_list)[source]
- Parameters:
obs_list (list[Observation])
- Return type:
- static hr_list_to_dataframe(hr_list)[source]
- Parameters:
hr_list (list[HistoricalRecord])
- Return type:
Usage Examples
Basic Usage
from timeatlas import TimeAtlas
# Initialize the client
client = TimeAtlas(api_url='https://your-timeatlas-instance.com/v1')
# Fetch a single RDE object
entity = client.get_single_rde_object('historical-records', 'uuid-here')
# Save entity cache to file
client.save_entity_cache_to_file('my_cache.pkl')
Working with Cached Entities
The TimeAtlas client maintains an internal cache of fetched entities for improved performance. The cache is automatically saved to disk and loaded on subsequent client initializations.
# Cache is automatically loaded from default file on initialization
client = TimeAtlas(api_url='https://api.example.com/v1')
# Save cache to custom location
client.save_entity_cache_to_file('custom_cache.pkl')