@botsgram_cu · Post #3295 · 16.12.2020 г., 12:09
@SangMataInfo_bot Qué puede hacer este bot? Reenviar cualquier mensaje a este chat para ver el historial del usuario. Idioma: Inglés (visto en @BotsGram_cu) #user, #chat, #group
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #397 · 12 ное.
Использование Pydantic сегодня стало нормой, и это правильно. Но иногда на ревью вижу, что используют его не всегда корректно. Например, метод BaseModel.model_dump() по умолчанию не преобразует стандартные типы, такие как datetime, UUID или Decimal, в простой сериализуемый для JSON вид. Тогда пишут кастмоный сериализатор для этих типов чтобы функция json.dump() не падала с ошибкой. import uuid from datetime import datetime from decimal import Decimal from uuid import UUID from pydantic import BaseModel class MyModel(BaseModel): id: UUID date: datetime value: Decimal obj = MyModel( id=uuid.uuid4(), date=datetime.now(), value='1.23' ) print(obj.model_dump()) # не подходит для json.dump # { # 'id': UUID('4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1'), # 'date': datetime.datetime(2025, 12, 12, 12, 12, 12, 111111), # 'value': Decimal('1.23') # } # добавляем свой кастомный сериализатор json.dumps(obj.model_dump(), cls=MySerializer) # { # 'id': '4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1', # 'date': '2025-12-12T12:12:12.111111', # 'value': '1.23' # } В данном случае класс MySerializer обрабатывает datetime, UUID и Decimal. Например так: class MySerializer(json.JSONEncoder): def default(self, o): if isinstance(o, Decimal): return str(o) elif isinstance(o, datetime): return o.isoformat() elif isinstance(o, UUID): return str(o) return super().default(o) Специально для тех, кто всё еще так делает - в этом нет необходимости! Pydantic может это сделать сам, просто нужно добавить параметр mode="json". json.dumps(obj.model_dump(mode="json")) # { # 'id': '4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1', # 'date': '2012-12-12T12:12:12.111111', # 'value': '1.23' # } #pydantic#libs
Пребарај: #user
@botsgram_cu · Post #3295 · 16.12.2020 г., 12:09
@SangMataInfo_bot Qué puede hacer este bot? Reenviar cualquier mensaje a este chat para ver el historial del usuario. Idioma: Inglés (visto en @BotsGram_cu) #user, #chat, #group
@OnePlus13Series · Post #346 · 13.11.2025 г., 15:51
SunOS Project | Android 16 | Oneplus 13 ✍️ Details: - Version: bienor - Codename: #dodge - Type: #user#gapps - Released: 29/09/25 🔽 Download : ROM [ Gdrive | Mirror | SF ] // Images 🆘 Support group: Here ✨ Changelogs: Here 🌳 Source: Here | DT | sm8750 📸Screenshots: Here 💰 Donate: Here (Server) 🔖 Tags : #SunOS#AOSP#ROM#Official#A16#QPR0 ⚙️Installation: 🚨 Firmware is not included with this rom. Please flash fw on both slots to avoid potential issues ➡️ CMDs: fastboot flash init_boot init_boot.img fastboot flash boot boot.img fastboot flash recovery recovery.img fastboot flash vendor_boot vendor_boot.img fastboot -w fastboot reboot recovery ➡️Recovery: • Factory reset (wipe/format data) • ADB sideload the rom zip & Reboot 📔Note: - Clean flash is mandatory coming from SunOS A15 and make sure remove google accounts and lockscreen password to avoid frp lock - ESIM support is dropped 👤 Developer: @Chandu_078 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom
@botsgram_cu · Post #3365 · 06.01.2021 г., 12:13
@gdprbot Qué puede hacer este bot? El bot GDPR oficial de Telegram. Idioma: Inglés (visto en @BotsGram_cu) #data, #privacy, #telegram, #user, #download, #request, #claim
@repo_science · Post #3180 · 12.05.2023 г., 19:53
#webScraping#Python#Scrapy 🐍 Scrapy course - Python web scraping for beginners The Scrapy #Beginners Course will teach you everything you need to learn to start scraping websites at scale using #Python Scrapy. Topics - Creating your first #Scrapy spider - #Crawling through websites & scraping data from each page - Cleaning data with Items & Item Pipelines - Saving data to CSV files, #MySQL & #Postgres#databases - Using fake #user-agents & headers to avoid getting blocked - Using #proxies to scale up your web scraping without getting banned - Deploying your #scraper to the cloud & scheduling it to run periodically 🗣️ Joe Kearney. 🔗Link 📢#youtube ⭐️ Resources ⭐️ Course Resources - Scrapy Docs - Course Guide - Course Github - The Python Scrapy Playbook ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----
@botsgram_cu · Post #3290 · 15.12.2020 г., 11:47
@RulesRulesBot Qué puede hacer este bot? Este bot saludará a los nuevos miembros con un mensaje de bienvenida, y también puede especificar un texto de reglas. Idioma: Inglés (visto en @BotsGram_cu) #rules, #welcome, #start, #group, #member, #new, #join, #enter, #message, #user