Identifying trend and seasonality of time series data As a part of a statistical analysis engine, I need to figure out a way to identify the presence or absence of trends and seasonality patterns in a given set of time series data. While most answers and tutorials in the Internet outlines methods to predict or forecast time series data using machine learning models, my objective is simply to identify the presence any such pattern.

Example: daily sales data through a year

This data set could show upward trends with monthly seasonality
or no actual trend with yearly seasonality.

If I am not to manually inspect the scatter plot of the distribution, in what ways can I determine the presence of those patterns?

I have looked at the following approaches so far:


Using moving average or exponential smoothing to smooth the time series curve and then check if the resulting line can be approximated to a linear curve, which is supposed to provide an upwards or downward trend if any.  
Using auto correlation to check for seasonality, which I am yet to confirm if it's a possible solution or not (any ideas?)
Another idea could be Fourier Transformation, which takes a time serie as an input (time domain), and converts it into frequency domain.

Consider this example:



When you transform the time series data from time domain into frequency domain, you can observe the repeated patterns (=seasonality). In this case, there is peak at 12 (day/night rhytm), at 24 (day) or 168 (week).

I can imagine you can perform the FFT and then extract the peaks based on certain threshold

The Git repo also contains a nice introduction into FFT.

Source: https://github.com/balzer82/FFT-Python