Comprehensive guide to data architecture, regulatory integrations, and analytical integration with Python PyArrow and DuckDB.
INCIDB unifies high-precision chemical composition data across four core tables:
position_index).Every ingredient profile is normalized from public regulatory and open-data sources:
69-72-7 Salicylic Acid).All database releases pass rigorous 1-to-1 physical parity and string sanitization audits:
\r) and linebreaks (\n) inside string fields to guarantee exact line count correspondence (wc -l exactly equals record counts).Load high-performance Parquet datasets directly into memory for filtering allergens and functional categories:
import pyarrow.parquet as pq
import pandas as pd
# Load formulations and canonical ingredients
products = pq.read_table('products.parquet').to_pandas()
ingredients = pq.read_table('ingredients.parquet').to_pandas()
# Filter FDA MoCRA contact allergens
allergens = ingredients[ingredients['is_common_allergen'] == 1]
print(f"Flagged {len(allergens)} MoCRA contact allergens across {len(products):,} formulations.")
Execute analytical joins directly over flat Parquet files without database servers:
import duckdb
query = """
SELECT
b.name AS brand,
p.name AS product,
COUNT(pi.ingredient_id) AS total_ingredients,
SUM(i.is_common_allergen) AS mocra_allergens
FROM 'products.parquet' p
JOIN 'brands.parquet' b ON p.brand_id = b.brand_id
JOIN 'product_ingredients.parquet' pi ON p.product_id = pi.product_id
JOIN 'ingredients.parquet' i ON pi.ingredient_id = i.ingredient_id
GROUP BY b.name, p.name
HAVING SUM(i.is_common_allergen) > 0
ORDER BY mocra_allergens DESC
LIMIT 5;
"""
print(duckdb.query(query).to_df())