florestbotfunctions 1.2.0__tar.gz → 1.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 1.2
2
+ Name: florestbotfunctions
3
+ Version: 1.2.2
4
+ Summary: Функции бота Флореста в одной библиотеке.
5
+ Home-page: UNKNOWN
6
+ Author: florestdev
7
+ Author-email: florestone4185@internet.ru
8
+ License: UNKNOWN
9
+ Project-URL: Social Resources, https://taplink.cc/florestone4185
10
+ Project-URL: My bot, https://t.me/postbotflorestbot
11
+ Description: Привет! Данная библиотека включает в себя функции из https://t.me/postbotflorestbot. Все функции, с удобным объяснением кода, только здесь. P.S. Это официальная библиотека от создателя бота - FlorestDev. Все функции предоставляются в ознакомительном порядке.
12
+ Platform: UNKNOWN
13
+ Requires-Python: >=3.8.9
@@ -475,31 +475,51 @@ class FunctionsObject:
475
475
  return 'Ошибка распознавания текста.'
476
476
  except:
477
477
  return 'Неизвестная ошибка. Также могут быть проблемы с подключением.'
478
- def piano(self) -> None:
479
- """Пианино на Python.\nИспользуем PyGame.\nНичего не возвращает.\nq - до.\nw - ре.\ne - ми.\nr - фа.\nt - соль.\ny - ля.\nu - си."""
480
- import pathlib, sys, os, pygame, keyboard
481
- os.chdir(pathlib.Path(sys.argv[0]).parent.resolve())
482
- mixer = pygame.mixer
478
+ def email_mass_send(self, recievers: list, title: str, body: str, service: str = 'smtp.mail.ru', service_port: int = 465):
479
+ """Функция для массовой отправки сообщений.\nrecievers: список получателей. К примеру: ['...', '...', ...]\ntitle: заголовок письма.\nbody: остальной текст письма.\nservice: сервис, к примеру `smtp.mail.ru`.\nservice_port: порт SMTP-сервера, к примеру, 465."""
480
+ if self.username_mail and self.mail_passwd:
481
+ for email in recievers:
482
+ from email.mime.multipart import MIMEMultipart
483
+ from email.mime.text import MIMEText
484
+ import smtplib
485
+ message = MIMEMultipart()
486
+ message["From"] = self.username_mail
487
+ message["To"] = email
488
+ message["Subject"] = title
489
+
490
+ message.attach(MIMEText(body, "plain", 'utf-8'))
491
+
492
+ with smtplib.SMTP_SSL(service, service_port) as server:
493
+ server.login(self.username_mail, password=self.mail_passwd)
494
+ server.sendmail(self.username_mail, email, message.as_string())
495
+ else:
496
+ return "Укажите параметр username_mail и mail_passwd в настройках класса."
497
+ def alarm_clock(self, time_to_ring: str, sound):
498
+ """Будильник на Python. Весело, не правда-ли?)\ntime_to_ring: время срабатывания будильника в формате ЧЧ:ММ:СС. К примеру, `16:45:43`.\nsound: директория к файлу со звуком для будильника, либо буфероподобные объекты. open(), io.BytesIO() и другие."""
499
+ from os import environ
500
+ environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
501
+ from pygame import mixer
502
+ import time
503
+ from colorama import Fore
504
+
483
505
  mixer.init()
484
- do = mixer.Sound('notes/do.wav')
485
- re = mixer.Sound('notes/re.wav')
486
- mi = mixer.Sound('notes/mi.wav')
487
- fa = mixer.Sound('notes/fa.wav')
488
- sol = mixer.Sound('notes/sol.wav')
489
- lja = mixer.Sound('notes/lja.wav')
490
- si = mixer.Sound('notes/si.wav')
491
-
492
- keymap = {
493
- 'q':do,
494
- 'w':re,
495
- 'e':mi,
496
- 'r':fa,
497
- "t":sol,
498
- 'y':lja,
499
- "u":si
500
- }
501
506
 
502
- for key, note in keymap.items():
503
- keyboard.add_hotkey(key, note.play)
507
+ alarm_time = time.strptime(time_to_ring, "%H:%M:%S")
508
+ hour = alarm_time.tm_hour
509
+ minutes = alarm_time.tm_min
510
+ seconds = alarm_time.tm_sec
511
+ data = {'hour':hour, 'minutes':minutes, 'seconds':seconds}
512
+ print(f'{Fore.GREEN}Будильник успешно запущен на {Fore.BLUE}{time_to_ring}.')
504
513
  while True:
505
- pass
514
+ # Получаем текущее время
515
+ current_time = time.localtime()
516
+ hour_ = current_time.tm_hour
517
+ minutes_ = current_time.tm_min
518
+ seconds_ = current_time.tm_sec
519
+
520
+ # Проверяем, наступило ли время будильника
521
+ if {'hour':hour_, 'minutes':minutes_, 'seconds':seconds_} == data:
522
+ print(f'{Fore.RED}ВНИМАНИЕ!!! БУДИЛЬНИК АКТИВИРОВАН, ПРОСЫПАЙТЕСЬ!!!')
523
+ mixer.Sound(sound).play(loops=-1)
524
+ else:
525
+ pass
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 1.2
2
+ Name: florestbotfunctions
3
+ Version: 1.2.2
4
+ Summary: Функции бота Флореста в одной библиотеке.
5
+ Home-page: UNKNOWN
6
+ Author: florestdev
7
+ Author-email: florestone4185@internet.ru
8
+ License: UNKNOWN
9
+ Project-URL: Social Resources, https://taplink.cc/florestone4185
10
+ Project-URL: My bot, https://t.me/postbotflorestbot
11
+ Description: Привет! Данная библиотека включает в себя функции из https://t.me/postbotflorestbot. Все функции, с удобным объяснением кода, только здесь. P.S. Это официальная библиотека от создателя бота - FlorestDev. Все функции предоставляются в ознакомительном порядке.
12
+ Platform: UNKNOWN
13
+ Requires-Python: >=3.8.9
@@ -11,3 +11,4 @@ faker
11
11
  bs4
12
12
  SpeechRecognition
13
13
  pygame
14
+ colorama
@@ -1,3 +1,3 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- setup(name='florestbotfunctions', version='1.2.0', description='Функции бота Флореста в одной библиотеке.', long_description='Привет! Данная библиотека включает в себя функции из https://t.me/postbotflorestbot. Все функции, с удобным объяснением кода, только здесь. P.S. Это официальная библиотека от создателя бота - FlorestDev. Все функции предоставляются в ознакомительном порядке.', author='florestdev', author_email='florestone4185@internet.ru', packages=find_packages(), python_requires='>=3.8.9', project_urls={"Social Resources": 'https://taplink.cc/florestone4185', 'My bot':"https://t.me/postbotflorestbot"}, install_requires=["MukeshAPI", 'requests', 'g4f', 'curl_cffi', 'pytubefix', 'pillow', 'qrcode', 'gtts', 'google-api-python-client', 'faker', 'bs4', 'SpeechRecognition', 'pygame'])
3
+ setup(name='florestbotfunctions', version='1.2.2', description='Функции бота Флореста в одной библиотеке.', long_description='Привет! Данная библиотека включает в себя функции из https://t.me/postbotflorestbot. Все функции, с удобным объяснением кода, только здесь. P.S. Это официальная библиотека от создателя бота - FlorestDev. Все функции предоставляются в ознакомительном порядке.', author='florestdev', author_email='florestone4185@internet.ru', packages=find_packages(), python_requires='>=3.8.9', project_urls={"Social Resources": 'https://taplink.cc/florestone4185', 'My bot':"https://t.me/postbotflorestbot"}, install_requires=["MukeshAPI", 'requests', 'g4f', 'curl_cffi', 'pytubefix', 'pillow', 'qrcode', 'gtts', 'google-api-python-client', 'faker', 'bs4', 'SpeechRecognition', 'pygame', 'colorama'])
@@ -1,24 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: florestbotfunctions
3
- Version: 1.2.0
4
- Summary: Функции бота Флореста в одной библиотеке.
5
- Author: florestdev
6
- Author-email: florestone4185@internet.ru
7
- Project-URL: Social Resources, https://taplink.cc/florestone4185
8
- Project-URL: My bot, https://t.me/postbotflorestbot
9
- Requires-Python: >=3.8.9
10
- Requires-Dist: MukeshAPI
11
- Requires-Dist: requests
12
- Requires-Dist: g4f
13
- Requires-Dist: curl_cffi
14
- Requires-Dist: pytubefix
15
- Requires-Dist: pillow
16
- Requires-Dist: qrcode
17
- Requires-Dist: gtts
18
- Requires-Dist: google-api-python-client
19
- Requires-Dist: faker
20
- Requires-Dist: bs4
21
- Requires-Dist: SpeechRecognition
22
- Requires-Dist: pygame
23
-
24
- Привет! Данная библиотека включает в себя функции из https://t.me/postbotflorestbot. Все функции, с удобным объяснением кода, только здесь. P.S. Это официальная библиотека от создателя бота - FlorestDev. Все функции предоставляются в ознакомительном порядке.
@@ -1,24 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: florestbotfunctions
3
- Version: 1.2.0
4
- Summary: Функции бота Флореста в одной библиотеке.
5
- Author: florestdev
6
- Author-email: florestone4185@internet.ru
7
- Project-URL: Social Resources, https://taplink.cc/florestone4185
8
- Project-URL: My bot, https://t.me/postbotflorestbot
9
- Requires-Python: >=3.8.9
10
- Requires-Dist: MukeshAPI
11
- Requires-Dist: requests
12
- Requires-Dist: g4f
13
- Requires-Dist: curl_cffi
14
- Requires-Dist: pytubefix
15
- Requires-Dist: pillow
16
- Requires-Dist: qrcode
17
- Requires-Dist: gtts
18
- Requires-Dist: google-api-python-client
19
- Requires-Dist: faker
20
- Requires-Dist: bs4
21
- Requires-Dist: SpeechRecognition
22
- Requires-Dist: pygame
23
-
24
- Привет! Данная библиотека включает в себя функции из https://t.me/postbotflorestbot. Все функции, с удобным объяснением кода, только здесь. P.S. Это официальная библиотека от создателя бота - FlorestDev. Все функции предоставляются в ознакомительном порядке.