#json

18 snippets tagged with #json

typescriptbeginner

Read and Write JSON Files

Read, parse, modify, and write JSON files with proper error handling using Node.js fs module.

Best for: Configuration file management

#nodejs#json
typescriptadvanced

JSON Stream Parser

Parses large JSON arrays from a readable stream without loading the entire file into memory.

Best for: Processing large log files

#streaming#json
sqlintermediate

JSON Aggregation and Querying

Aggregate related rows into JSON arrays and query JSONB columns with PostgreSQL native JSON operators.

Best for: API response building

#json#jsonb
sqlintermediate

Query JSON Columns in SQL

Extract and filter data stored in JSON columns using SQL JSON functions.

Best for: Querying semi-structured data

#sql#json
sqladvanced

JSON - Technique 12

Work with JSON data

Best for: database operations

#sql#database
pythonintermediate

Structured Logging with structlog

Configure structlog for JSON-formatted structured logging with request context, timestamps, and log levels.

Best for: Application logging

#logging#structlog
typescriptintermediate

OpenAI Structured Output with Zod

Force GPT-4o to return valid JSON matching a Zod schema using response_format structured output.

Best for: data extraction

#openai#zod
pythonintermediate

OpenAI Structured Output with Pydantic

Force GPT to return validated JSON matching a Pydantic schema.

Best for: Review analysis

#ai#openai
pythonintermediate

Nested JSON Flattening in Python

Flatten deeply nested JSON structures into flat dictionaries suitable for DataFrames or CSV export.

Best for: Converting API responses to flat tables

#json#flattening
pythonbeginner

Flatten Nested JSON with pandas

Use pd.json_normalize to flatten deeply nested API responses into a flat DataFrame.

Best for: API response flattening

#pandas#json
pythonbeginner

Fast JSON Serialisation with orjson

Use orjson for 5-10x faster JSON serialisation of large Python dicts, dataclasses, and NumPy arrays.

Best for: high-throughput serialisation

#orjson#json
pythonbeginner

DataFrame to Dict Records

Convert DataFrames to lists of dicts for API responses, JSON export, or further processing.

Best for: API serialization

#pandas#records
pythonbeginner

Expand JSON Column into DataFrame Columns

Parse a JSON-string column and expand its keys into separate columns in one step.

Best for: JSON column expansion

#pandas#json
javaintermediate

Jackson — JSON Serialization and Parsing

Parse and generate JSON with Jackson: ObjectMapper, annotations, custom serializers, and streaming.

Best for: REST API request and response serialization

#java#json
javaintermediate

JSON Serialization Without Libraries

Serialize and deserialize Java objects to JSON manually with a lightweight builder-based approach.

Best for: Lightweight JSON generation without Jackson/Gson

#java#json
kotlinintermediate

Kotlinx Serialization — JSON Parsing

Serialize and deserialize JSON with kotlinx.serialization: data classes, custom serializers, and polymorphism.

Best for: API response parsing and generation

#kotlin#serialization
scalaintermediate

JSON Parsing with Circe

Parse and generate JSON with Circe: codecs, custom encoders/decoders, and optics.

Best for: REST API JSON handling

#scala#json
scalaintermediate

Advanced JSON with Circe

Handle complex JSON with Circe: custom codecs, optics, cursor navigation, and error handling.

Best for: API response parsing

#scala#circe