Python · Read a JSON file
A practical placeholder for a common data task.
import json
with open("data.json", encoding="utf-8") as file:
data = json.load(file)
print(data)
Snippet shelf
Browse a collection of frequently used snippets. Choose a language, then copy a pattern directly to your clipboard.
6 languages
Select a language to view its starter snippet.
A practical placeholder for a common data task.
import json
with open("data.json", encoding="utf-8") as file:
data = json.load(file)
print(data)
A placeholder for a quick data exploration workflow.
library(dplyr)
summary <- data_frame |>
group_by(category) |>
summarise(total = sum(value, na.rm = TRUE))
print(summary)
A placeholder for the everyday commit flow.
git status
git add .
git commit -m "Describe the change"
git push origin main
A placeholder for a semantic content component.
<article class="card">
<h2>Card title</h2>
<p>A short description goes here.</p>
<a href="/details">Read more</a>
</article>
A placeholder for a flexible layout.
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
gap: 1rem;
}
A placeholder for a safe API request.
async function getJson<T>(url: string): Promise<T> {
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
return response.json() as Promise<T>;
}