Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
🎙We're hosting a first live Q&A on spaces in a couple of days!
It’s set for next Monday at 6 ET. Set your reminders and reply here with your questions 👉🏽https://x.com/venanalysis/status/1791586519398171078?s=46&t=XS9Dg5c2R2mjKeBd5qmeTQ
#VAPodcast
Join us for our upcoming Q&A Space on X!
An open forum for discussing VA Podcast Episode 24, 'Building Socialism to Resist Sanctions.'
It's happening next Thursday, May 16th. 🔔 Click here to set a reminder 👉🏽https://twitter.com/i/spaces/1YqKDgnodVNxV
#VAPodcast#Sanctions
🎙 A special episode of the Venezuelanalysis Podcast is now available!
VA members José Luis Granados Ceja and Andreína Chávez Alava discuss soft power, cultural imperialism and corporate media propaganda ahead of Venezuela's presidential elections.
Click here to listen to the full episode 👉🏼shorturl.at/FkBrG
#presidentialelections2024#vapodcast
🎙 Episode 26 of the Venezuelanalysis Podcast is here!
Host José Luis Granados Ceja is joined by editor Ricardo Vaz to break down the electoral aftermath in Venezuela, covering renewed U.S. sanctions, Edmundo González's exile, aircraft piracy, and more.
After a brief hiatus, we’re back with a new format—featuring VA staff more prominently and, for the first time, available on video!
Click here to listen and watch the full episode 👉🏼https://shorturl.at/ivof8
#vapodcast#presidentialelections2024#sanctions
🎙New podcast episode just dropped!
In our latest podcast episode, we tackle cultural production, its importance and challenges in the context of the Bolivarian Process. Host José Luis Granados Ceja is joined by activist and culture worker Luigino Bracci Roa and by fellow VA member Andreína Chávez Alava to discuss everything from state policies to imperialist propaganda.
Click here to listen to the full episode 👉🏼https://shorturl.at/hrCHN
#culture#vapodcast
🔈PODCAST | Venezuela After January 3: A New Stage of US Imperialism
The VA Podcast is back. In our Season 3 premiere, we tackle the fallout of the January 3rd military escalation against Caracas, an event that marks a volatile new chapter in the long history of US intervention in the region.
Join Venezuelanalysis Chief Editor Ricardo Vaz, Associate Editor Lucas Koerner, and VA Founder Greg Wilpert as they break down the geopolitical shift from "maximum pressure" to direct confrontation. This episode goes beyond the headlines to analyze the underlying causes and the global consequences of Washington’s renewed focus on "its" hemisphere.
Follow the link for early access to this episode: https://www.patreon.com/venanalysis
#USVenezuelaRelations#USmilitaryattack#VAPodcast
🎙🔊Season 3 of the Venezuelanalysis Podcast is coming soon!!!
The new season takes stock of a shifting political moment marked by escalating US aggression and its global impact, alongside major developments inside Venezuela: from the January 3 US military strikes to international solidarity efforts, as well as broader economic reforms and debates over sovereignty and national control of resources.
Each month, we will bring independent, on-the-ground reporting and analysis of Venezuela and the Bolivarian Process, alongside coverage of grassroots movements.
🎧 Subscribe to the Venezuelanalysis Podcast on YouTube, Spotify, Apple Podcasts, or your preferred platform.
#podcast#VAPodcast#USVenezuelaRelations
🎙 Episode 25 of the Venezuelanalysis Podcast is now available!
Venezuela’s revolutionary leader Hugo Chávez defined the commune as the “unit cell” for the construction of socialism. But the road ahead is full of challenges, even more so in a context of imperialist sanctions.
In this episode, host José Luis Granados Ceja is joined by fellow VA member Cira Pascual Marquina and by Communard Union communications coordinator Juan Lenzo to discuss the present struggle to strengthen the communal economy and uphold the socialist horizon.
Click here to listen to the full episode 👉🏼https://shorturl.at/gf26s
#communardunion#communes#vapodcast
🎙 Last VA Podcast of 2024 is live!
In our yearly review, the Venezuelanaysis editorial team examines Venezuela's economic challenges, grassroots efforts, and the aftermath of the 2024 presidential election. We also discuss what 2025 might bring for the country and the Bolivarian Process.
Watch now 👉🏼https://youtu.be/p3gzIhkykuc
#VAPodcast#2024Recap
A crowdfunded mercenary plot? 🤔
Venezuelanalysis members José Luis Granados Ceja and Ricardo Vaz have a little fun at the expense of a crowdfunding initiative for a coup led by mercenary poster boy Erik Prince.
Watch the full podcast episode here 👉🏼youtu.be/hD4Ds9Xc1ho
#vapodcast#sanctions#imperialism#citgo
🎙🔊 Episode 43 of the VA Podcast is live!
The Venezuelanalysis Podcast is back. In our new season premiere, we tackle the fallout of the January 3rd military escalation against Caracas, an event that marks a volatile new chapter in the long history of US intervention in the region.
Join Venezuelanalysis Lead Editor Ricardo Vaz, Associate Editor Lucas Koerner, and VA Founder Greg Wilpert as they break down the geopolitical shift from "maximum pressure" to direct confrontation. This episode goes beyond the headlines to analyze the underlying causes and the global consequences of Washington’s renewed focus on "its" hemisphere.
Watch the full episode here 👉https://youtu.be/NKuCNIxn2MA
#Venezuela#USImperialism#usvenezuelarelations#USmilitaryattack#VAPodcast
🔈PODCAST | International Solidarity in the Belly of the Beast [EARLY ACCESS]
What does meaningful international solidarity with Venezuela look like from inside the US empire?
In Episode 45 of the Venezuelanalysis podcast, Ricardo Vaz speaks with Austin Cole of the Black Alliance for Peace and Michela Martinazzi of Brooklyn Against War and the International League of Peoples’ Struggle about organizing against imperialism from “the belly of the beast.”
The conversation looks at escalating attacks abroad, repression at home, the challenges facing solidarity movements, and how to build broad coalitions without falling into the bipartisan trap.
Get early access to the episode and support independent anti-imperialist journalism 👉🏽patreon.com/c/venanalysis
#InternationalSolidarity#AntiImperialism#Podcast#VAPodcast