Skip to main content

Native Libraries

GoTotus provides native libraries for a more fluid syntax and simpler use:

Python

Location: https://github.com/GoTotus/pytotus


from totus import Totus

t = Totus()
reference = t.Reference()

print("Any shop nearby:")
print(reference.GeoPOI(gh='69y7pkxfc', distance=1000, what='shop', limit=2))

print("Any shop nearby, but prividing lat/lon instead of geohash:")
print(reference.GeoPOI(lat=-34.60362, lon=-58.3824, what='shop', limit=2))

print("Only bookshops, 2km around:")
print(reference.GeoPOI(gh='69y7pkxfc', distance=2000, what='shop', filter={'shop': 'books'}, limit=2))

print("Only bookshops, 2km around, name includes the word 'libro' in any case:")
print(reference.GeoPOI(gh='69y7pkxfc', distance=2000, what='shop', filter={'shop': 'books', 'name': '~*libro*'}, limit=2))

will Output:


Any shop nearby:
[{
"id": 4675113766,
"lat": -34.60362,
"lon": -58.3824,
"gh": "69y7pkx5r3",
"dist": 71.6,
"info": {
"addr:city": "Ciudad Aut\u00f3noma de Buenos Aires",
"addr:country": "AR",
"addr:street": "Avenida Corrientes",
"name": "Maxikiosko",
"shop": "kiosk"
}
}, {
"id": 12179098601,
"lat": -34.60395,
"lon": -58.38076,
"gh": "69y7ps83ms",
"dist": 84,
"info": {
"addr:housenumber": "999",
"addr:street": "Avenida Presidente Roque S\u00e1enz Pe\u00f1a",
"name": "I Love Gifts",
"shop": "gift"
}
}]
Any shop nearby, but prividing lat/lon instead of geohash:
[{
"id": 4675113766,
"lat": -34.60362,
"lon": -58.3824,
"gh": "69y7pkx5r3",
"dist": 0.4,
"info": {
"addr:city": "Ciudad Aut\u00f3noma de Buenos Aires",
"addr:country": "AR",
"addr:street": "Avenida Corrientes",
"name": "Maxikiosko",
"shop": "kiosk"
}
}, {
"id": 5355217400,
"lat": -34.60365,
"lon": -58.38276,
"gh": "69y7pkwgp5",
"dist": 33,
"info": {
"shop": "books"
}
}]
Only bookshops, 2km around:
[{
"id": 5355217400,
"lat": -34.60365,
"lon": -58.38276,
"gh": "69y7pkwgp5",
"dist": 103.7,
"info": {
"shop": "books"
}
}, {
"id": 4683477630,
"lat": -34.604,
"lon": -58.38414,
"gh": "69y7pktcng",
"dist": 232.7,
"info": {
"addr:city": "Ciudad Aut\u00f3noma de Buenos Aires",
"addr:country": "AR",
"addr:street": "Avenida Corrientes",
"name": "Obel Libros",
"shop": "books"
}
}]
Only bookshops, 2km around, name includes the word 'libro' in any case:
[{
"id": 4683477630,
"lat": -34.604,
"lon": -58.38414,
"gh": "69y7pktcng",
"dist": 232.7,
"info": {
"addr:city": "Ciudad Aut\u00f3noma de Buenos Aires",
"addr:country": "AR",
"addr:street": "Avenida Corrientes",
"name": "Obel Libros",
"shop": "books"
}
}, {
"id": 4675113801,
"lat": -34.60372,
"lon": -58.38426,
"gh": "69y7pktfsp",
"dist": 241.1,
"info": {
"addr:city": "Ciudad Aut\u00f3noma de Buenos Aires",
"addr:country": "AR",
"addr:street": "Avenida Corrientes",
"name": "Cuspide Libros",
"shop": "books"
}
}]