Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
Explainer from #Addis_Standard Newsroom:
As of 24 February, Addis Standard has not received any formal written notice, legally mandated opportunity to respond, or reasoned decision preceding the #Ethiopian Media Authority’s public claim, made via social media, that our online media registration was revoked.
Ethiopian media law is clear: suspension or revocation of a media license must follow a defined process, including written notice, a 14-working-day right of response, a reasoned decision, and access to appeal before the Authority’s Board of Directors.
None of these mandatory steps have been observed. Addis Standard remains fully operational and continues its public-interest journalism in good faith, while its publisher, #JAKENN Publishing PLC, pursues clarification and rectification through lawful channels. This matter goes beyond one newsroom, it concerns whether media regulation in Ethiopia is governed by law, due process, and institutional accountability.
Read the explainer: https://addisstandard.com/?p=55392
News: Publisher challenges #EMA’s revocation of Addis Standard registration, cites due process violations
#JAKENN Publishing P.L.C., the publisher of #Addis_Standard, has formally contested the decision by the #Ethiopian Media Authority (EMA) to revoke the outlet’s online media registration certificate, arguing that the move lacks legal basis and violates due process guarantees under Ethiopian law.
The response follows an announcement circulated on the Authority’s official social media channels on 24 February 2026, stating that Addis Standard’s registration had been revoked.
In a letter addressed to the EMA Board of Directors, JAKENN said a legal review found the announcement “exceeds the Authority’s procedural powers” and is incompatible with safeguards provided under Media Proclamation No. 1238/2021, as amended by Proclamation No. 1374/2025.
The publisher stressed that Addis Standard is operated by JAKENN Publishing P.L.C., a legally registered private....
Read more: https://addisstandard.com/?p=55387
News: #Ethiopian Media Authority revokes Addis Standard’s online media registration; Editor-in-Chief disputes claims
The Ethiopian Media Authority (#EMA) has announced the revocation of the online media registration certificate of #Addis_Standard, effective 24 February 2026, citing repeated violations of media ethics, national laws, and what it described as the country’s national interests.
The statement did not specify which reports or actions formed the basis of the decision.
Responding to the EMA’s announcement, Yonas Kedir, Editor-in-Chief of Addis Standard publications, rejected the Authority’s claims, saying the outlet had never received any formal notices of violations.
“The claim that Addis Standard received repeated notices is factually incorrect. At no point has the Ethiopian Media Authority formally notified Addis Standard newsroom of any prior violations or enforcement actions,” he said. He added that the publisher, #JAKENN Publishing PLC, ..…
Read more: https://addisstandard.com/?p=55383
News: #CPJ calls for release of #Addis_Standard editor seized by unidentified men
The Committee to Protect Journalists has called on #Ethiopian authorities to urgently locate and release #Million_Beyene, who was taken by unidentified individuals from the newsroom of Addis Standard in the capital.
In a statement issued on April 16, CPJ said Million was seized on Wednesday morning by a group of men in plainclothes from the outlet’s newsroom in #Addis_Abeba and taken to an undisclosed location.
#JAKENN Publishing PLC, publisher of Addis Standard, says the whereabouts of its Managing Editor, Million Beyene, remain unknown nearly 24 hours after he was taken by unidentified individuals from the newsroom.
In an update issued this morning, the publisher said concerns are growing over his safety, noting that his family is “increasingly distressed and deeply concerned.”
CPJ described the incident as alarming and urged authorities to determine those responsible
Read more: https://addisstandard.com/?p=56534