Skip to content
Prompt

dingo — Cursor Rules

by MigoXLab

AI Summary

A Cursor-integrated coding standard guide for the Dingo SDK that enforces PEP 8 conventions, type hints, and proper lazy-import patterns for optional dependencies. Developers building with or contributing to Dingo benefit from consistent, maintainable Python code patterns.

Install

# Install Cursor rule to .cursor/rules/
mkdir -p .cursor/rules
&& curl --retry 3 --retry-delay 2 --retry-all-errors -o .cursor/rules/python-conventions.mdc "https://raw.githubusercontent.com/MigoXLab/dingo/main/.cursor/rules/python-conventions.mdc"

Run in your IDE terminal (bash). On Windows, use Git Bash, WSL, or your IDE's built-in terminal. If curl fails with an SSL error, your network may block raw.githubusercontent.com — try using a VPN or download the files directly from the source repo.

Description

Python coding conventions for the Dingo SDK

Code Style

• Follow PEP 8 (enforced by pre-commit hooks) • Use type hints for function signatures • Use @classmethod for evaluator eval() methods • Prefer getattr(obj, 'field', default) over direct attribute access for optional Data fields

Import Rules

• Core deps (numpy, pydantic, requests, etc.): top-level imports OK • Optional deps (pyarrow, transformers, boto3, sqlalchemy, cv2, fasttext, etc.): must use lazy imports inside methods with clear ImportError messages: `python

Correct — lazy import with helpful error

def load_data(self): try: import pyarrow.parquet as pq except ImportError: raise ImportError("pyarrow is required for Parquet support. Install: pip install dingo-python[parquet]")

Wrong — top-level import of optional dep

import pyarrow.parquet as pq `

Quality Score

B

Good

85/100

Standard Compliance82
Documentation Quality75
Usefulness78
Maintenance Signal100
Community Signal100
Scored Yesterday

GitHub Signals

Stars658
Forks67
Issues7
Updated2d ago
View on GitHub

Trust & Transparency

Open Source — Apache-2.0

Source code publicly auditable

Verified Open Source

Hosted on GitHub — publicly auditable

Actively Maintained

Last commit 2d ago

658 stars — Growing Community

67 forks

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Cursor