lala Reference manual¶
-
class
lala.
WebLogs
(*args, **kw)[source]¶ Custom Pandas dataframe class for reading web logs.
-
countries_colormap
(mini='auto', maxi='auto', ax=None)[source]¶ Plot a colormap of different countries, return the Matplotlib ax.
Parameters: country_values
A list of couples (coutry_name, value)
mini, maxi
Extreme values leading to read or white colors. Leave to auto to adjust this range to the values of country_values.
ax
A Matplotlib ax with a representation of the world. If None, one is created automatically
-
entries_last
(num, duration)[source]¶ Returns the weblogs of the latest entries up to XX ago.
Examples
>>> # Filter out all entries more than 1 hour old >>> last_hour_weblogs = self.entries_last(1, 'hour') >>> # Filter out all entries more than 5 days old >>> last_days_weblogs = self.entries_last(5, 'days')
-
filter_by_text_search
(terms, are_in=None, not_in=None)[source]¶ Return a filtered version of self based on searched terms.
-
static
from_nginx_weblogs
(filepath=None, log_lines=None)[source]¶ Return a dataframe of access log entries, from lines of NGINX logs.
The log_lines are a list of strings, each representing one access logged by NGINX.
-
plot_geo_positions
(ax=None, country_colors=True)[source]¶ Plot circles on a map around positions of the entries in the access log.
Parameters: ax
Matplotlib ax with a representation of the world.
-