Skip to content
Raphaël Odini edited this page Sep 15, 2024 · 13 revisions

Products

Top products with prices

unique_scans_n

Date Flavor Top 100 Top 1000
2024-08-24 OFF 80 567
2024-09-13 OFF 81 583
LIMIT = 100
queryset = Product.objects.order_by("-unique_scans_n")[:LIMIT].values_list("price_count", flat=True)
len(list(filter(lambda pc: pc != 0, list(queryset))))

Number of products with prices per flavor

Date OFF OPF OBF OPPF unknown
2024-09-13 16046 / 3390281 201 / 15618 157 / 30634 33 / 9713 2476 / 4441
from open_prices.products import constants as product_constants
for flavor in product_constants.SOURCE_LIST + [None]:
    print(flavor, Product.objects.filter(source=flavor).filter(price_count__gte=1).count(), "/", Product.objects.filter(source=flavor).count())

Locations

Top countries

from collections import Counter

l = Price.objects.values_list("location__osm_address_country", flat=True)
Counter(l)

Top location OSM types

from collections import Counter
from django.db.models import F, Value, CharField
from django.db.models.functions import Concat

l = Location.objects.annotate(osm_tag=Concat(F("osm_tag_key"), Value(":"), F("osm_tag_value"), output_field=CharField())).values_list("osm_tag", flat=True)

Counter(l)
// top 30, stats from 08/09/2024 (961 locations)

'shop:supermarket': 614,
'shop:convenience': 76,
'boundary:administrative': 25,
'amenity:fuel': 18,
'shop:chemist': 13,
'shop:variety_store': 13,
'place:house': 7,
'highway:bus_stop': 7,
'shop:bakery': 7,
'shop:mall': 7,
'shop:deli': 7,
'shop:frozen_food': 6,
'landuse:retail': 6,
'amenity:pharmacy': 6,
'railway:station': 6,
'landuse:construction': 5,
'shop:greengrocer': 5,
'shop:furniture': 5,
'landuse:industrial': 4,
'shop:department_store': 4,
'shop:farm': 4,
'building:yes': 4,
'shop:wholesale': 4,
'shop:books': 3,
'amenity:fast_food': 3,
'shop:sports': 3,
'place:city': 3,
'shop:doityourself': 3,
'amenity:cafe': 3,
'place:suburb': 3
...
Clone this wiki locally