avni.data.common module#

This script/module contains routines that are used to analyze data and files that contain them.

avni.data.common.creation_date(path_to_file: str)[source]#

Try to get the date that a file was created, falling back to when it was last modified if that isn’t possible.

Parameters
path_to_filestr

full path to a file

Returns
datetime

datetime stamp in UTC as AVNI server stores datetime in UTC

Authors

Raj Moulik (moulik@caa.columbia.edu)

Last Modified

2020.01.06 11.00

avni.data.common.update_file(file, folder=None, baseurl=None, subdirectory=None)[source]#

If the AVNI server contain a downloadable resource that is newer, download it locally.

Parameters
filestr

full path and name of the file to sync with AVNI servers

folderstr

folder where local files are store, by default as output from tools.get_filedir()

baseurl: str

public URL from where the public downloads can take place, by default as specified as downloadpage in constants.py

subdirectory: str

subdirectory inside the baseurl where the file should be synced

:Authors:

Raj Moulik (moulik@caa.columbia.edu)

:Last Modified:

2023.01.06 11.00