Skip to content

Commit 13d55e9

Browse files
committed
Create project "TelegramBots"
1 parent 8a17806 commit 13d55e9

29 files changed

+1104
-0
lines changed

TelegramBots/.gitignore

+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/Lib/site-packages/pip/_internal/operations/build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
101+
celerybeat-schedule
102+
celerybeat.pid
103+
104+
# SageMath parsed files
105+
*.sage.py
106+
107+
# Environments
108+
.env
109+
.venv
110+
TelegramBots/env/
111+
venv/
112+
TelegramBots/env/
113+
env.bak/
114+
venv.bak/
115+
116+
# Spyder project settings
117+
.spyderproject
118+
.spyproject
119+
120+
# Rope project settings
121+
.ropeproject
122+
123+
# mkdocs documentation
124+
/site
125+
126+
# mypy
127+
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Pyre type checker
132+
.pyre/
133+
134+
# pytype static type analyzer
135+
.pytype/
136+
137+
# Cython debug symbols
138+
cython_debug/
139+
140+
# User-specific stuff
141+
.idea/

TelegramBots/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# n.aynur19_telegrams_bot

TelegramBots/data/ClassTimetable.csv

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
weekday;lessonStart;lessonEnd;lessonName;teacherName;isEveryWeek;isEvenWeek;isOddWeek;isOnceMonth;isOnline;otherInfo
2+
�����������;1900-01-01 18:15:00;1900-01-01 21:30:00;������ ������� ��������� � ������� ������;�������� �. �.;True;True;True;False;True;YouTube
3+
�������;1900-01-01 18:15:00;1900-01-01 21:30:00;��������������� ��������� ��;����������� �. �.;True;True;True;False;True;Zoom
4+
�����;1900-01-01 09:00:00;1900-01-01 11:00:00;Unity;�������� �. �.;False;True;False;False;True;Zoom
5+
�����;1900-01-01 18:00:00;1900-01-01 20:00:00;Unity;�������� �. �.;False;False;True;False;True;Zoom
6+
�����;1900-01-01 18:15:00;1900-01-01 21:30:00;���������� ����;������� �. �,;False;True;False;False;True;Zoom
7+
�������;1900-01-01 16:00:00;1900-01-01 17:30:00;���������� ��������� ������������;IT-�����, ����. ���.;False;False;False;True;True;Zoom
8+
�������;1900-01-01 18:15:00;1900-01-01 21:30:00;����������� ���������;������� �.;True;True;True;False;True;Zoom
9+
�������;1900-01-01 09:00:00;1900-01-01 12:15:00;Agile;������ �. �.;True;True;True;False;True;Zoom
10+
Python;1900-01-01 12:30:00;1900-01-01 15:30:00;Python;������ �. �.;True;True;True;False;True;Zoom

TelegramBots/data/generate_data.py

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
from datetime import datetime
2+
from models import ClassTimetable
3+
import csv
4+
5+
6+
def class_timetable_to_csv():
7+
header, data = get_class_timetable_data()
8+
9+
with open('ClassTimetable.csv', 'w', newline='') as csv_file:
10+
csv_writer = csv.writer(csv_file, delimiter=';')
11+
12+
csv_writer.writerow(header)
13+
14+
for lesson in data:
15+
csv_writer.writerow([f'{lesson.weekday}',
16+
f'{lesson.lesson_start}',
17+
f'{lesson.lesson_end}',
18+
f'{lesson.lesson_name}',
19+
f'{lesson.teacher_name}',
20+
f'{lesson.is_every_week}',
21+
f'{lesson.is_even_week}',
22+
f'{lesson.is_odd_week}',
23+
f'{lesson.is_once_month}',
24+
f'{lesson.is_online}',
25+
f'{lesson.other_info}',
26+
])
27+
28+
29+
def get_class_timetable_data():
30+
header = ['weekday', 'lessonStart', 'lessonEnd', 'lessonName',
31+
'teacherName', 'isEveryWeek', 'isEvenWeek', 'isOddWeek',
32+
'isOnceMonth', 'isOnline', 'otherInfo']
33+
34+
data = []
35+
data.append(ClassTimetable('Понедельник',
36+
datetime.strptime('18:15', '%H:%M'),
37+
datetime.strptime('21:30', '%H:%M'),
38+
'Основы методов обработки и анализа данных',
39+
'Джумурат А. С.',
40+
other_info='YouTube'))
41+
42+
data.append(ClassTimetable('Вторник',
43+
datetime.strptime('18:15', '%H:%M'),
44+
datetime.strptime('21:30', '%H:%M'),
45+
'Фундаментальные концепции ИИ',
46+
'Кондаратцев В. Л.',
47+
other_info='Zoom'))
48+
49+
data.append(ClassTimetable('Среда',
50+
datetime.strptime('09:00', '%H:%M'),
51+
datetime.strptime('11:00', '%H:%M'),
52+
'Unity',
53+
'Лушников А. Ю.',
54+
is_even_week=True,
55+
is_odd_week=False,
56+
is_every_week=False,
57+
other_info='Zoom'))
58+
59+
data.append(ClassTimetable('Среда',
60+
datetime.strptime('18:00', '%H:%M'),
61+
datetime.strptime('20:00', '%H:%M'),
62+
'Unity',
63+
'Лушников А. Ю.',
64+
is_every_week=False,
65+
is_even_week=False,
66+
is_odd_week=True,
67+
other_info='Zoom'))
68+
69+
data.append(ClassTimetable('Среда',
70+
datetime.strptime('18:15', '%H:%M'),
71+
datetime.strptime('21:30', '%H:%M'),
72+
'Английский язык',
73+
'Осадчая С. В,',
74+
is_every_week=False,
75+
is_even_week=True,
76+
is_odd_week=False,
77+
other_info='Zoom'))
78+
79+
data.append(ClassTimetable('Четверг',
80+
datetime.strptime('16:00', '%H:%M'),
81+
datetime.strptime('17:30', '%H:%M'),
82+
'Мониторинг проектной деятельности',
83+
'IT-центр, науч. рук.',
84+
is_odd_week=False,
85+
is_even_week=False,
86+
is_every_week=False,
87+
is_once_month=True,
88+
other_info='Zoom'))
89+
90+
data.append(ClassTimetable('Четверг',
91+
datetime.strptime('18:15', '%H:%M'),
92+
datetime.strptime('21:30', '%H:%M'),
93+
'Программная инженерия',
94+
'Рыбалко А.',
95+
other_info='Zoom'))
96+
97+
data.append(ClassTimetable('Суббота',
98+
datetime.strptime('09:00', '%H:%M'),
99+
datetime.strptime('12:15', '%H:%M'),
100+
'Agile',
101+
'Вяткин П. М.',
102+
other_info='Zoom'))
103+
104+
data.append(ClassTimetable('Python',
105+
datetime.strptime('12:30', '%H:%M'),
106+
datetime.strptime('15:30', '%H:%M'),
107+
'Python',
108+
'Иванов А. Н.',
109+
other_info='Zoom'))
110+
111+
return header, data
112+
113+
114+
if __name__ == '__main__':
115+
class_timetable_to_csv()

0 commit comments

Comments
 (0)