Edinburgh-Genome-Foundry / lala

Licence: other
🌎 Analyze and generate reports of web logs (NGINX)

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to lala

cordova-plugin-radar
Cordova plugin for Radar, the leading geofencing and location tracking platform
Stars: ✭ 14 (-76.27%)
Mutual labels:  geolocation
utils-do
utils-do is a javascript package that provides functionalities that'll easily help you to interact with Dominican Republic's data.
Stars: ✭ 18 (-69.49%)
Mutual labels:  geolocation
Geocoding-with-Map-Vector
Resources for the ACL 2018 publication "Which Melbourne? Augmenting Geocoding with Maps", published in July 2018.
Stars: ✭ 24 (-59.32%)
Mutual labels:  geolocation
geocoder
Geocoder is a Typescript library which helps you build geo-aware applications by providing a powerful abstraction layer for geocoding manipulations
Stars: ✭ 28 (-52.54%)
Mutual labels:  geolocation
totalopenstation
Total Open Station downloads and exports survey data from your total station
Stars: ✭ 51 (-13.56%)
Mutual labels:  geolocation
df-aggregator
Networked DFing software that can handle multiple DOA receivers.
Stars: ✭ 47 (-20.34%)
Mutual labels:  geolocation
vue-geolocation
ask to your users their coordinates, and wrap them into a Promise
Stars: ✭ 88 (+49.15%)
Mutual labels:  geolocation
wifi-locate
Locates your Wi-Fi-enabled machine using Wi-Fi access points signal strengths, using Google's API
Stars: ✭ 20 (-66.1%)
Mutual labels:  geolocation
svelte-googlemaps
Svelte Google Maps Components
Stars: ✭ 62 (+5.08%)
Mutual labels:  geolocation
tinygeoip
🐉 tiny geoip microservice
Stars: ✭ 13 (-77.97%)
Mutual labels:  geolocation
ip2location-lua
Use IP2Location geolocation database to lookup the geolocation information with IP2Location Lua Package. It can be used to determine country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation, usage type, address type and IAB category that any IP address …
Stars: ✭ 14 (-76.27%)
Mutual labels:  geolocation
rescue-me
Light-weight and minimalistic system for push-based location requests.
Stars: ✭ 13 (-77.97%)
Mutual labels:  geolocation
ip2location-csv-converter
This PHP script converts IP2Location CSV database into IP range or CIDR format.
Stars: ✭ 26 (-55.93%)
Mutual labels:  geolocation
GeoLite.mmdb
MaxMind's GeoIP2 GeoLite2 Country, City, and ASN databases
Stars: ✭ 690 (+1069.49%)
Mutual labels:  geolocation
radiocells-nlp-android
radiocells.org Unified Network Location Provider
Stars: ✭ 35 (-40.68%)
Mutual labels:  geolocation
pikaz-location
定位插件(限中国)
Stars: ✭ 78 (+32.2%)
Mutual labels:  geolocation
ember-cli-geo
Geolocation service for Ember.js web apps
Stars: ✭ 48 (-18.64%)
Mutual labels:  geolocation
world-cities-mongodb
A free world cities database
Stars: ✭ 29 (-50.85%)
Mutual labels:  geolocation
captAR
Augmented Reality Geolocation Capture-the-Flag Mobile Game Capstone Project
Stars: ✭ 24 (-59.32%)
Mutual labels:  geolocation
FakeGPS
[NOT MAINTAINED] FakeGPS driver for Windows
Stars: ✭ 85 (+44.07%)
Mutual labels:  geolocation

alternate text


Travis CI build status https://coveralls.io/repos/github/Edinburgh-Genome-Foundry/lala/badge.svg?branch=master

Lala is a Python library for access log analysis. It provides a set of methods to retrieve, parse and analyze access logs (only from NGINX for now), and makes it easy to plot geo-localization or time-series data. Think of it as a simpler, Python-automatable version of Google Analytics, to make reports like this:

alternate text

Usage

from lala import WebLogs
weblogs, errored_lines = WebLogs.from_nginx_weblogs('access_logs.txt')

Similarly, to fetch logs on a distant server (for which you have access keys) you would write:

from lala import get_remote_file_content, WebLogs

logs= lala.get_remote_file_content(
    host="cuba.genomefoundry.org", user='root',
    filename='/var/log/nginx_cuba/access.log'
)
weblogs, errors = WebLogs.from_nginx_weblogs(logs.split('\n'))

Now weblogs is a scpecial kind of Pandas dataframe where each row is one server access, with fields such as IP, date, referrer, country_name, etc.

alternate text

The web logs can therefore be analyzed using any of Pandas' built-in filtering and plotting functions. The WebLogs class also provides additional methods which are particularly useful to analyse web logs, for instance to plot pie-charts:

ax, country_values = weblogs.plot_piechart('country_name')

alternate text

Next we plot the location (cities) providing the most connexions:

ax = weblogs.plot_geo_positions()

alternate text

We can also restrict the entries to the UK, and plot a timeline of connexions:

uk_entries = weblogs[weblogs.country_name == 'United Kingdom']
ax = uk_entries.plot_timeline(bins_per_day=2)

alternate text

Here is how to get the visitors a list of visitors and visits, sort out the most frequent visitors, find their locations, and plot it all:

visitors = weblogs.visitors_and_visits()
visitors_locations = weblogs.visitors_locations()
frequent_visitors = weblogs.most_frequent_visitors(n_visitors=5)
ax = weblogs.plot_most_frequent_visitors(n_visitors=5)

alternate text

Lala can do more, such as identifying the domain name of the visitors, which can be used to filter out the robots of search engines:

weblogs.identify_ips_domains()
filtered_entries = weblogs.filter_by_text_search(
    terms=['googlebot', 'spider.yandex', 'baidu', 'msnbot'],
    not_in='domain'
)

Lala also plays nicely with the PDF Reports library to let you define report templates such as this one (written in Pug), and then generate this PDF report with the following code:

weblogs.write_report(template_path="path/to/template.pug",
                     target="report_example.pdf")

Installation

You can install lala through PIP

sudo pip install python-lala

Alternatively, you can unzip the sources in a folder and type

sudo python setup.py install

For plotting maps you will need Cartopy which is not always easy to install - it may depend on your system. If you are on Ubuntu 16+, first install the dependencies with:

sudo apt-get install libproj-dev proj-bin proj-data libgeos-dev
sudo pip install cython

License = MIT

lala is an open-source software originally written at the Edinburgh Genome Foundry by Zulko and released on Github under the MIT licence (Copyright 2018 Edinburgh Genome Foundry).

Everyone is welcome to contribute!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].