Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
US Treasury yields surge to new highs as liquidity tightens, pushing
Make CryptoSlate preferred on
Bitcoin’s latest retreat below $80,000 shows how quickly the bond market has reclaimed control of crypto trading, even after lawmakers advanced one of the industry’s most closely watched regulatory bills.
Data from CryptoSlate showed that the top asset was trading at $79,083 as of press time, down…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─
Trump family trust bought Coinbase and these crypto-related stocks in
Make CryptoSlate preferred on
US President Donald Trump’s family trust executed hundreds of millions of dollars in financial transactions during the first quarter of 2026, including the acquisition of stocks directly tied to the digital asset industry, even as his administration pushed sweeping, pro-cryptocurrency regulatory overhauls.
According to a mandatory 278-T financial disclosure form…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─
Bitcoin rips as CLARITY Act clears major Senate Committee hurdle,
Make CryptoSlate preferred on
Bitcoin surged back above $81,000 after the Senate Banking Committee voted to advance the Digital Asset Market CLARITY Act, clearing a major hurdle for the most comprehensive crypto regulation bill in US history.
On May 14, the panel approved the legislation on bipartisan lines, sending the legislation to the…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─
Ripple insider warns XRP holders as fake airdrop scams surge across
Make CryptoSlate preferred on
The XRP Ledger (XRPL) is seeing a drastic rise in fraud attempts targeting its users as the network draws more institutional activity, higher transaction volumes, and renewed attention from XRP traders.
On May 14, David Schwartz, the former chief technology officer at Ripple, published a public warning regarding the increasing…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─
Bitcoin keeps rallying mid-month – Is Saylor using Strategy’s STRC
Make CryptoSlate preferred on
Bitcoin has been seeing recurring mid-month strength this year, and it is becoming harder to separate it from Strategy’s (formerly MicroStrategy) expanding preferred-stock machine. The funding channel is helping the company continue to buy the flagship digital asset while adding a growing layer of cost to its balance sheet.…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─
Global financial crisis fears grow as bond yields hit 1998 levels and
Make CryptoSlate preferred on
Is a global 2008-style economic crash nigh? And do current conditions resemble the early stages of a broader global financial crisis driven by debt costs, inflation pressure, and constrained policy responses?
Those questions have become harder to dismiss because the pressure points are stacking in the wrong order: high sovereign…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─
Trump’s CEO-filled China visit can decide whether Bitcoin’s $80,000
Make CryptoSlate preferred on
Bitcoin is hovering just below $80,000 as President Donald Trump arrives in Beijing for a high-stakes meeting with Chinese leader Xi Jinping, turning the visit into a live test of whether the crypto market’s latest risk rally has enough support to survive a difficult macro week.
The trip comes…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─
Trump’s CEO-filled China visit can decide whether Bitcoin’s $80,000
Make CryptoSlate preferred on
Bitcoin is hovering just below $80,000 as President Donald Trump arrives in Beijing for a high-stakes meeting with Chinese leader Xi Jinping, turning the visit into a live test of whether the crypto market’s latest risk rally has enough support to survive a difficult macro week.
The trip comes…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─
Bitcoin holders can now hide more of their activity, but only by
Make CryptoSlate preferred on
Starknet launched strkBTC on May 12, locking BTC on Bitcoin‘s base layer to back an ERC-20 token that brings shielded balances into a smart contract environment at scale.
The token runs in the public mode, where it behaves like any other wrapped Bitcoin asset, and shielded mode, where…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─
Hormuz oil contagion spreads to 8 major economies and Bitcoin has just
Make CryptoSlate preferred on
Bitcoin‘s path through 2026 now runs through global economic policy.
The disruption around the Strait of Hormuz has moved beyond a commodity-price event and into the machinery of governments.
The International energy Agency said crude and refined-product exports through the strait had fallen to less than 10%…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─
Circle adds $3 billion Wall Street Arc token risking an uncomfortable
Make CryptoSlate preferred on
Circle’s $222 million ARC token presale has given Wall Street a new way to value the USDC issuer, while raising a harder question for one of crypto’s most profitable alliances.
On May 11, Circle said investors led by a16z Crypto backed the presale of ARC, the native token for Arc,…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─
Washington insider warns US defeat in Iran now “likely”
Make CryptoSlate preferred on
A prominent figure from the Washington foreign-policy establishment has said openly what markets have been pricing in fragments: the United States has likely suffered a strategic defeat in Iran, and the failure runs through the Strait of Hormuz. Accepting this premise would introduce a new macro risk for…
#CryptoMining
─┅━━━━━⊰✵⊱━━━━━┅─
│📣 : @bovinebear │
│🤖 : @bovinebear_bot│
─┅━━━━━⊰✵⊱━━━━━┅─