Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 27 additions & 136 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,140 +1,31 @@
aiohttp==3.9.1
aiosignal==1.3.1
ansi2html==1.9.1
appnope==0.1.4
astroid==3.0.2
asttokens==2.4.1
async-timeout==4.0.3
attrs==23.2.0
autopep8==2.0.4
backcall==0.2.0
beautifulsoup4==4.12.3
bleach==6.1.0
blinker==1.7.0
certifi==2023.11.17
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
cssselect==1.2.0
dash==2.14.2
blinker==1.9.0
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
dash==2.18.2
dash-core-components==2.0.0
dash-html-components==2.0.0
dash-mantine-components==0.12.1
dash-table==5.0.0
decorator==5.1.1
defusedxml==0.7.1
dicttoxml==1.7.16
dill==0.3.7
docopt==0.6.2
docutils==0.20.1
exceptiongroup==1.2.0
executing==2.0.1
fastjsonschema==2.19.1
Flask==3.0.0
frozenlist==1.4.1
future==0.18.3
geocoder==1.38.1
geoip2==4.8.0
h11==0.14.0
idna==3.6
importlib-metadata==7.0.1
iniconfig==2.0.0
ip2geotools==0.1.6
IP2Location==8.10.2
ipython==8.12.3
isort==5.13.2
itsdangerous==2.1.2
jaraco.classes==3.3.0
jedi==0.19.1
Jinja2==3.1.3
jsonschema==4.22.0
jsonschema-specifications==2023.12.1
jupyter_client==8.6.2
jupyter_core==5.7.2
jupyterlab_pygments==0.3.0
keyring==24.3.0
lazy-object-proxy==1.10.0
lxml==5.1.0
markdown-it-py==3.0.0
MarkupSafe==2.1.3
matplotlib-inline==0.1.7
maxminddb==2.5.2
mccabe==0.7.0
mdurl==0.1.2
mistune==3.0.2
more-itertools==10.2.0
multidict==6.0.4
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.5.9
nh3==0.2.15
numpy==1.26.3
outcome==1.3.0.post0
packaging==23.2
pandas==2.1.4
pandocfilters==1.5.1
parso==0.8.4
patsy==0.5.6
pexpect==4.9.0
pickleshare==0.7.5
pip-review==1.3.0
pipreqs==0.5.0
pkginfo==1.9.6
platformdirs==4.1.0
plotly==5.18.0
plotly-express==0.4.1
pluggy==1.4.0
prompt-toolkit==3.0.43
ptyprocess==0.7.0
pure-eval==0.2.2
pycodestyle==2.11.1
Pygments==2.17.2
pylint==3.0.3
pyparsing==3.1.1
pyquery==2.0.0
PySocks==1.7.1
pytest==7.4.4
python-dateutil==2.8.2
pytz==2023.3.post1
pyzmq==26.0.3
ratelim==0.1.6
readme-renderer==42.0
referencing==0.35.1
requests==2.31.0
requests-toolbelt==1.0.0
dash_mantine_components==0.15.3
Flask==3.0.3
idna==3.10
importlib_metadata==8.6.1
itsdangerous==2.2.0
Jinja2==3.1.5
MarkupSafe==3.0.2
narwhals==1.26.0
nest-asyncio==1.6.0
numpy==2.0.2
packaging==24.2
pandas==2.2.3
plotly==6.0.0
python-dateutil==2.9.0.post0
pytz==2025.1
requests==2.32.3
retrying==1.3.4
rfc3986==2.0.0
rich==13.7.0
rpds-py==0.18.1
scipy==1.11.4
selenium==4.16.0
six==1.16.0
sniffio==1.3.0
sortedcontainers==2.4.0
soupsieve==2.5
stack-data==0.6.3
statsmodels==0.14.1
tenacity==8.2.3
tinycss2==1.3.0
tomli==2.0.1
tomlkit==0.12.3
tornado==6.4
tqdm==4.66.1
traitlets==5.14.3
trio==0.24.0
trio-websocket==0.11.1
twine==4.0.2
typed-ast==1.5.5
typing==3.7.4.3
typing_extensions==4.9.0
tzdata==2023.4
urllib3==2.1.0
wcwidth==0.2.13
webencodings==0.5.1
Werkzeug==3.0.1
wrapt==1.16.0
wsproto==1.2.0
yarg==0.1.9
yarl==1.9.4
zipp==3.17.0
six==1.17.0
typing_extensions==4.12.2
tzdata==2025.1
urllib3==2.3.0
Werkzeug==3.0.6
zipp==3.21.0
11 changes: 6 additions & 5 deletions user_analytics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ip2geotools.databases.noncommercial import DbIpCity
# from ip2geotools.databases.noncommercial import DbIpCity
import json
import pandas as pd

Expand Down Expand Up @@ -28,10 +28,11 @@ def parse_user_ip_addresses(file_path='data/export/user.json'):
lats = []
longs = []
# lookup the latitude and longitude coordinates of each IP address
for ip in ip_addresses[:100]:
coord = DbIpCity.get(ip, api_key="free")
lats.append(coord.latitude)
longs.append(coord.longitude)
# TODO: replace this with another library, there is an API limit and this takes way too long to load
# for ip in ip_addresses[:100]:
# coord = DbIpCity.get(ip, api_key="free")
# lats.append(coord.latitude)
# longs.append(coord.longitude)

# define column names and create a DataFrame
coordinates = pd.DataFrame({'latitude': lats, 'longitude': longs})
Expand Down