
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
A data transformation library for flattening complex nested structures into tabular formats while preserving hierarchical relationships
Transform nested data into flat tables with a simple, intuitive API.
Transmog transforms nested JSON data into flat, tabular formats while preserving relationships between parent and child records.
Key Features:
pip install transmog
import transmog as tm
# Transform nested data into flat tables
result = tm.flatten({"name": "Product", "specs": {"cpu": "i7", "ram": "16GB"}})
print(result.main) # Flattened data: [{'name': 'Product', 'specs_cpu': 'i7', ...}]
# Save in any format
result.save("output.json")
Transform complex nested data into relational tables:
data = {
"user": {"name": "Alice", "email": "alice@example.com"},
"orders": [
{"id": 101, "amount": 99.99},
{"id": 102, "amount": 45.50}
]
}
result = tm.flatten(data, name="customer")
# Main table: [{'user_name': 'Alice', 'user_email': 'alice@...', '_id': '...'}]
# Orders table: [{'id': 101, 'amount': 99.99, '_parent_id': '...'}, ...]
Key Options:
separator="."
id_field="customer_id"
errors="skip"
tm.flatten_file("data.json")
For more control:
result = tm.flatten(
data,
name="products",
# Naming
separator=".", # Use dots: user.name
nested_threshold=3, # Simplify deeply nested names
# IDs
id_field="sku", # Use existing field as ID
parent_id_field="_parent", # Customize parent reference name
add_timestamp=True, # Add timestamp to records
# Arrays
arrays="inline", # Keep arrays as JSON instead of separate tables
# Data handling
preserve_types=True, # Keep original types (don't convert to strings)
skip_null=False, # Include null values
skip_empty=False, # Include empty strings/lists
# Performance
batch_size=5000, # Process in larger batches
low_memory=True, # Optimize for low memory usage
)
Complete documentation is available at scottdraper8.github.io/transmog, including:
For contribution guidelines, development setup, and coding standards, see the Contributing Guide in the documentation.
MIT License
FAQs
A data transformation library for flattening complex nested structures into tabular formats while preserving hierarchical relationships
We found that transmog demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.