Determining if a time series is random

An example time series would be the stock market, which is sometimes described as a random walk. Over time, this is clearly not the case as it has essentially gone in one direction (up) with only occasional setbacks.

I'm coming up with several characteristics that could be used to measure orderliness of a specific segment of a time series:

1. Net movement from start to finish
2. Linearity of movement
3. Length of time

In short, the larger the absolute value of the movement relative to the standard deviation of the series over similar lengths of time and the more linear the move, the more significant that segment. These characteristics could also form a kind of signature of each given segment.

Maybe the answer to this is simply that a time series whose segments don't fit a normal distribution is a non-random time series, but I'm wondering if there are methods that capture the significance of a time segment relative to #1-3 above, i.e., "how rare is this segment"?

You can run a statistical test like Augmented Dickey Fuller to check if the variable follows a random walk.
Use the adfuller function from statsmodels:

from statsmodels.tsa.stattools import adfuller