TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Резултати

Пронајдени 3 слични објави

Пребарај: #deeptech

当前筛选 #deeptech清除筛选
UzVC

@UzVC_uz · Post #115 · 15.04.2026 г., 09:52

✍️✍️✍️UzVC начинает работу по поддержке стартап-проектов в фармацевтической сфере 📌 13 апреля в целях развития инновационных стартап-проектов в сфере фармацевтики состоялась встреча руководителя Национального венчурного фонда UzVC Дилшода Хашимова и директора Агентства по развитию фармацевтической отрасли Абдуллы Азизова. ✅ В ходе встречи были подробно обсуждены вопросы поддержки перспективных стартапов в отрасли, их финансового и институционального развития, а также внедрения инновационных решений на практике. ✅ В частности, стороны договорились о сотрудничестве по поддержке стартап-проектов в направлении DeepTech, коммерциализации научных разработок, а также развитию инициатив, основанных на высоких технологиях. ✅ По итогам встречи стороны выразили готовность наладить взаимовыгодное сотрудничество и реализовывать совместные инициативы в данном направлении. ———— ✍️✍️✍️UzVC farmatsevtika sohasidagi startap loyihalarni qo‘llab-quvvatlash bo‘yicha faoliyatni boshlamoqda 📌 13 aprel kuni farmatsevtika sohasida innovatsion startap loyihalarni rivojlantirish maqsadida, UzVC Milliy venchur fondi rahbari Dilshod Xashimov hamda Farmatsevtika tarmog‘ini rivojlantirish agentligi direktori Abdulla Azizov bilan uchrashuv bo‘lib o‘tdi. ✅ Uchrashuv davomida sohada istiqbolli startaplarni qo‘llab-quvvatlash, ularni moliyaviy va institutsional jihatdan rivojlantirish, shuningdek innovatsion yechimlarni amaliyotga joriy etish masalalari atroflicha muhokama qilindi. ✅ Xususan, DeepTech yo‘nalishidagi startap loyihalarni qo‘llab-quvvatlash, ilmiy ishlanmalarni tijoratlashtirish hamda yuqori texnologiyalarga asoslangan tashabbuslarni rivojlantirish bo‘yicha hamkorlik qilishga kelishib olindi. ✅ Uchrashuv yakunida tomonlar o‘zaro manfaatli hamkorlikni yo‘lga qo‘yish va mazkur yo‘nalishda qo‘shma tashabbuslarni amalga oshirishga tayyor ekanliklarini bildirdilar. ———— ✍️✍️✍️UzVC begins supporting startups in the pharmaceutical sector 📌 On April 13, to foster the development of innovative startup projects in the pharmaceutical sector, a meeting was held between Dilshod Khashimov, Head of the UzVC National Venture Fund, and Abdulla Azizov, Director of the Pharmaceutical Industry Development Agency. ✅ During the meeting, the parties held detailed discussions on supporting promising startups in the sector, promoting their financial and institutional development, and introducing innovative solutions into practice. ✅ In particular, the parties agreed to cooperate in supporting startup projects in the DeepTech field, commercializing scientific developments, and advancing initiatives based on high technologies. ✅ At the conclusion of the meeting, the parties expressed their readiness to establish mutually beneficial cooperation and implement joint initiatives in this area. 🌐Website |📷Instagram |🌐LinkedIn #UzVC#PharmacySupport#DeepTech

IELTS|Newspapers & Magazines|English

@emagzinewspars · Post #9561 · 17.11.2025 г., 03:17

#The_Science🇺🇸📕[PDF]⬇️ 13 #November2025 #Weekly_Magazines For learning, for free(dom). @backupofmagazines This issue dives into breakthroughs reshaping biology and energy as researchers confront rising geopolitical limits. From #AI-driven epigenetics to #SyntheticBiology advances, the issue tracks how innovation pushes ahead despite tensions over China-US research ties. New micro-robots navigating the bloodstream and faster-charging batteries highlight a surge in #DeepTech momentum. Climate resilience, #PandemicPreparedness, and EU chemical reforms underscore global policy stakes. Studies on dog domestication, brown dwarfs, and marine recovery after extinction broaden the scientific lens. A reminder that #ScienceMatters even as politics shift—innovation continues to define our shared future. #TechNews#GlobalTrends#ResearchUpdates

Venture Village Wall 🦄

@venturevillagewall · Post #3893 · 16.01.2025 г., 13:00

Major Funding Rounds Announced in January Multiple startups have secured significant funding in January 2025: - Sygnum raises $58M. - Amogy nets $56M for its ammonia-based energy solution aimed at decarbonizing transportation by 2050. - Nelly achieves $52.57M to streamline digital documentation. - Bioptimus raises $41M for an AI foundation model in biology. - Orchid Security collects $36M to enhance application security. - Cresicor secures $30M for trade promotion management. - Hinge Bio raises $30M for antibody innovation. - SeeQC gets $30M for a digital quantum computing platform. - NatureMetrics raises $25M for biodiversity monitoring. - Vertical Compute nets $20.6M for data-intensive workload processing. Full details can be found on their respective websites. #Funding#Investment#Startup#Amogy#AI#Bioptimus#QuantumComputing#Sygnum#Security#NatureMetrics#Biodiversity#Technology#Transport#DigitalSignatures#Decarbonization#Semiconductors#DeepTech#Ecosystem#VC#Crypto