Один из самых удобных способов записать данные это использование готовых форматов, такие как JSON или YAML.
Из плюсов такого подхода стоит отметить вот что:
🔸 готовый, повсеместно используемый и поддерживаемый формат
🔸 простой и понятный файл, удобочитаемый для человека
🔸 можно легко редактировать в любом текстовом редакторе без специальных программ и библиотек
Но есть и минусы
🔹 затраты времени при записи файла (кодирование данных в нужный формат строки)
🔹 затраты времени при чтении файла (декодирование данных в Python объекты)
🔹 размер файла увеличивается из-за разметки данных (скобки, запятые, переносы, отступы...)
🔹 перед записью все данные должны быть помещены в память в полном объёме (не всегда)
🔹 при чтении необходимо считать весь файл в память и только потом декодировать данные
Если нужно писать немного данных в несколько файлов, то затраты по времени не ощутимы. Обычно это файлы конфига или какие-либо метаданные. Это отличный вариант под такие задачи.
Есть и другой поход к записи файлов - это бинарные файлы. Используется, когда данных достаточно много и никто их не собирается читать глазками😳.
🔸 очень быстрая запись
🔸 чтение значительно быстрей чем JSON, YAML итд
🔸 размер файла значительно меньше, так как нет разметки
🔸 можно записывать данные по мере поступления не загружая всё в память
🔸 можно извлечь любую часть данных независимо
Из минусов
🔹 нужно определить свой формат записи данных (если не используете готовую спецификацию определённого формата)
🔹 не получится открыть файл и визуально понять что там записано, а для чтения файла потребуется знать его спецификацию.
🔹 не так-то просто создать такой файл без специальной библиотеки
В таком виде удобно записывать большой массив любых однородных данных. Например, мониторинг валютной биржи или кэшированная анимация 3D геометрии.
(Это не означает что нельзя записать данные разного типа, просто это будет не так удобно)
Представьте себе JPG-картинку. По сути это немного мета-информации и большой массив пикселей. Тоже самое со звуком или видео файлом. Поэтому, если вы попробуете открыть картинку в текстовом редакторе вы увидите что-то вроде такого
f15d cd29 a564 4578 ...
09e2 9bc4 a696 1253 ...
84e9 4de1 3b23 c24a ...
2534 5161 28e0 709d ...
...
Это и есть записанные байтики. И для их чтения требуется определённый софт который знает что с ними делать. Под каждый тип файла.
К чему это я? Читайте в следующем посте...
#tricks#basic
#LassaFever is highly infectious.
Protect your food and protect your family.
➡️Store food in covered containers and keep it away from rats at all times.
Good hygiene is your first line of defense against #LassaFever.
Stay safe. Stay informed.
#LassaFever#NCDCNigeria
Lassa Fever Update – Week 28, 2025
🗓 7th–13th July
📍11 new confirmed cases in Ondo, Edo & Benue
📊 Total for 2025:
✅ 811 confirmed cases
✅ 152 deaths
✅ CFR: 18.7% (↑ vs 17.3% same time in 2024)
🔹 89% of cases from Ondo, Bauchi, Edo, Taraba & Ebonyi
🔗https://ncdc.gov.ng/themes/common/files/sitreps/953e057e6d9e1773395f58004c1fdc65.pdf
#LassaFever#NCDCNigeria
⚠️ Early detection and reporting of #LassaFever can save lives! ⚠️
Symptoms to watch for:
🩸 Fever & weakness
🤒 Headache & sore throat
🦠 Vomiting & difficulty in breathing
🚨 Bleeding from the gums, nose, or other body parts in severe cases
Keep your environment clean, store food properly in a covered container, and visit the nearest health facility if you noticed any of these symptoms!
#LassaFever#NCDCNigeria
#HealthTipMonday:Start small, Stay Healthy!
Healthy living begins with the little things we do every day. When practiced consistently, small habits can make a big difference in our overall wellbeing.
☑️Eat a balanced diet rich in fruits, vegetables, vitamins, and minerals
☑️Stay hydrated by drinking enough safe water daily
☑️Get 7–8 hours of quality sleep each night
☑️Exercise regularly to improve circulation and overall health
☑️Practice good hygiene, including regular handwashing under clean running water and surface cleaning
☑️Manage stress through relaxation techniques such as deep breathing or meditation.
Healthy habits today, a healthier future tomorrow!
#HealthTipMonday#NCDCNigeria
#HealthTipMonday
Your health matters every single day.
🌿Nourish your body, stay active, rest well, manage stress, and keep a positive mindset.
✅Simple daily habits can make a big difference to your overall wellbeing.
#HealthTipMonday#NCDCNigeria
In Week 14 of 2026, Nigeria recorded 167 new #LassaFever suspected cases, along with 22 new confirmed cases and 3 new confirmed deaths. Additionally, 8 states and 14 LGAs were affected.
These figures highlight the need for continued vigilance, early detection, and strict preventive measures.
🔗 Read the full Situation Report:
Week 14: https://ncdc.gov.ng/themes/common/files/sitreps/17cfcdddda3a2ff22088487a8e4b3c20.pdf
Protect yourself and prevent Lassa fever by:
✅ Keeping your environment clean and free of rodents
✅ Storing food in tightly covered containers
✅ Disposing of waste properly and keeping homes clutter-free
✅ Visiting the nearest health facility immediately when you notice symptoms such as fever, weakness, headache, or bleeding.
#LassaFever#StaySafe#NCDCNigeria
In Week 10 of 2026, Nigeria recorded sustained #LassaFever activity, according to the Nigeria Centre for Disease Control and Prevention.
A Total 317 new suspected cases were reported, along with 40 new confirmed cases and 7 new confirmed deaths. Additionally, 8 states and 22 LGAs were affected.
These figures highlight the need for continued vigilance, early detection, and strict preventive measures.
🔗 Read the full Situation Report:
Week 10: https://ncdc.gov.ng/themes/common/files/sitreps/04217c6d966b18e819ad033ea7cf5134.pdf
Protect yourself and prevent Lassa fever by:
✅ Keeping your environment clean and free of rodents
✅ Storing food in tightly covered containers
✅ Disposing of waste properly and keeping homes clutter-free
✅ Seeking medical care early when you notice symptoms such as fever, weakness, headache, or bleeding.
#LassaFever#StaySafe#NCDCNigeria
In Week 9 of 2026, Nigeria recorded sustained #LassaFever activity, according to the Nigeria Centre for Disease Control and Prevention.
A Total 460 new suspected cases were reported, along with 65 new confirmed cases and 9 new confirmed deaths. Additionally, 7 states and 26 LGAs were affected.
These figures highlight the need for continued vigilance, early detection, and strict preventive measures.
🔗 Read the full Situation Report:
Week 9: https://ncdc.gov.ng/themes/common/files/sitreps/dd3c0ead24ab75983d665aa1a82da8cd.pdf
Protect yourself and prevent Lassa fever by:
✅ Keeping your environment clean and free of rodents
✅ Storing food in tightly covered containers
✅ Disposing of waste properly and keeping homes clutter-free
✅ Seeking medical care early when you notice symptoms such as fever, weakness, headache, or bleeding.
#LassaFever#StaySafe#NCDCNigeria
In Weeks 4 and 5 of 2026, Nigeria recorded sustained #LassaFever activity.
In Week 4, there were 189 new suspected cases and 28 new confirmed cases, with 7 new deaths reported. A total of 594 suspected cases, 121 confirmed cases, and 25 deaths had been recorded.
In Week 5, 160 new suspected cases were reported, along with 44 new confirmed cases and 6 new deaths.
These figures highlight the importance of continued vigilance and preventive actions.
🔗 Read the full sitrep:
Week 4: https://ncdc.gov.ng/themes/common/files/sitreps/209b83e6b6cc29b8353e30e34394d8a5.pdf
Week 5: https://ncdc.gov.ng/themes/common/files/sitreps/e94a04b902c47c21d467d1e6a0f833d1.pdf
Protect yourself and prevent Lassa fever by:
✅ Keeping your environment clean and free of rodents
✅ Storing food in tightly covered containers
✅ Disposing of waste properly and keeping homes clutter-free
✅ Seeking medical care early when you notice symptoms such as fever, weakness, headache, or bleeding.
#LassaFever#StaySafe#NCDCNigeria”
In the first three weeks of 2026, Nigeria recorded a rise in #Lassafever activity.
In Week 1, there were 104 suspected cases and 21 confirmed cases, with 9 deaths reported.
In Week 2, confirmed cases increased to 33, while the number of suspected cases for the week increased to 144.
In Week 3, 157 new suspected cases were reported, along with 39 new confirmed cases and 6 new deaths.
This figures highlights the importance of continued vigilance and preventive actions .
🔗 Read the full sitrep:
Week 1: https://ncdc.gov.ng/themes/common/files/sitreps/09e281a5e335ce56f3efe782318ca0ea.pdf
Week 2: https://ncdc.gov.ng/themes/common/files/sitreps/08187c401459ff0ca43206cda1c28004.pdf
Week 3: https://ncdc.gov.ng/themes/common/files/sitreps/6a2487657377bd1d55e70377a214c725.pdf
Protect Yourself and prevent Lassa fever by:
✅ Keeping your environment clean and free of rodents
✅ Storing food in tightly covered containers
✅ Disposing of waste properly and keeping homes clutter-free
✅ Seeking medical care early when you notice symptoms such as fever, weakness, or bleeding.
#LassaFever#StaySafe#NCDCNigeria
Last week, across several parts of Nigeria, health facilities continued routine surveillance for Lassa fever as people went about their end-of-year festivities and daily routines.
Between 15th - 21st December 2025, 21 new cases were confirmed across multiple states, with 5 reported deaths.
While weekly figures may change, they remind us that Lassa fever remains present and that early presentation at health facilities significantly improves outcomes.
Preventive actions remain key:
🏡 Keep homes and surroundings clean.
🥘 Store food properly.
🧼 Wash hands regularly with soap under veal running water.
💊 Avoid self-medication
🏥 Seek medical care early.
Full sitrep: https://ncdc.gov.ng/themes/common/files/sitreps/070ffa8b11f8e6170bb61854b22b06cb.pdf
#LassaFever#NCDCNigeria#StaySafe