Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mysql #98

Merged
merged 1 commit into from
Jul 19, 2023
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
476 changes: 15 additions & 461 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ readme = "README.md"
python = "^3.11.1"
python-telegram-bot = "^20.3"
pydantic = {extras = ["email"], version = "^1.10.8"}
sqlalchemy = "2.0.16"
aiomysql = "^0.1.1"
python-dotenv = "^1.0.0"
beautifulsoup4 = "^4.12.2"
requests-cache = "^1.0.1"
lxml = "^4.9.2"
attrs = "^23.1.0"
pymysql = "^1.0.3"
redis = "^4.5.5"
django = "^4.2.3"
uvicorn = "^0.23.0"
Expand All @@ -29,14 +24,11 @@ psycopg2-binary = "^2.9.6"
flake8 = "^6.0.0"
isort = "^5.12.0"
pre-commit = "^3.3.1"
python-dotenv = "^1.0.0"
black = "^23.3.0"
pytest = "^7.3.1"
anyio = "^3.7.0"
pytest-tornasync = "^0.6.0.post2"
factory-boy = "^3.2.1"
python-telegram-bot = "^20.3"
mysql-connector-python = "^8.0.33"


[tool.pytest.ini_options]
Expand Down
14 changes: 3 additions & 11 deletions requirements/develop.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
aiomysql==0.1.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
anyio==3.7.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
asgiref==3.7.2 ; python_full_version >= "3.11.1" and python_version < "4.0"
async-timeout==4.0.2 ; python_full_version >= "3.11.1" and python_full_version <= "3.11.2"
attrs==23.1.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
beautifulsoup4==4.12.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
black==23.3.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
cattrs==23.1.2 ; python_full_version >= "3.11.1" and python_version < "4.0"
certifi==2023.5.7 ; python_full_version >= "3.11.1" and python_version < "4.0"
cfgv==3.3.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
charset-normalizer==3.1.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
click==8.1.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
colorama==0.4.6 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0" and sys_platform == "win32" or python_full_version >= "3.11.1" and python_full_version < "4.0.0" and platform_system == "Windows"
colorama==0.4.6 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0" and (sys_platform == "win32" or platform_system == "Windows")
distlib==0.3.6 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
django-asgi-lifespan==0.1.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
django==4.2.3 ; python_full_version >= "3.11.1" and python_version < "4.0"
Expand All @@ -20,43 +18,37 @@ factory-boy==3.2.1 ; python_full_version >= "3.11.1" and python_full_version < "
faker==18.11.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
filelock==3.12.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
flake8==6.0.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
greenlet==2.0.2 ; python_full_version >= "3.11.1" and platform_machine == "win32" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "WIN32" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "AMD64" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "amd64" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "x86_64" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "ppc64le" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "aarch64" and python_full_version < "4.0.0"
h11==0.14.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
httpcore==0.17.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
httpx==0.24.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
identify==2.5.24 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
idna==3.4 ; python_full_version >= "3.11.1" and python_version < "4.0"
iniconfig==2.0.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
isort==5.12.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
lxml==4.9.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
mccabe==0.7.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
mypy-extensions==1.0.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
mysql-connector-python==8.0.33 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
nodeenv==1.8.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
packaging==23.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pathspec==0.11.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
platformdirs==3.7.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
pluggy==1.2.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pre-commit==3.3.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
protobuf==3.20.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
psycopg2-binary==2.9.6 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pycodestyle==2.10.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pydantic[email]==1.10.9 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pyflakes==3.0.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pymysql==1.0.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pytest-tornasync==0.6.0.post2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pytest==7.3.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
python-dateutil==2.8.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
python-dotenv==1.0.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
python-telegram-bot==20.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
python-telegram-bot==20.4 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pyyaml==6.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
redis==4.5.5 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
requests-cache==1.0.1 ; python_full_version >= "3.11.1" and python_version < "4.0"
requests==2.31.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
setuptools==68.0.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
six==1.16.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
sniffio==1.3.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
soupsieve==2.4.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
sqlalchemy==2.0.16 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
sqlparse==0.4.4 ; python_full_version >= "3.11.1" and python_version < "4.0"
tornado==6.3.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
typing-extensions==4.6.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
Expand Down
10 changes: 2 additions & 8 deletions requirements/production.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
aiomysql==0.1.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
anyio==3.7.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
asgiref==3.7.2 ; python_full_version >= "3.11.1" and python_version < "4.0"
async-timeout==4.0.2 ; python_full_version >= "3.11.1" and python_full_version <= "3.11.2"
attrs==23.1.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
beautifulsoup4==4.12.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
cattrs==23.1.2 ; python_full_version >= "3.11.1" and python_version < "4.0"
certifi==2023.5.7 ; python_full_version >= "3.11.1" and python_version < "4.0"
charset-normalizer==3.1.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
Expand All @@ -13,24 +11,20 @@ django-asgi-lifespan==0.1.0 ; python_full_version >= "3.11.1" and python_version
django==4.2.3 ; python_full_version >= "3.11.1" and python_version < "4.0"
dnspython==2.3.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
email-validator==2.0.0.post2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
greenlet==2.0.2 ; python_full_version >= "3.11.1" and platform_machine == "win32" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "WIN32" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "AMD64" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "amd64" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "x86_64" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "ppc64le" and python_full_version < "4.0.0" or python_full_version >= "3.11.1" and platform_machine == "aarch64" and python_full_version < "4.0.0"
h11==0.14.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
httpcore==0.17.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
httpx==0.24.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
idna==3.4 ; python_full_version >= "3.11.1" and python_version < "4.0"
lxml==4.9.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
platformdirs==3.7.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
psycopg2-binary==2.9.6 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pydantic[email]==1.10.9 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pymysql==1.0.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
python-dotenv==1.0.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
python-telegram-bot==20.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
python-telegram-bot==20.4 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
redis==4.5.5 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
requests-cache==1.0.1 ; python_full_version >= "3.11.1" and python_version < "4.0"
requests==2.31.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
six==1.16.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
sniffio==1.3.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
soupsieve==2.4.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
sqlalchemy==2.0.16 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
sqlparse==0.4.4 ; python_full_version >= "3.11.1" and python_version < "4.0"
typing-extensions==4.6.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
tzdata==2023.3 ; python_full_version >= "3.11.1" and python_version < "4.0" and sys_platform == "win32"
Expand Down
27 changes: 0 additions & 27 deletions src/bot/services.py
Original file line number Diff line number Diff line change
@@ -1,27 +0,0 @@
from bs4 import BeautifulSoup
from sqlalchemy.ext.asyncio import AsyncSession

from utils.db.crud.extract import extract_data_from_db


def parser_coordinators(session: AsyncSession) -> dict:
"""Парсер контактов координаторов из таблицы html."""
sql_request = (
"SELECT post_content FROM detfond_posts WHERE post_name IN"
'("kontakty-koordinatorov")'
)
data = extract_data_from_db(session, sql_request)
results = {"results": []}
soup = BeautifulSoup(data, features="lxml")
tbody_tag = soup.find("tbody")
tr_tags = tbody_tag.find_all("tr")
attributes_dict = [tr_tag.text for tr_tag in tr_tags[0]][1::2]
for tr_tag in tr_tags[1:]:
td_tags = tr_tag.find_all("td")
index = 0
result = {}
for td_tag in td_tags:
result[attributes_dict[index]] = td_tag.text
index += 1
results["results"].append(result)
return results
Empty file removed src/utils/db/__init__.py
Empty file.
Empty file removed src/utils/db/crud/__init__.py
Empty file.
9 changes: 0 additions & 9 deletions src/utils/db/crud/extract.py

This file was deleted.

13 changes: 0 additions & 13 deletions src/utils/db/db.py

This file was deleted.

Empty file removed src/utils/db/schemas/__init__.py
Empty file.
103 changes: 0 additions & 103 deletions src/utils/db_fixtures/filldb.py

This file was deleted.

Loading
Loading