Skip to content

Commit f28e587

Browse files
Initial commit
0 parents  commit f28e587

File tree

11,157 files changed

+2134295
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

11,157 files changed

+2134295
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Codewithdark
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# IP Address Tracker
2+
3+
## Overview
4+
This is a simple Streamlit web application that allows users to track the geographical location of an IP address. It retrieves location data using the [ipinfo.io](https://ipinfo.io/) API and visualizes the location on a map.
5+
6+
## Features
7+
- Users can input an IP address and retrieve its geographical location information.
8+
- The app displays the IP address, country, region, city, latitude, longitude, and postal code of the provided IP address.
9+
- It visualizes the location on a Google Map using custom marker designs.
10+
11+
## Usage
12+
1. Clone the repository:
13+
```bash
14+
git clone https://github.com/codewithdark-git/ip-address-tracker.git
15+
```
16+
2. Install the required dependencies:
17+
```bash
18+
pip install -r requirements.txt
19+
```
20+
3. Run the Streamlit app:
21+
```bash
22+
streamlit run app.py
23+
```
24+
4. Access the app in your web browser at `http://localhost:8501`.
25+
26+
## Dependencies
27+
- Streamlit
28+
- Requests
29+
- Pandas
30+
- Pydeck
31+
32+
## Credits
33+
- This app was created by [Your Name].
34+
35+
## License
36+
This project is licensed under the [MIT License](LICENSE).

app.py

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import streamlit as st
2+
import pandas as pd
3+
import requests
4+
import pydeck as pdk
5+
6+
def get_geo_data(ip_address):
7+
try:
8+
response = requests.get(f"https://ipinfo.io/{ip_address}/json")
9+
if response.status_code == 200:
10+
data = response.json()
11+
return data
12+
else:
13+
st.error(f"Failed to fetch location data: {response.status_code}")
14+
return None
15+
except Exception as e:
16+
st.error(f"Error fetching location data: {e}")
17+
return None
18+
19+
20+
# Streamlit app
21+
def main():
22+
# Create an expander to contain the description in the second column
23+
with st.expander("Description"):
24+
st.markdown("""
25+
26+
The IP Address Tracker is a user-friendly web application designed to help users track the geographical location of any IP address. Whether you're curious about the origin of a specific IP address or need to identify the location of a particular device, this app provides a simple and intuitive solution.
27+
28+
With just a few clicks, users can input an IP address into the app, and it will quickly retrieve detailed location information, including the country, region, city, latitude, longitude, and postal code associated with that IP address. The app utilizes the reliable [ipinfo.io](https://ipinfo.io/) API to fetch accurate and up-to-date location data.
29+
30+
One of the key features of this app is its interactive map visualization, powered by Google Maps. Users can see the exact location of the IP address pinpointed on the map, making it easy to visualize its geographical context. Custom marker designs are used to enhance the visualization and provide an aesthetically pleasing experience.
31+
32+
Whether you're a network administrator, cybersecurity enthusiast, or simply curious about the locations behind various IP addresses, the IP Address Tracker app is an invaluable tool that streamlines the process of IP address geolocation. start Me on [Github](https://github.com/codewithdark-git)
33+
""")
34+
35+
st.title("IP Address Tracker")
36+
37+
ip_address = st.text_input("Enter IP Address:")
38+
if st.button("Get Location"):
39+
geo_data = get_geo_data(ip_address)
40+
if geo_data:
41+
42+
st.write(f"Country: {geo_data.get('country')}")
43+
st.write(f"Region: {geo_data.get('region')}")
44+
st.write(f"City: {geo_data.get('city')}")
45+
st.write(f"Postal Code: {geo_data.get('postal')}")
46+
47+
# Create a DataFrame with latitude and longitude columns
48+
df = pd.DataFrame({'latitude': [float(geo_data.get('loc').split(',')[0])],
49+
'longitude': [float(geo_data.get('loc').split(',')[1])]})
50+
51+
# Show the location on a Google Map with custom marker designs
52+
st.pydeck_chart(pdk.Deck(
53+
map_style='mapbox://styles/mapbox/streets-v11',
54+
initial_view_state=pdk.ViewState(
55+
latitude=float(geo_data.get('loc').split(',')[0]),
56+
longitude=float(geo_data.get('loc').split(',')[1]),
57+
zoom=10,
58+
pitch=50,
59+
),
60+
layers=[
61+
pdk.Layer(
62+
'ScatterplotLayer',
63+
data=df,
64+
get_position='[longitude, latitude]',
65+
get_radius=200,
66+
get_fill_color=[255, 0, 0], # Dot color (red)
67+
get_icon='https://img.icons8.com/color/48/000000/marker--v1.png', # Custom icon
68+
pickable=True,
69+
),
70+
],
71+
))
72+
else:
73+
st.error("Location not found for the provided IP.")
74+
75+
76+
if __name__ == "__main__":
77+
main()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
GitPython was originally written by Michael Trier.
2+
GitPython 0.2 was partially (re)written by Sebastian Thiel, based on 0.1.6 and git-dulwich.
3+
4+
Contributors are:
5+
6+
-Michael Trier <mtrier _at_ gmail.com>
7+
-Alan Briolat
8+
-Florian Apolloner <florian _at_ apolloner.eu>
9+
-David Aguilar <davvid _at_ gmail.com>
10+
-Jelmer Vernooij <jelmer _at_ samba.org>
11+
-Steve Frécinaux <code _at_ istique.net>
12+
-Kai Lautaportti <kai _at_ lautaportti.fi>
13+
-Paul Sowden <paul _at_ idontsmoke.co.uk>
14+
-Sebastian Thiel <byronimo _at_ gmail.com>
15+
-Jonathan Chu <jonathan.chu _at_ me.com>
16+
-Vincent Driessen <me _at_ nvie.com>
17+
-Phil Elson <pelson _dot_ pub _at_ gmail.com>
18+
-Bernard `Guyzmo` Pratz <[email protected]>
19+
-Timothy B. Hartman <tbhartman _at_ gmail.com>
20+
-Konstantin Popov <konstantin.popov.89 _at_ yandex.ru>
21+
-Peter Jones <pjones _at_ redhat.com>
22+
-Anson Mansfield <anson.mansfield _at_ gmail.com>
23+
-Ken Odegard <ken.odegard _at_ gmail.com>
24+
-Alexis Horgix Chotard
25+
-Piotr Babij <piotr.babij _at_ gmail.com>
26+
-Mikuláš Poul <mikulaspoul _at_ gmail.com>
27+
-Charles Bouchard-Légaré <cblegare.atl _at_ ntis.ca>
28+
-Yaroslav Halchenko <debian _at_ onerussian.com>
29+
-Tim Swast <swast _at_ google.com>
30+
-William Luc Ritchie
31+
-David Host <hostdm _at_ outlook.com>
32+
-A. Jesse Jiryu Davis <jesse _at_ emptysquare.net>
33+
-Steven Whitman <ninloot _at_ gmail.com>
34+
-Stefan Stancu <stefan.stancu _at_ gmail.com>
35+
-César Izurieta <cesar _at_ caih.org>
36+
-Arthur Milchior <arthur _at_ milchior.fr>
37+
-Anil Khatri <anil.soccer.khatri _at_ gmail.com>
38+
-JJ Graham <thetwoj _at_ gmail.com>
39+
-Ben Thayer <ben _at_ benthayer.com>
40+
-Dries Kennes <admin _at_ dries007.net>
41+
-Pratik Anurag <panurag247365 _at_ gmail.com>
42+
-Harmon <harmon.public _at_ gmail.com>
43+
-Liam Beguin <liambeguin _at_ gmail.com>
44+
-Ram Rachum <ram _at_ rachum.com>
45+
-Alba Mendez <me _at_ alba.sh>
46+
-Robert Westman <robert _at_ byteflux.io>
47+
-Hugo van Kemenade
48+
-Hiroki Tokunaga <tokusan441 _at_ gmail.com>
49+
-Julien Mauroy <pro.julien.mauroy _at_ gmail.com>
50+
-Patrick Gerard
51+
-Luke Twist <[email protected]>
52+
-Joseph Hale <me _at_ jhale.dev>
53+
-Santos Gallegos <stsewd _at_ proton.me>
54+
-Wenhan Zhu <wzhu.cosmos _at_ gmail.com>
55+
-Eliah Kagan <eliah.kagan _at_ gmail.com>
56+
-Ethan Lin <et.repositories _at_ gmail.com>
57+
58+
Portions derived from other open source works and are clearly marked.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Copyright (C) 2008, 2009 Michael Trier and contributors
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions
6+
are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in the
13+
documentation and/or other materials provided with the distribution.
14+
15+
* Neither the name of the GitPython project nor the names of
16+
its contributors may be used to endorse or promote products derived
17+
from this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
25+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)