[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EF6AX0K2BK03S9K3R1F284":3,"skill-same:01M6EF6AX0K2BK03S9K3R1F284":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":30,"linkOnly":31,"markdownContent":32,"markdownBody":32,"frontMatter":33,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":37,"repositoryHtmlUrl":38,"repositoryHomepageUrl":39,"ownerHtmlUrl":40,"ownerBlogUrl":7,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M6EF6AX0K2BK03S9K3R1F284","ibis","Ibis 数据分析框架",null,"","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fibis\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQGD4CMBM6B4PWSM1NXGT9","数据分析与报告","SCENARIO","使用场景",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQGD5CX980XNXCJKQF70BY","数据分析师","PROFESSION","适用职业",[5],"2026-11-10 10:12:30",false,"# Ibis — Portable Python Analytics\n\n\n## Overview\n\n\nIbis, the Python dataframe library that provides a pandas-like API but generates SQL for execution on any backend — DuckDB, PostgreSQL, BigQuery, Snowflake, Spark, and more. Helps developers write analytics code once and run it anywhere without rewriting SQL for each database.\n\n\n## Instructions\n\n### Basic Usage\n\n```python\n# src\u002Fanalytics.py — Portable analytics with Ibis\nimport ibis\nfrom ibis import _                         # Shorthand for column references\n\n# Connect to a backend (DuckDB for local development)\ncon = ibis.duckdb.connect(\"analytics.duckdb\")\n\n# Or connect to production databases — same code, different backend\n# con = ibis.postgres.connect(url=\"postgresql:\u002F\u002F...\")\n# con = ibis.bigquery.connect(project_id=\"my-project\")\n# con = ibis.snowflake.connect(...)\n\n# Load data\norders = con.table(\"orders\")\n\n# Build a query — this is lazy (no execution until you call .execute())\nmonthly_revenue = (\n    orders\n    .filter(_.status == \"completed\")\n    .filter(_.created_at >= \"2026-01-01\")\n    .group_by(month=_.created_at.truncate(\"M\"))\n    .agg(\n        revenue=_.amount.sum(),\n        order_count=_.count(),\n        unique_customers=_.customer_id.nunique(),\n        avg_order_value=_.amount.mean(),\n    )\n    .order_by(_.month)\n)\n\n# Execute and get a pandas DataFrame\ndf = monthly_revenue.execute()\nprint(df)\n\n# Or see the generated SQL\nprint(ibis.to_sql(monthly_revenue))\n```\n\n### Complex Transformations\n\n```python\n# Window functions, joins, and case expressions\nimport ibis\nfrom ibis import _\n\ncon = ibis.duckdb.connect(\"analytics.duckdb\")\norders = con.table(\"orders\")\ncustomers = con.table(\"customers\")\n\n# Window functions — running totals and rankings\nranked = (\n    orders\n    .filter(_.status == \"completed\")\n    .group_by(_.customer_id)\n    .agg(\n        total_spent=_.amount.sum(),\n        order_count=_.count(),\n        first_order=_.created_at.min(),\n        last_order=_.created_at.max(),\n    )\n    .mutate(\n        # Rank customers by revenue\n        revenue_rank=ibis.rank().over(\n            order_by=ibis.desc(_.total_spent)\n        ),\n        # Percentile\n        revenue_percentile=ibis.percent_rank().over(\n            order_by=_.total_spent\n        ),\n        # Customer segment based on spending\n        segment=ibis.case()\n            .when(_.total_spent >= 1000, \"whale\")\n            .when(_.total_spent >= 100, \"regular\")\n            .else_(\"casual\")\n            .end(),\n    )\n)\n\n# Joins\ncustomer_analytics = (\n    ranked\n    .join(customers, _.customer_id == customers.id)\n    .select(\n        _.customer_id,\n        customers.name,\n        customers.email,\n        customers.plan,\n        _.total_spent,\n        _.order_count,\n        _.segment,\n        _.revenue_rank,\n        # Days since last order\n        days_inactive=(ibis.now() - _.last_order).cast(\"int32\") \u002F\u002F 86400,\n    )\n)\n\n# Cohort analysis\ncohorts = (\n    orders\n    .filter(_.status == \"completed\")\n    .group_by(_.customer_id)\n    .mutate(\n        cohort_month=_.created_at.min().truncate(\"M\"),\n    )\n    .mutate(\n        months_since=((_.created_at.truncate(\"M\") - _.cohort_month)\n                      .cast(\"int32\") \u002F\u002F (30 * 86400)),\n    )\n    .group_by(_.cohort_month, _.months_since)\n    .agg(\n        active_users=_.customer_id.nunique(),\n        revenue=_.amount.sum(),\n    )\n)\n```\n\n### Backend Portability\n\n```python\n# The same analytics code runs on any backend\nimport ibis\n\ndef build_revenue_report(con: ibis.BaseBackend):\n    \"\"\"Build a revenue report — works on any Ibis backend.\n\n    Args:\n        con: Any Ibis connection (DuckDB, Postgres, BigQuery, etc.)\n    \"\"\"\n    orders = con.table(\"orders\")\n\n    return (\n        orders\n        .filter(_.status == \"completed\")\n        .group_by(\n            month=_.created_at.truncate(\"M\"),\n            category=_.category,\n        )\n        .agg(\n            revenue=_.amount.sum(),\n            orders=_.count(),\n        )\n        .order_by(_.month.desc())\n    )\n\n# Development: DuckDB on local Parquet files\ndev_con = ibis.duckdb.connect()\ndev_con.read_parquet(\"data\u002Forders.parquet\", table_name=\"orders\")\nreport = build_revenue_report(dev_con).execute()\n\n# Production: BigQuery\nprod_con = ibis.bigquery.connect(project_id=\"prod-project\", dataset_id=\"analytics\")\nreport = build_revenue_report(prod_con).execute()\n\n# Testing: in-memory with DuckDB\ntest_con = ibis.duckdb.connect()\ntest_con.create_table(\"orders\", test_data_df)\nreport = build_revenue_report(test_con).execute()\n```\n\n### UDFs and Custom Functions\n\n```python\n# Custom scalar and aggregate functions\nimport ibis\nfrom ibis import udf\n\n@udf.scalar.python\ndef normalize_email(email: str) -> str:\n    \"\"\"Normalize email addresses for deduplication.\"\"\"\n    local, domain = email.lower().split(\"@\")\n    # Remove dots and plus aliases from Gmail\n    if domain in (\"gmail.com\", \"googlemail.com\"):\n        local = local.split(\"+\")[0].replace(\".\", \"\")\n    return f\"{local}@{domain}\"\n\n# Use in queries\ncustomers = con.table(\"customers\")\ndeduped = (\n    customers\n    .mutate(clean_email=normalize_email(_.email))\n    .group_by(_.clean_email)\n    .agg(\n        count=_.count(),\n        first_seen=_.created_at.min(),\n    )\n    .filter(_.count > 1)\n)\n```\n\n## Installation\n\n```bash\n# Core library\npip install ibis-framework\n\n# With specific backends\npip install \"ibis-framework[duckdb]\"\npip install \"ibis-framework[postgres]\"\npip install \"ibis-framework[bigquery]\"\npip install \"ibis-framework[snowflake]\"\npip install \"ibis-framework[pyspark]\"\n\n# Interactive mode (for notebooks)\nibis.options.interactive = True   # Auto-execute and display results\n```\n\n\n## Examples\n\n\n### Example 1: Migrating a pandas pipeline to run on BigQuery\n\n**User request:**\n\n```\nI have a pandas script that calculates cohort retention from our events table. Rewrite it using Ibis so it runs on BigQuery instead of loading everything into memory.\n```\n\nThe agent rewrites the pandas code using Ibis expressions (`ibis.bigquery.connect()`, `t.group_by()`, `_.mutate()`, window functions with `ibis.cumulative_window()`), keeping the same logic but generating SQL that executes on BigQuery. The script goes from loading 50M rows into memory to pushing all computation to the warehouse.\n\n### Example 2: Building a portable analytics module with DuckDB for dev\n\n**User request:**\n\n```\nWrite an analytics module that computes daily active users and revenue per plan from Parquet files locally, but can switch to Snowflake in production.\n```\n\nThe agent creates a module using `ibis.duckdb.connect()` for local development with Parquet files, writes composable Ibis expressions for DAU (`t.select('user_id', 'event_date').distinct().group_by('event_date').count()`) and revenue by plan, and adds a `get_connection()` function that switches to `ibis.snowflake.connect()` based on an environment variable — same analytics code, different backend.\n\n\n## Guidelines\n\n1. **Write once, run anywhere** — Define analytics logic with Ibis; swap backends by changing the connection, not the code\n2. **Lazy by default** — Ibis expressions are lazy; they only execute when you call `.execute()` or `.to_pandas()`\n3. **DuckDB for development** — Use DuckDB locally with Parquet files; switch to BigQuery\u002FSnowflake for production\n4. **Use `_` for readability** — `from ibis import _` gives you clean column references: `_.amount.sum()` vs `orders.amount.sum()`\n5. **Generate SQL for debugging** — Use `ibis.to_sql(expr)` to see the SQL being generated; helps debug unexpected results\n6. **Functions for reuse** — Wrap analytics logic in functions that take a connection; test with DuckDB, deploy on any backend\n7. **Interactive mode in notebooks** — Set `ibis.options.interactive = True` for immediate result display during exploration\n8. **Type your schemas** — Use `ibis.schema()` to define expected table schemas; catch type mismatches early\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fibis",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":9,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill ibis",{"tool":49,"command":50},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill ibis",{"tool":52,"command":53},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill ibis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fibis\u002FSKILL.md",true,[57,63,67,71,75,79],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"generate-trail.md","REFERENCE","参考文档",1992,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.qoder\u002Fskills\u002Fbmad-checkpoint-preview\u002Fgenerate-trail.md",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"step-01-orientation.md",5004,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.qoder\u002Fskills\u002Fbmad-checkpoint-preview\u002Fstep-01-orientation.md",{"path":68,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":69,"sourceHtmlUrl":70},"step-02-walkthrough.md",4172,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.qoder\u002Fskills\u002Fbmad-checkpoint-preview\u002Fstep-02-walkthrough.md",{"path":72,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":73,"sourceHtmlUrl":74},"step-03-detail-pass.md",4990,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.qoder\u002Fskills\u002Fbmad-checkpoint-preview\u002Fstep-03-detail-pass.md",{"path":76,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":77,"sourceHtmlUrl":78},"step-04-testing.md",2698,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.qoder\u002Fskills\u002Fbmad-checkpoint-preview\u002Fstep-04-testing.md",{"path":80,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":81,"sourceHtmlUrl":82},"step-05-wrapup.md",1277,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.qoder\u002Fskills\u002Fbmad-checkpoint-preview\u002Fstep-05-wrapup.md",[84,93,102,111,117,123],{"skillNo":85,"name":86,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":30},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[90,91,92],"model","model hierarchy","model hierarchy skill",{"skillNo":94,"name":95,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":30},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[99,100,101],"MCP","zoom","zoom mcp",{"skillNo":103,"name":104,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":30},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[108,109,110,100],"sdk","zoom apps sdk","apps",{"skillNo":112,"name":113,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":30},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[113],{"skillNo":118,"name":119,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":30},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[119],{"skillNo":124,"name":125,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":30},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[125]]