Skip to content

Commit 53e9171

Browse files
author
alisharify
committed
init
0 parents  commit 53e9171

Some content is hidden

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

51 files changed

+2473
-0
lines changed

.env.sample

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
X_DEBUG=True
2+
X_DOMAIN="https://www.geoip.ir"
3+
X_MYSQL_USERNAME='root'
4+
X_MYSQL_PASSWORD=''
5+
X_MYSQL_HOST='localhost'
6+
X_MYSQL_PORT='3306'
7+
X_MYSQL_DATABASE_NAME='geoip'
8+
9+
10+
11+
X_CAPTCHA_PUBLIC='x'
12+
X_CAPTCHA_PRIVATE='x'
13+
X_CAPTCHA_ENABLE=False
14+
15+
X_CACHE_TYPE='NullCache'
16+
X_REDIS_HOST='localhost'
17+
X_REDIS_PORT='6379'
18+
X_REDIS_PASSWORD=''
19+
X_REDIS_DB='0'
20+
X_REDIS_URL='redis://:@localhost:6379/0'

.gitignore

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
.idea
9+
.env
10+
ADD-DATA-PY
11+
insert_data.py
12+
deploy_to_server.py
13+
change_github_to_deploy.py
14+
MakeServer
15+
16+
17+
# Distribution / packaging
18+
.Python
19+
build/
20+
develop-eggs/
21+
dist/
22+
downloads/
23+
eggs/
24+
.eggs/
25+
lib/
26+
lib64/
27+
parts/
28+
sdist/
29+
var/
30+
wheels/
31+
share/python-wheels/
32+
*.egg-info/
33+
.installed.cfg
34+
*.egg
35+
MANIFEST
36+
37+
# PyInstaller
38+
# Usually these files are written by a python script from a template
39+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
40+
*.manifest
41+
*.spec
42+
43+
# Installer logs
44+
pip-log.txt
45+
pip-delete-this-directory.txt
46+
47+
# Unit test / coverage reports
48+
htmlcov/
49+
.tox/
50+
.nox/
51+
.coverage
52+
.coverage.*
53+
.cache
54+
nosetests.xml
55+
coverage.xml
56+
*.cover
57+
*.py,cover
58+
.hypothesis/
59+
.pytest_cache/
60+
cover/
61+
62+
# Translations
63+
*.mo
64+
*.pot
65+
66+
# Django stuff:
67+
*.log
68+
local_settings.py
69+
db.sqlite3
70+
db.sqlite3-journal
71+
72+
# Flask stuff:
73+
instance/
74+
.webassets-cache
75+
76+
# Scrapy stuff:
77+
.scrapy
78+
79+
# Sphinx documentation
80+
docs/_build/
81+
82+
# PyBuilder
83+
.pybuilder/
84+
target/
85+
86+
# Jupyter Notebook
87+
.ipynb_checkpoints
88+
89+
# IPython
90+
profile_default/
91+
ipython_config.py
92+
93+
# pyenv
94+
# For a library or package, you might want to ignore these files since the code is
95+
# intended to run in multiple environments; otherwise, check them in:
96+
# .python-version
97+
98+
# pipenv
99+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
101+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
102+
# install all needed dependencies.
103+
#Pipfile.lock
104+
105+
# poetry
106+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
107+
# This is especially recommended for binary packages to ensure reproducibility, and is more
108+
# commonly ignored for libraries.
109+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
110+
#poetry.lock
111+
112+
# pdm
113+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114+
#pdm.lock
115+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
116+
# in version control.
117+
# https://pdm.fming.dev/#use-with-ide
118+
.pdm.toml
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
162+
163+
# PyCharm
164+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
.idea/
169+
170+
GeoIpConfig/data.CSV
171+
GeoIpConfig/data.json
172+
GeoIpConfig/*.zip
173+
GeoIpConfig/*.json
174+
GeoIpConfig/*.csv
175+
GeoIpConfig/*.rar

GeoIpApi/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from flask import Blueprint
2+
3+
4+
api = Blueprint("api", __name__)
5+
6+
import GeoIpApi.views
7+
import GeoIpApi.model

GeoIpApi/model.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
from GeoIpCore.model import BaseTable
2+
from sqlalchemy import Column, String, BIGINT, JSON, DECIMAL
3+
4+
5+
class IPV4(BaseTable):
6+
"""This Class Contain Ipv4 range and name"""
7+
__tablename__ = "IPV4"
8+
StartRange = Column(BIGINT, unique=False, nullable=False)
9+
EndRange = Column(BIGINT, nullable=False, unique=True)
10+
11+
CountryCode = Column(String(64), unique=False, nullable=False)
12+
CountryName = Column(String(64), unique=False, nullable=False)
13+
StateName = Column(String(64), unique=False, nullable=False)
14+
CityName = Column(String(64), unique=False, nullable=False)
15+
Lat = Column(String(64), unique=False, nullable=False)
16+
Long = Column(String(64), unique=False, nullable=False)
17+
18+
ZipCode = Column(String(64), nullable=False, unique=False)
19+
TimeZone = Column(String(64), unique=False, nullable=False)
20+
21+
22+
class CountryInfo(BaseTable):
23+
__tablename__ = "CountryInfo"
24+
CommonName = Column(String(255), unique=False, nullable=False)
25+
OfficialName = Column(String(255), unique=False, nullable=False)
26+
CountryCode = Column(String(64), unique=False, nullable=False)
27+
Info = Column(JSON, unique=False, nullable=False)
28+
29+
30+
class IPV6(BaseTable):
31+
"""This Class Contain Ipv6 range and name"""
32+
__tablename__ = "IPV6"
33+
StartRange = Column(DECIMAL(scale=0, precision=36), unique=False, nullable=False)
34+
EndRange = Column(DECIMAL(scale=0, precision=36), nullable=False, unique=True)
35+
36+
CountryCode = Column(String(64), unique=False, nullable=False)
37+
CountryName = Column(String(64), unique=False, nullable=False)
38+
StateName = Column(String(64), unique=False, nullable=False)
39+
CityName = Column(String(64), unique=False, nullable=False)
40+
Lat = Column(String(64), unique=False, nullable=False)
41+
Long = Column(String(64), unique=False, nullable=False)
42+
43+
ZipCode = Column(String(64), nullable=False, unique=False)
44+
TimeZone = Column(String(64), unique=False, nullable=False)

0 commit comments

Comments
 (0)