{
  "id": "task_libraries:database/python",
  "path": "/exapedia/python-database-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python database libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python database libraries map database tables to Python classes, an approach called object-relational mapping (ORM), and build SQL from Python code. These libraries let web backends read and write table rows as Python objects instead of hand-written SQL."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python database libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#sqlalchemy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F128"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F129"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#django",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#peewee",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F162"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sqlmodel",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F178"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pony-orm",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F197"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#piccolo",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F213"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#tortoise-orm",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F230"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ormar",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F246"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#sqlalchemy",
          "label": [
            {
              "t": "text",
              "text": "SQLAlchemy"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F129"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Awaitable ORM queries",
            "Schema migration tools"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#sqlalchemy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F128"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F136"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#django",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#peewee",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F162"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sqlmodel",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F178"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pony-orm",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F197"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#piccolo",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F213"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#tortoise-orm",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F230"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ormar",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F246"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F257"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "sqlalchemy",
          "name": [
            {
              "t": "fact",
              "fact": "F128"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/sqlalchemy/sqlalchemy"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/SQLAlchemy"
            },
            {
              "label": "Docs",
              "href": "https://docs.sqlalchemy.org"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "SQLAlchemy is a SQL toolkit and object-relational mapper in two layers. Core is a SQL expression language with schema metadata, connection pooling, and type handling, usable on its own. The ORM is built on Core and synchronizes mapped Python objects with the current transaction through a "
            },
            {
              "t": "code",
              "text": "Session"
            },
            {
              "t": "text",
              "text": ". Queries written with the ORM reach joins, subqueries, and other SQL features through the object model, and eager loading fetches related objects with joins or one query per collection. Async code uses the same API through "
            },
            {
              "t": "code",
              "text": "AsyncSession"
            },
            {
              "t": "text",
              "text": "."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F129"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.sqlalchemy.org",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F128"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F142"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/fastapi/sqlmodel",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F141"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def get_column_from_field(field: Any) -> Column:\n    field_info = field\n    sa_column = _get_sqlmodel_field_value(field_info, \"sa_column\", Undefined)\n    if isinstance(sa_column, Column):\n        return sa_column\n    sa_type = get_sqlalchemy_type(field)\n    primary_key = _get_sqlmodel_field_value(field_info, \"primary_key\", Undefined)\n    if primary_key is Undefined:\n        primary_key = False\n    index = _get_sqlmodel_field_value(field_info, \"index\", Undefined)\n    if index is Undefined:\n        index = False\n    nullable = not primary_key and is_field_noneable(field)\n    # Override derived nullability if the nullable property is set explicitly\n    # on the field\n    field_nullable = _get_sqlmodel_field_value(field_info, \"nullable\", Undefined)\n    if field_nullable is not Undefined:\n        assert not isinstance(field_nullable, UndefinedType)\n        nullable = field_nullable\n    args = []\n    foreign_key = _get_sqlmodel_field_value(field_info, \"foreign_key\", Undefined)\n    if foreign_key is Undefined:\n        foreign_key = None\n    unique = _get_sqlmodel_field_value(field_info, \"unique\", Undefined)\n    if unique is Undefined:\n        unique = False\n    if foreign_key:\n        ondelete_value = _get_sqlmodel_field_value(field_info, \"ondelete\", Undefined)\n        if ondelete_value is Undefined:\n            ondelete_value = None\n        if ondelete_value == \"SET NULL\" and not nullable:\n            raise RuntimeError('ondelete=\"SET NULL\" requires nullable=True')\n        assert isinstance(foreign_key, str)\n        assert isinstance(ondelete_value, (str, type(None)))  # for typing\n        args.append(ForeignKey(foreign_key, ondelete=ondelete_value))\n    kwargs: dict[str, Any] = {\n        \"primary_key\": primary_key,\n        \"nullable\": nullable,\n        \"index\": index,\n        \"unique\": unique,\n    }\n    sa_default = Undefined\n    if field_info.default_factory:\n        sa_default = field_info.default_factory\n    elif field_info.default is not Undefined:\n        sa_default = field_info.default\n    if sa_default is not Undefined:\n        kwargs[\"default\"] = sa_default\n    sa_column_args = _get_sqlmodel_field_value(field_info, \"sa_column_args\", Undefined)\n    if sa_column_args is not Undefined:\n        args.extend(list(cast(Sequence[Any], sa_column_args)))\n    sa_column_kwargs = _get_sqlmodel_field_value(\n        field_info, \"sa_column_kwargs\", Undefined\n    )\n    if sa_column_kwargs is not Undefined:\n        kwargs.update(cast(dict[Any, Any], sa_column_kwargs))\n    return Column(*args, type_=sa_type, **kwargs)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/fastapi/sqlmodel/blob/f56eb44235e9102c0a192c96fa14c1f960f52bb2/sqlmodel/main.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F140"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20SQLAlchemy%20for%20filtered%20event%20responses%2C%20schema%20initialization%20and%20retrieval%20of%20entities%20after%20raw%20searches&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F128"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from sqlalchemy import create_engine, String\nfrom sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, Session\n\nclass Base(DeclarativeBase):\n    pass\nclass Item(Base):\n    __tablename__ = 'items'\n    id: Mapped[int] = mapped_column(primary_key=True)\n    name: Mapped[str] = mapped_column(String())\n\nengine = create_engine('sqlite:///:memory:')\nBase.metadata.create_all(engine)\nwith Session(engine) as session:\n    session.add(Item(name='Hello'))\n    session.commit()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.sqlalchemy.org/en/21/orm/quickstart.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "async_orm.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F133"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "django",
          "name": [
            {
              "t": "fact",
              "fact": "F143"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/django/django"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/Django"
            },
            {
              "label": "Docs",
              "href": "https://docs.djangoproject.com/"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "Django ORM is the database layer of the Django web framework. Each model is a class that subclasses "
            },
            {
              "t": "code",
              "text": "django.db.models.Model"
            },
            {
              "t": "text",
              "text": ", each attribute maps to a column, and Django generates a database access API from the model. The ORM writes SQL tailored to the database backend named in the project settings. The "
            },
            {
              "t": "code",
              "text": "makemigrations"
            },
            {
              "t": "text",
              "text": " command records model changes as migration files, and "
            },
            {
              "t": "code",
              "text": "migrate"
            },
            {
              "t": "text",
              "text": " applies them. The ORM also provides asynchronous query methods, while transactions in async code run inside a synchronous function called through "
            },
            {
              "t": "code",
              "text": "sync_to_async"
            },
            {
              "t": "text",
              "text": "."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.djangoproject.com/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F143"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F272"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F273"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F274"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F275"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/django-oscar/django-oscar",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F160"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def create_line_discount_models(self, order, order_line, basket_line):\n    for discount in basket_line.discounts:\n        if not discount.offer:\n            continue\n        order_discount = order.discounts.filter(offer_id=discount.offer.id).first()\n        # If we are unable to find the discount we do not care, the total amount is still saved on the discount model,\n        # these models are only created so we know how much discount was given per line for each offer\n        if order_discount:\n            order_line.discounts.create(\n                order_discount=order_discount,\n                is_incl_tax=discount.incl_tax,\n                amount=discount.amount,\n            )",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/django-oscar/django-oscar/blob/a5ed3c9c17d4cf6ee18aa9795b493172416ab68b/src/oscar/apps/order/utils.py#L258-L270",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F159"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Django%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F143"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import django\nfrom django.conf import settings\n\nsettings.configure(INSTALLED_APPS=[], DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}})\ndjango.setup()\nfrom django.db import connection, models\n\nclass Item(models.Model):\n    name = models.CharField(max_length=100)\n    class Meta:\n        app_label = 'example'\n\nwith connection.schema_editor() as editor:\n    editor.create_model(Item)\nitem = Item.objects.create(name='Hello')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.djangoproject.com/en/6.1/topics/settings/",
                  "label": [
                    {
                      "t": "text",
                      "text": "settings/"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F148"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "peewee",
          "name": [
            {
              "t": "fact",
              "fact": "F162"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/coleifer/peewee"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/peewee"
            },
            {
              "label": "Docs",
              "href": "https://docs.peewee-orm.com/"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "Peewee is a small ORM in a single module with no required dependencies. SQLite works through the standard library, and extras such as "
            },
            {
              "t": "code",
              "text": "peewee[postgres]"
            },
            {
              "t": "text",
              "text": " and "
            },
            {
              "t": "code",
              "text": "peewee[mysql]"
            },
            {
              "t": "text",
              "text": " install drivers for other databases, including async drivers. Models subclass "
            },
            {
              "t": "code",
              "text": "Model"
            },
            {
              "t": "text",
              "text": " and point at a database such as "
            },
            {
              "t": "code",
              "text": "SqliteDatabase"
            },
            {
              "t": "text",
              "text": ", and a query builder exposes joins and other SQL features. The "
            },
            {
              "t": "code",
              "text": "pwmigrate"
            },
            {
              "t": "text",
              "text": " command generates schema migrations from a diff of the models."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.peewee-orm.com/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F162"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F34"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F35"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F36"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F37"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/blakeblackshear/frigate",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F176"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@router.get(\n    \"/event_ids\",\n    response_model=list[EventResponse],\n    dependencies=[Depends(allow_any_authenticated())],\n    summary=\"Get events by ids\",\n    description=\"\"\"Gets events by a list of ids.\n    Returns a list of events.\n    \"\"\",\n)\nasync def event_ids(ids: str, request: Request):\n    ids = ids.split(\",\")\n\n    if not ids:\n        return JSONResponse(\n            content=({\"success\": False, \"message\": \"Valid list of ids must be sent\"}),\n            status_code=400,\n        )\n\n    try:\n        events = list(Event.select().where(Event.id << ids).dicts().iterator())\n    except Exception:\n        return JSONResponse(\n            content=({\"success\": False, \"message\": \"Events not found\"}), status_code=400\n        )\n\n    for event in events:\n        await require_camera_access(event[\"camera\"], request=request)\n\n    return JSONResponse(events)\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/blakeblackshear/frigate/blob/ec5f6d4f7fcfb3e9ab45ec63026cf0cf0dc1a7db/frigate/api/event.py#L490-L518",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F175"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20peewee%20for%20filtered%20event%20responses%2C%20schema%20initialization%20and%20retrieval%20of%20entities%20after%20raw%20searches&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F162"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from peewee import Model, SqliteDatabase, TextField\n\ndb = SqliteDatabase(':memory:')\nclass Item(Model):\n    name = TextField()\n    class Meta:\n        database = db\n\nItem.create_table()\nitem = Item.create(name='Hello')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.peewee-orm.com/en/latest/peewee/querying.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "quickstart.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F167"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "sqlmodel",
          "name": [
            {
              "t": "fact",
              "fact": "F178"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/fastapi/sqlmodel"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/sqlmodel"
            },
            {
              "label": "Docs",
              "href": "https://sqlmodel.tiangolo.com"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "SQLModel defines database tables as Python classes with type annotations, built on Pydantic and SQLAlchemy. A class declared with "
            },
            {
              "t": "code",
              "text": "table=True"
            },
            {
              "t": "text",
              "text": " is both a Pydantic model that validates data and a SQLAlchemy table. Queries run through a SQLAlchemy engine and session, and "
            },
            {
              "t": "code",
              "text": "SQLModel.metadata.create_all"
            },
            {
              "t": "text",
              "text": " creates the tables. The same author wrote FastAPI, and SQLModel models work as request and response types in FastAPI routes."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://sqlmodel.tiangolo.com",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F178"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F276"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F277"
                }
              ]
            }
          ],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/fastapi/full-stack-fastapi-template",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F195"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def create_user(*, session: Session, user_create: UserCreate) -> User:\n    db_obj = User.model_validate(\n        user_create, update={\"hashed_password\": get_password_hash(user_create.password)}\n    )\n    session.add(db_obj)\n    session.commit()\n    session.refresh(db_obj)\n    return db_obj",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/fastapi/full-stack-fastapi-template/blob/77e550a73bb49dd2967622c5ed11bf7a49603c93/backend/app/crud.py#L10-L17",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F194"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=sqlmodel%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F178"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from sqlmodel import Field, Session, SQLModel, create_engine\n\nclass Item(SQLModel, table=True):\n    id: int | None = Field(default=None, primary_key=True)\n    name: str\n\nengine = create_engine('sqlite:///:memory:')\nSQLModel.metadata.create_all(engine)\nwith Session(engine) as session:\n    session.add(Item(name='Hello'))\n    session.commit()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://sqlmodel.tiangolo.com/tutorial/create-db-and-table/",
                  "label": [
                    {
                      "t": "text",
                      "text": "create-db-and-table/"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F183"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pony-orm",
          "name": [
            {
              "t": "fact",
              "fact": "F197"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/ponyorm/pony"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pony"
            },
            {
              "label": "Docs",
              "href": "https://docs.ponyorm.org"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "Pony ORM writes database queries as Python generator expressions and lambdas, such as "
            },
            {
              "t": "code",
              "text": "select(p for p in Product if p.name.startswith('A'))"
            },
            {
              "t": "text",
              "text": ". Pony reads the abstract syntax tree of the expression and translates it into SQL for the database dialect in use, with support for SQLite, MySQL, PostgreSQL, and Oracle. Entities are declared as compact classes, and the generated SQL can be printed in a readable, indented form. An online diagram editor generates a schema from an entity relationship diagram."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.ponyorm.org",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F197"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F58"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F59"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F60"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F61"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F62"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F63"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/Tribler/tribler",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F211"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@db_session\ndef query_with_augmenter(self, query: str, augmenter: AugmentedSearch, first: int = 1, last: int = 50,\n                         sort_desc: bool = True, sort_by: str = \"\") -> list[TorrentMetadata]:\n    \"\"\"\n    Use the given augmenter to perform a heavier search for the given query.\n\n    :returns: A Query object that evaluates to a list of TorrentMetadata.\n    \"\"\"\n    limit, offset = max(1, last - first), max(1, first)\n    results = [r[0] for r in self.db.get_connection().execute(*augmenter.augment(query, limit, offset)).fetchall()]\n\n    pony_query = select(g for g in cast(\"TorrentMetadata\", self.TorrentMetadata) if g.rowid in results)\n    return cast(\"list[TorrentMetadata]\", self.apply_sort_by_option(pony_query, sort_by, sort_desc))\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/Tribler/tribler/blob/af0f93e734e5d612dae05a3dc1cca0aa0d3cd8d8/src/tribler/core/database/store.py#L845-L857",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F210"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20pony%20for%20filtered%20event%20responses%2C%20schema%20initialization%20and%20retrieval%20of%20entities%20after%20raw%20searches&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F197"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from pony.orm import Database, Required, db_session\n\ndb = Database()\nclass Item(db.Entity):\n    name = Required(str)\n\ndb.bind(provider='sqlite', filename=':memory:')\ndb.generate_mapping(create_tables=True)\nwith db_session:\n    item = Item(name='Hello')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.ponyorm.org/firststeps.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "firststeps.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F202"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "piccolo",
          "name": [
            {
              "t": "fact",
              "fact": "F213"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/piccolo-orm/piccolo"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/piccolo"
            },
            {
              "label": "Docs",
              "href": "https://piccolo-orm.readthedocs.io/en/latest/index.html"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "Piccolo is an ORM and query builder that supports both synchronous and "
            },
            {
              "t": "code",
              "text": "asyncio"
            },
            {
              "t": "text",
              "text": " code. Tables are classes, and queries either chain methods such as "
            },
            {
              "t": "code",
              "text": "select"
            },
            {
              "t": "text",
              "text": " and "
            },
            {
              "t": "code",
              "text": "where"
            },
            {
              "t": "text",
              "text": " or work on objects through "
            },
            {
              "t": "code",
              "text": "objects"
            },
            {
              "t": "text",
              "text": ", "
            },
            {
              "t": "code",
              "text": "save"
            },
            {
              "t": "text",
              "text": ", and "
            },
            {
              "t": "code",
              "text": "remove"
            },
            {
              "t": "text",
              "text": ". The package includes a User model, authentication, migrations, and a playground for trying queries. The "
            },
            {
              "t": "code",
              "text": "piccolo asgi new"
            },
            {
              "t": "text",
              "text": " command creates a starter web app for frameworks such as Starlette, FastAPI, and Litestar, and Piccolo Admin adds an admin interface on top."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://piccolo-orm.readthedocs.io/en/latest/index.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F213"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F278"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F279"
                }
              ]
            }
          ],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F229"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/piccolo-orm/piccolo_admin",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F228"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def create_schema(persist: bool = False):\n    if not persist:\n        drop_db_tables_sync(*TABLE_CLASSES)\n\n    create_db_tables_sync(*TABLE_CLASSES, if_not_exists=True)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/piccolo-orm/piccolo_admin/blob/d6053adc9f6d2db49cba9bcce97914ac3b2b989a/piccolo_admin/example/tables.py#L324-L328",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F227"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=piccolo%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F213"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from piccolo.table import Table\nfrom piccolo.columns import Varchar\nfrom piccolo.engine.sqlite import SQLiteEngine\n\nclass Item(Table, db=SQLiteEngine(path='example.sqlite')):\n    name = Varchar()\n\nItem.create_table(if_not_exists=True).run_sync()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://raw.githubusercontent.com/piccolo-orm/piccolo/1.39.0/piccolo/table.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "table.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F218"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "tortoise-orm",
          "name": [
            {
              "t": "fact",
              "fact": "F230"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/tortoise/tortoise-orm"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/tortoise-orm"
            },
            {
              "label": "Docs",
              "href": "https://tortoise.github.io"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "Tortoise ORM is an "
            },
            {
              "t": "code",
              "text": "asyncio"
            },
            {
              "t": "text",
              "text": " ORM with a model and query API modeled on Django. Every database call is awaited, and the library supports SQLite, MySQL, PostgreSQL, Microsoft SQL Server, and Oracle through separately installed database clients. Models declare fields and relationships as class attributes. The "
            },
            {
              "t": "code",
              "text": "tortoise"
            },
            {
              "t": "text",
              "text": " command line tool detects model changes, writes migration files with "
            },
            {
              "t": "code",
              "text": "makemigrations"
            },
            {
              "t": "text",
              "text": ", and applies them with "
            },
            {
              "t": "code",
              "text": "migrate"
            },
            {
              "t": "text",
              "text": "."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://tortoise.github.io",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F230"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F84"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F85"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F86"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F87"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F88"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F89"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F90"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F91"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/tortoise/aerich",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F244"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "async def _do_init(self, safe: bool, pre_sql: str | None = None, offline: bool = False) -> bool:\n    \"\"\"Initialize the database for an app.\n\n    Returns True if a new initial migration was generated, or False when existing migration\n    files were found and applied to a fresh database (e.g. a cloned repository).\n    Raises FileExistsError when the database is already initialized.\n    \"\"\"\n    location = self.location\n    app = self.app\n    config = self.tortoise_config\n\n    await Tortoise.init(config=config)\n    connection = get_app_connection(config, app)\n    if offline:\n        await Migrate.init(config, app, location, offline=True)\n    elif pre_sql:\n        await connection.execute_script(pre_sql)\n\n    dirname = Migrate.get_migration_dir(location, app)\n    if not dirname.exists():\n        dirname.mkdir(parents=True)\n    else:\n        existing_version_files = [\n            f for f in dirname.glob(\"*.py\") if \"_\" in f.stem and f.stem.split(\"_\")[0].isdigit()\n        ]\n        if existing_version_files and not offline:\n            # Migration files already exist.  Check whether the database has been\n            # initialised by querying the aerich tracking table.\n            try:\n                already_initialized = await Aerich.exists(app=app)\n            except OperationalError:\n                already_initialized = False\n\n            if already_initialized:\n                raise FileExistsError(str(existing_version_files[0]))\n\n            # Fresh database with existing migration files (e.g. a repo that was cloned).\n            # Apply all migrations in order so the database reaches the current state.\n            Migrate.app = app\n            Migrate.migrate_location = dirname\n            app_conn_name = get_app_connection_name(config, app)\n            for version_module in Migrate.get_all_version_modules():\n                version_file = version_module.name + \".py\"\n                m = import_py_module(version_module)\n                if getattr(m, \"RUN_IN_TRANSACTION\", True):\n                    async with in_transaction(app_conn_name) as conn:\n                        await self._upgrade(conn, version_file, version_module=version_module)\n                else:\n                    await self._upgrade(connection, version_file, version_module=version_module)\n            return False\n\n        # Directory is empty (or offline mode with existing files): raise for any present file.\n        for unexpected_file in dirname.glob(\"*\"):\n            raise FileExistsError(str(unexpected_file))\n\n    schema = get_schema_sql(connection, safe)\n\n    version = await Migrate.generate_version(offline=offline)\n    aerich_content = get_models_describe(app)\n    version_path = Path(dirname, version)\n    content = Migrate.build_migration_file_text(upgrade_sql=schema, models_state=aerich_content)\n    version_path.write_text(content, encoding=\"utf-8\")\n    Migrate._last_version_content = aerich_content\n    if not offline:\n        await generate_schema_for_client(connection, safe)\n        await Aerich.create(version=version, app=app, content=aerich_content)\n    return True",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/tortoise/aerich/blob/a4b8186d77c380b67d443bf3b84732b810b3d2bb/aerich/__init__.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F243"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20tortoise-orm%20for%20filtered%20event%20responses%2C%20schema%20initialization%20and%20retrieval%20of%20entities%20after%20raw%20searches&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F230"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from tortoise import fields, run_async\nfrom tortoise.models import Model\nfrom tortoise.contrib.test import init_memory_sqlite\n\nclass Item(Model):\n    id = fields.IntField(primary_key=True)\n    name = fields.TextField()\n\n@init_memory_sqlite\nasync def main():\n    item = await Item.create(name='Hello')\n    print(item.id)\n\nrun_async(main())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://raw.githubusercontent.com/tortoise/tortoise-orm/1.1.9/tortoise/contrib/test/__init__.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "basic.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F235"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "ormar",
          "name": [
            {
              "t": "fact",
              "fact": "F246"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/ormar-orm/ormar"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/ormar"
            },
            {
              "label": "Docs",
              "href": "https://ormar-orm.github.io/ormar/"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "Ormar is an async ORM for PostgreSQL, MySQL, and SQLite whose models are also Pydantic models. A single class therefore validates data and maps a table, and FastAPI can use it directly as a request and response model. SQLAlchemy Core builds the queries, column types, and connection pool underneath. Async drivers such as "
            },
            {
              "t": "code",
              "text": "asyncpg"
            },
            {
              "t": "text",
              "text": " and "
            },
            {
              "t": "code",
              "text": "aiosqlite"
            },
            {
              "t": "text",
              "text": " run the queries, and schema migrations go through Alembic."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://ormar-orm.github.io/ormar/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F246"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F280"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F281"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F282"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F283"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F262"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F263"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/uriyyo/fastapi-pagination",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F262"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "async def apaginate(\n    query: QuerySet[TModel] | type[TModel],\n    params: AbstractParams | None = None,\n    *,\n    transformer: AsyncItemsTransformer | None = None,\n    additional_data: AdditionalData | None = None,\n    config: Config | None = None,\n) -> Any:\n    if not isinstance(query, QuerySet):\n        query = query.objects\n\n    return await run_async_flow(\n        generic_flow(\n            async_=True,\n            total_flow=flow_expr(lambda: query.count()),\n            limit_offset_flow=flow_expr(lambda raw_params: generic_query_apply_params(query, raw_params).all()),\n            params=params,\n            transformer=transformer,\n            additional_data=additional_data,\n            config=config,\n        )\n    )",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/uriyyo/fastapi-pagination/blob/7bfd38db3d3a8bb79eb9ef7c1f2f13d038a45a91/fastapi_pagination/ext/ormar.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F261"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=ormar%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F246"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import asyncio\nimport ormar\nimport sqlalchemy\n\nmetadata = sqlalchemy.MetaData()\ndatabase = ormar.DatabaseConnection('sqlite+aiosqlite:///example.sqlite')\nclass Item(ormar.Model):\n    ormar_config = ormar.OrmarConfig(tablename='items', database=database, metadata=metadata)\n    id = ormar.Integer(primary_key=True)\n    name = ormar.String(max_length=100)\n\nmetadata.create_all(sqlalchemy.create_engine('sqlite:///example.sqlite'))\nasync def main():\n    async with database:\n        await Item.objects.create(name='Hello')\n\nasyncio.run(main())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://ormar-orm.github.io/ormar/latest/models/migrations/",
                  "label": [
                    {
                      "t": "text",
                      "text": "migrations/"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F251"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python ORM should I use?",
      "a": [
        {
          "t": "link",
          "href": "#sqlalchemy",
          "label": [
            {
              "t": "text",
              "text": "SQLAlchemy"
            }
          ]
        },
        {
          "t": "text",
          "text": " covers both raw SQL expressions and mapped models. "
        },
        {
          "t": "link",
          "href": "#django",
          "label": [
            {
              "t": "text",
              "text": "Django ORM"
            }
          ]
        },
        {
          "t": "text",
          "text": " comes with a Django project, "
        },
        {
          "t": "link",
          "href": "#sqlmodel",
          "label": [
            {
              "t": "text",
              "text": "SQLModel"
            }
          ]
        },
        {
          "t": "text",
          "text": " shares Pydantic models with FastAPI, and "
        },
        {
          "t": "link",
          "href": "#tortoise-orm",
          "label": [
            {
              "t": "text",
              "text": "Tortoise ORM"
            }
          ]
        },
        {
          "t": "text",
          "text": " and "
        },
        {
          "t": "link",
          "href": "#piccolo",
          "label": [
            {
              "t": "text",
              "text": "Piccolo"
            }
          ]
        },
        {
          "t": "text",
          "text": " are written around "
        },
        {
          "t": "code",
          "text": "asyncio"
        },
        {
          "t": "text",
          "text": ". "
        },
        {
          "t": "link",
          "href": "#peewee",
          "label": [
            {
              "t": "text",
              "text": "Peewee"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a single module with no required dependencies."
        }
      ]
    },
    {
      "q": "SQLModel vs SQLAlchemy: which should I use?",
      "a": [
        {
          "t": "text",
          "text": "SQLModel is a thin layer on SQLAlchemy and Pydantic. Each model is both a table and a validated data class. SQLAlchemy used directly exposes its full Core and ORM, which SQLModel also allows underneath."
        }
      ]
    },
    {
      "q": "Does SQLAlchemy support async?",
      "a": [
        {
          "t": "text",
          "text": "Yes. SQLAlchemy runs ORM queries through "
        },
        {
          "t": "code",
          "text": "AsyncSession"
        },
        {
          "t": "text",
          "text": " with an async database driver. Each concurrent task needs its own "
        },
        {
          "t": "code",
          "text": "AsyncSession"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "q": "SQLAlchemy vs Django ORM: what is the difference?",
      "a": [
        {
          "t": "text",
          "text": "Django ORM is part of the Django framework and reads its database settings from the project. SQLAlchemy is a standalone library used with any framework, with a separate SQL expression layer and Alembic for migrations."
        }
      ]
    },
    {
      "q": "Peewee vs SQLAlchemy: which should I use?",
      "a": [
        {
          "t": "text",
          "text": "Peewee is a single module with no required dependencies and includes a migration tool, "
        },
        {
          "t": "code",
          "text": "pwmigrate"
        },
        {
          "t": "text",
          "text": ". SQLAlchemy has a larger API, with a separate Core layer, configurable relationship loading, and migrations through Alembic."
        }
      ]
    },
    {
      "q": "Which Python ORMs include schema migrations?",
      "a": [
        {
          "t": "text",
          "text": "Django ships "
        },
        {
          "t": "code",
          "text": "makemigrations"
        },
        {
          "t": "text",
          "text": " and "
        },
        {
          "t": "code",
          "text": "migrate"
        },
        {
          "t": "text",
          "text": ", Tortoise ORM has its own migration CLI, Peewee generates migrations with "
        },
        {
          "t": "code",
          "text": "pwmigrate"
        },
        {
          "t": "text",
          "text": ", and Piccolo includes migrations. SQLAlchemy, SQLModel, and Ormar use Alembic."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, SQLAlchemy",
      "display": "SQLAlchemy",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, SQLAlchemy",
      "display": "396.9M",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, SQLAlchemy",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, SQLAlchemy",
      "display": "2.1.8, Nov 2026",
      "asOf": "2026-11-04"
    },
    "F5": {
      "label": "Package release date, SQLAlchemy",
      "display": "Nov 2026",
      "asOf": "2026-11-04"
    },
    "F6": {
      "label": "Repository stars, SQLAlchemy",
      "display": "12.3K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Async queries, SQLAlchemy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Schema migrations, SQLAlchemy",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Transactions, SQLAlchemy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Connection pools, SQLAlchemy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Install, SQLAlchemy",
      "display": "pip install SQLAlchemy",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "What it does, SQLAlchemy",
      "display": "Provides a SQL expression toolkit and an object-relational mapper for Python applications.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, SQLAlchemy",
      "display": "Separates SQL expressions from objects",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, SQLAlchemy",
      "display": "Use Core without adopting the ORM, or add mapped domain models.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, SQLAlchemy",
      "display": "Controls relationship loading",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, SQLAlchemy",
      "display": "Choose eager-loading strategies for related objects and collections.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, SQLAlchemy",
      "display": "Concurrent tasks need separate sessions",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, SQLAlchemy",
      "display": "Give each thread or asyncio task its own session.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations lead, SQLAlchemy",
      "display": "Schema diffs need manual review",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations, SQLAlchemy",
      "display": "Review and correct Alembic’s generated migration candidates before applying them.",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Quickstart, SQLAlchemy",
      "display": "\"\"\"Illustrates use of the ``sqlalchemy.ext.asyncio.AsyncSession`` object\nfor asynchronous ORM use.\n\n\"\"\"\n\nfrom __future__ import annotations\n\nimport asyncio\nimport datetime\nfrom typing import List\nfrom typing import Optional\n\nfrom sqlalchemy import ForeignKey\nfrom sqlalchemy import func\nfrom sqlalchemy.ext.asyncio import async_sessionmaker\nfrom sqlalchemy.ext.asyncio import AsyncAttrs\nfrom sqlalchemy.ext.asyncio import create_async_engine\nfrom sqlalchemy.future import select\nfrom sqlalchemy.orm import DeclarativeBase\nfrom sqlalchemy.orm import Mapped\nfrom sqlalchemy.orm import mapped_column\nfrom sqlalchemy.orm import relationship\nfrom sqlalchemy.orm import selectinload\n\n\nclass Base(AsyncAttrs, DeclarativeBase):\n    pass\n\n\nclass A(Base):\n    __tablename__ = \"a\"\n\n    id: Mapped[int] = mapped_column(primary_key=True)\n    data: Mapped[Optional[str]]\n    create_date: Mapped[datetime.datetime] = mapped_column(\n        server_default=func.now()\n    )\n    bs: Mapped[List[B]] = relationship()\n\n\nclass B(Base):\n    __tablename__ = \"b\"\n    id: Mapped[int] = mapped_column(primary_key=True)\n    a_id: Mapped[int] = mapped_column(ForeignKey(\"a.id\"))\n    data: Mapped[Optional[str]]\n\n\nasync def async_main():\n    \"\"\"Main program function.\"\"\"\n\n    engine = create_async_engine(\n        \"postgresql+asyncpg://scott:tiger@localhost/test\",\n        echo=True,\n    )\n\n    async with engine.begin() as conn:\n        await conn.run_sync(Base.metadata.drop_all)\n    async with engine.begin() as conn:\n        await conn.run_sync(Base.metadata.create_all)\n\n    # expire_on_commit=False will prevent attributes from being expired\n    # after commit.\n    async_session = async_sessionmaker(engine, expire_on_commit=False)\n\n    async with async_session() as session:\n        async with session.begin():\n            session.add_all(\n                [\n                    A(bs=[B(), B()], data=\"a1\"),\n                    A(bs=[B()], data=\"a2\"),\n                    A(bs=[B(), B()], data=\"a3\"),\n                ]\n            )\n\n        # for relationship loading, eager loading should be applied.\n        stmt = select(A).options(selectinload(A.bs))\n\n        # AsyncSession.execute() is used for 2.0 style ORM execution\n        # (same as the synchronous API).\n        result = await session.scalars(stmt)\n\n        # result is a buffered Result object.\n        for a1 in result:\n            print(a1)\n            print(f\"created at: {a1.create_date}\")\n            for b1 in a1.bs:\n                print(b1)\n\n        # for streaming ORM results, AsyncSession.stream() may be used.\n        result = await session.stream(stmt)\n\n        # result is a streaming AsyncResult object.\n        async for a1 in result.scalars():\n            print(a1)\n            for b1 in a1.bs:\n                print(b1)\n\n        result = await session.scalars(select(A).order_by(A.id))\n\n        a1 = result.first()\n\n        a1.data = \"new data\"\n\n        await session.commit()\n\n        # use the AsyncAttrs interface to accommodate for a lazy load\n        for b1 in await a1.awaitable_attrs.bs:\n            print(b1)\n\n\nasyncio.run(async_main())\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Library name, peewee",
      "display": "Peewee",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Monthly downloads, peewee",
      "display": "41.1M",
      "asOf": "2026-11-16"
    },
    "F24": {
      "label": "License, peewee",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Package release, peewee",
      "display": "4.5.3, Oct 2026",
      "asOf": "2026-10-07"
    },
    "F26": {
      "label": "Package release date, peewee",
      "display": "Oct 2026",
      "asOf": "2026-10-07"
    },
    "F27": {
      "label": "Repository stars, peewee",
      "display": "12.0K",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Async queries, peewee",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Schema migrations, peewee",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Transactions, peewee",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Connection pools, peewee",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Install, peewee",
      "display": "pip install peewee",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "What it does, peewee",
      "display": "Provides a compact Python ORM and composable SQL queries with synchronous and asyncio APIs.",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "strengths lead, peewee",
      "display": "Keeps the core dependency-light",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "strengths, peewee",
      "display": "Use the single-module ORM with SQLite before adding backend-specific drivers.",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "strengths lead, peewee",
      "display": "Includes migrations and async drivers",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "strengths, peewee",
      "display": "Use the included migration runner and asyncio integrations for supported databases.",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "limitations lead, peewee",
      "display": "Renamed fields look like replacements",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "limitations, peewee",
      "display": "Replace generated add/drop pairs with rename operations when existing data must survive.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "limitations lead, peewee",
      "display": "Pooled connections must be released",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "limitations, peewee",
      "display": "Close each request’s connection or use a context manager to return it.",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "Quickstart, peewee",
      "display": "import datetime\nfrom peewee import *\n\n# An in-memory SQLite database. Or use PostgresqlDatabase or MySQLDatabase.\ndb = SqliteDatabase(':memory:')\n\nclass BaseModel(Model):\n    class Meta:\n        database = db\n\nclass User(BaseModel):\n    username = TextField(unique=True)\n\nclass Tweet(BaseModel):\n    user = ForeignKeyField(User, backref='tweets')\n    content = TextField()\n    timestamp = DateTimeField(\n        default=datetime.datetime.now,\n        index=True)\n\n\ndb.connect()\ndb.create_tables([User, Tweet])\n\n\n# One-step creation - returns the saved instance.\ncharlie = User.create(username='charlie')\nhuey = User.create(username='huey')\n\n# Two-step creation.\nt = Tweet(user=charlie, content='Hello, world!')\nt.save()\n\nTweet.create(user=charlie, content='My second tweet.')\nTweet.create(user=huey, content='meow')\n\n\n# Select each tweet with its author in one query.\nquery = (Tweet\n         .select(Tweet, User)\n         .join(User)\n         .order_by(Tweet.timestamp.desc()))\n\nfor tweet in query:\n    print(tweet.user.username, '->', tweet.content)\n\n\ndb.close()\n\n",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "Project function, peewee",
      "display": "@router.get(\n    \"/event_ids\",\n    response_model=list[EventResponse],\n    dependencies=[Depends(allow_any_authenticated())],\n    summary=\"Get events by ids\",\n    description=\"\"\"Gets events by a list of ids.\n    Returns a list of events.\n    \"\"\",\n)\nasync def event_ids(ids: str, request: Request):\n    ids = ids.split(\",\")\n\n    if not ids:\n        return JSONResponse(\n            content=({\"success\": False, \"message\": \"Valid list of ids must be sent\"}),\n            status_code=400,\n        )\n\n    try:\n        events = list(Event.select().where(Event.id << ids).dicts().iterator())\n    except Exception:\n        return JSONResponse(\n            content=({\"success\": False, \"message\": \"Events not found\"}), status_code=400\n        )\n\n    for event in events:\n        await require_camera_access(event[\"camera\"], request=request)\n\n    return JSONResponse(events)\n",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "Project function reference, peewee",
      "display": "event.py · event_ids()",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "Project repository, peewee",
      "display": "blakeblackshear/frigate",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Project stars, blakeblackshear/frigate",
      "display": "37.5K",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project push date, blakeblackshear/frigate",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F48": {
      "label": "Library name, pony",
      "display": "Pony ORM",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Monthly downloads, pony",
      "display": "802.3K",
      "asOf": "2026-11-16"
    },
    "F50": {
      "label": "License, pony",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Package release, pony",
      "display": "0.7.20, Aug 2026",
      "asOf": "2026-08-09"
    },
    "F52": {
      "label": "Package release date, pony",
      "display": "Aug 2026",
      "asOf": "2026-08-09"
    },
    "F53": {
      "label": "Repository stars, pony",
      "display": "3.8K",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Transactions, pony",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Connection pools, pony",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Install, pony",
      "display": "pip install pony",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "What it does, pony",
      "display": "Translates Python generator expressions and lambdas into SQL queries over mapped entities.",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "strengths lead, pony",
      "display": "Writes queries as Python expressions",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "strengths, pony",
      "display": "Use generator expressions and lambdas that translate into SQL.",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "strengths lead, pony",
      "display": "Manages transaction and identity state",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "strengths, pony",
      "display": "Commit or roll back and return connections when a database session ends.",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "limitations lead, pony",
      "display": "Lazy attributes need live sessions",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "limitations, pony",
      "display": "Load required attributes before leaving the database session.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "limitations lead, pony",
      "display": "Nested sessions share one transaction",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "limitations, pony",
      "display": "An inner rollback also rolls back the outer session.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "Quickstart, pony",
      "display": "from pony.orm import *\n\ndb = Database()\n\nclass Person(db.Entity):\n    name = Required(str)\n    age = Required(int)\n    cars = Set('Car')\nclass Car(db.Entity):\n    make = Required(str)\n    model = Required(str)\n    owner = Required(Person)\n\ndb.bind(provider='sqlite', filename=':memory:')\n\ndb.generate_mapping(create_tables=True)\n\nwith db_session:\n    p = Person(name='Kate', age=33)\n    Car(make='Audi', model='R8', owner=p)\n    # commit() will be done automatically\n    # database session cache will be cleared automatically\n    # database connection will be returned to the pool\n\n\n",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "Project function, pony",
      "display": "@db_session\ndef query_with_augmenter(self, query: str, augmenter: AugmentedSearch, first: int = 1, last: int = 50,\n                         sort_desc: bool = True, sort_by: str = \"\") -> list[TorrentMetadata]:\n    # ...\n    limit, offset = max(1, last - first), max(1, first)\n    results = [r[0] for r in self.db.get_connection().execute(*augmenter.augment(query, limit, offset)).fetchall()]\n\n    pony_query = select(g for g in cast(\"TorrentMetadata\", self.TorrentMetadata) if g.rowid in results)\n    return cast(\"list[TorrentMetadata]\", self.apply_sort_by_option(pony_query, sort_by, sort_desc))\n",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "Project function reference, pony",
      "display": "store.py · query_with_augmenter()",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "Project repository, pony",
      "display": "Tribler/tribler",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "Project stars, Tribler/tribler",
      "display": "5.4K",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Project push date, Tribler/tribler",
      "display": "Nov 2026",
      "asOf": "2026-11-04"
    },
    "F72": {
      "label": "Library name, tortoise-orm",
      "display": "Tortoise ORM",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Monthly downloads, tortoise-orm",
      "display": "627.6K",
      "asOf": "2026-11-16"
    },
    "F74": {
      "label": "License, tortoise-orm",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Package release, tortoise-orm",
      "display": "1.1.9, Oct 2026",
      "asOf": "2026-10-14"
    },
    "F76": {
      "label": "Package release date, tortoise-orm",
      "display": "Oct 2026",
      "asOf": "2026-10-14"
    },
    "F77": {
      "label": "Repository stars, tortoise-orm",
      "display": "5.6K",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Async queries, tortoise-orm",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Schema migrations, tortoise-orm",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Transactions, tortoise-orm",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Connection pools, tortoise-orm",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Install, tortoise-orm",
      "display": "pip install tortoise-orm",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "What it does, tortoise-orm",
      "display": "Provides an async-native ORM with model relationships and a built-in migration framework.",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "strengths lead, tortoise-orm",
      "display": "Uses an async-native model API",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "strengths, tortoise-orm",
      "display": "Await database operations through a Django-inspired model and query interface.",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "strengths lead, tortoise-orm",
      "display": "Includes versioned schema migrations",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "strengths, tortoise-orm",
      "display": "Detect model changes and apply generated migrations through the included CLI.",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "limitations lead, tortoise-orm",
      "display": "Nested transactions must stay sequential",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "limitations, tortoise-orm",
      "display": "Avoid nesting transaction blocks inside concurrent tasks sharing an outer transaction.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "limitations lead, tortoise-orm",
      "display": "Data migrations need historical models",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "limitations, tortoise-orm",
      "display": "Load migration models through apps.get_model instead of importing current runtime classes.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Quickstart, tortoise-orm",
      "display": "\"\"\"\nThis example demonstrates most basic operations with single model\n\"\"\"\n\nfrom tortoise import fields, run_async\nfrom tortoise.contrib.test import init_memory_sqlite\nfrom tortoise.models import Model\n\n\nclass Event(Model):\n    id = fields.IntField(primary_key=True)\n    name = fields.TextField()\n    datetime = fields.DatetimeField(null=True)\n    username = fields.CharField(max_length=150, unique=True, db_index=True)\n\n    class Meta:\n        table = \"event\"\n\n    def __str__(self):\n        return self.name\n\n\n@init_memory_sqlite\nasync def run() -> None:\n    event = await Event.create(name=\"Test\", username=\"test\")\n    await Event.filter(id=event.id).update(name=\"Updated name\")\n\n    print(await Event.filter(username=\"test\").first())\n    # >>> Updated name\n\n    await Event(name=\"Test 2\", username=\"test2\").save()\n    print(await Event.all().values_list(\"id\", flat=True))\n    # >>> [1, 2]\n    print(await Event.all().values(\"id\", \"name\"))\n    # >>> [{'id': 1, 'name': 'Updated name'}, {'id': 2, 'name': 'Test 2'}]\n\n\nif __name__ == \"__main__\":\n    run_async(run())\n",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Project function, tortoise-orm",
      "display": "async def _do_init(self, safe: bool, pre_sql: str | None = None, offline: bool = False) -> bool:\n    # ...\n    location = self.location\n    app = self.app\n    config = self.tortoise_config\n\n    await Tortoise.init(config=config)\n    connection = get_app_connection(config, app)\n    if offline:\n        await Migrate.init(config, app, location, offline=True)\n    elif pre_sql:\n        await connection.execute_script(pre_sql)\n\n    dirname = Migrate.get_migration_dir(location, app)\n    if not dirname.exists():\n        dirname.mkdir(parents=True)\n    else:\n        existing_version_files = [\n            f for f in dirname.glob(\"*.py\") if \"_\" in f.stem and f.stem.split(\"_\")[0].isdigit()\n        ]\n        if existing_version_files and not offline:\n            # Migration files already exist.  Check whether the database has been\n            # initialised by querying the aerich tracking table.\n            try:\n                already_initialized = await Aerich.exists(app=app)\n            except OperationalError:\n                already_initialized = False\n\n            if already_initialized:\n                raise FileExistsError(str(existing_version_files[0]))\n\n            # Fresh database with existing migration files (e.g. a repo that was cloned).\n            # Apply all migrations in order so the database reaches the current state.\n            Migrate.app = app\n            Migrate.migrate_location = dirname\n            app_conn_name = get_app_connection_name(config, app)\n            for version_module in Migrate.get_all_version_modules():\n                version_file = version_module.name + \".py\"\n                m = import_py_module(version_module)\n                if getattr(m, \"RUN_IN_TRANSACTION\", True):\n                    async with in_transaction(app_conn_name) as conn:\n                        await self._upgrade(conn, version_file, version_module=version_module)\n                else:\n                    await self._upgrade(connection, version_file, version_module=version_module)\n            return False\n\n        # Directory is empty (or offline mode with existing files): raise for any present file.\n        for unexpected_file in dirname.glob(\"*\"):\n            raise FileExistsError(str(unexpected_file))\n\n    schema = get_schema_sql(connection, safe)\n\n    version = await Migrate.generate_version(offline=offline)\n    aerich_content = get_models_describe(app)\n    version_path = Path(dirname, version)\n    content = Migrate.build_migration_file_text(upgrade_sql=schema, models_state=aerich_content)\n    version_path.write_text(content, encoding=\"utf-8\")\n    Migrate._last_version_content = aerich_content\n    if not offline:\n        await generate_schema_for_client(connection, safe)\n        await Aerich.create(version=version, app=app, content=aerich_content)\n    return True\n",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Project function reference, tortoise-orm",
      "display": "__init__.py · _do_init()",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Project repository, tortoise-orm",
      "display": "tortoise/aerich",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Project stars, tortoise/aerich",
      "display": "1.1K",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Project push date, tortoise/aerich",
      "display": "Nov 2026",
      "asOf": "2026-11-01"
    },
    "F98": {
      "label": "Developer need",
      "display": "Combining SQL expressions and models",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Why choose SQLAlchemy",
      "display": "separate Core SQL and ORM layers",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Developer need in introduction",
      "display": "combining SQL expressions and models",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need",
      "display": "A compact ORM with migrations",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Why choose peewee",
      "display": "a small core with backend-specific drivers",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need in introduction",
      "display": "a compact ORM with migrations",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "When to consider SQLAlchemy",
      "display": "a separate SQL-expression layer is the priority",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Developer need",
      "display": "An async-native ORM application",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Why choose tortoise-orm",
      "display": "awaitable model and query operations",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Developer need in introduction",
      "display": "an async-native ORM application",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Developer need",
      "display": "Querying with Python generator expressions",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Why choose pony",
      "display": "translation from Python expressions to SQL",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Developer need in introduction",
      "display": "querying with Python generator expressions",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "When to consider SQLAlchemy",
      "display": "explicit SQL-expression composition is preferred",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "Page introduction",
      "display": "Python database libraries let application developers store and query application data.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: What is the best Python database library?",
      "display": "SQLAlchemy provides separate SQL-expression and ORM layers.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: What is the best Python database library?",
      "display": "Peewee provides a compact single-module ORM.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: What is the best Python database library?",
      "display": "Tortoise ORM is async-native with a Django-inspired API.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: What is the best Python database library?",
      "display": "Pony translates Python generator expressions and lambdas to SQL.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Does an ORM replace the underlying database driver?",
      "display": "Peewee uses backend-specific drivers, including separate asynchronous drivers.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Does an ORM replace the underlying database driver?",
      "display": "Tortoise lists separate installation extras for its database clients.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Which libraries include schema migrations?",
      "display": "Current Peewee includes a migration runner with ordered migration history.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Which libraries include schema migrations?",
      "display": "Current Tortoise ORM ships with migration generation and an included CLI.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Which libraries include schema migrations?",
      "display": "SQLAlchemy metadata can be compared through the separately installed Alembic migration tool.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Can concurrent tasks share a SQLAlchemy session?",
      "display": "Use a separate AsyncSession for each concurrent task and a separate Session for each thread.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Will generated migrations preserve a renamed field?",
      "display": "Peewee’s differ matches column names, so replace a generated add/drop pair with a rename when data must survive.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Will generated migrations preserve a renamed field?",
      "display": "Alembic’s generated migration candidates also require manual review and correction.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Can nested Tortoise transactions run concurrently?",
      "display": "Nested transaction blocks are expected to run sequentially; avoid nesting them in concurrent tasks inside the same transaction.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Why do Pony attributes fail after leaving a database session?",
      "display": "Unloaded attributes cannot fetch data after the session has returned its connection; load required values inside the session.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Does closing a pooled Peewee connection close the network socket?",
      "display": "For pooled databases, connect and close acquire and release pooled connections; explicitly return each acquired connection.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "Library name, SQLAlchemy",
      "display": "SQLAlchemy",
      "asOf": "2026-11-19"
    },
    "F129": {
      "label": "Monthly downloads, SQLAlchemy",
      "display": "413.8M",
      "asOf": "2026-11-19"
    },
    "F130": {
      "label": "License, SQLAlchemy",
      "display": "MIT",
      "asOf": "2026-11-19"
    },
    "F131": {
      "label": "Package release, SQLAlchemy",
      "display": "2.1.9",
      "asOf": "2026-11-19"
    },
    "F132": {
      "label": "Package release date, SQLAlchemy",
      "display": "Nov 2026",
      "asOf": "2026-11-19"
    },
    "F133": {
      "label": "Install, SQLAlchemy",
      "display": "pip install SQLAlchemy",
      "asOf": "2026-11-19"
    },
    "F134": {
      "label": "Quickstart, SQLAlchemy",
      "display": "from sqlalchemy import create_engine, String\nfrom sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, Session\n\nclass Base(DeclarativeBase):\n    pass\nclass Item(Base):\n    __tablename__ = 'items'\n    id: Mapped[int] = mapped_column(primary_key=True)\n    name: Mapped[str] = mapped_column(String())\n\nengine = create_engine('sqlite:///:memory:')\nBase.metadata.create_all(engine)\nwith Session(engine) as session:\n    session.add(Item(name='Hello'))\n    session.commit()\n",
      "asOf": "2026-11-19"
    },
    "F135": {
      "label": "Repository stars, SQLAlchemy",
      "display": "12.3K",
      "asOf": "2026-11-19"
    },
    "F136": {
      "label": "Awaitable ORM queries, SQLAlchemy",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F137": {
      "label": "Schema migration tools, SQLAlchemy",
      "display": "Via plugin",
      "asOf": "2026-11-19"
    },
    "F138": {
      "label": "Model/API role, SQLAlchemy",
      "display": "Database Abstraction Library",
      "asOf": "2026-11-19"
    },
    "F139": {
      "label": "Project function, SQLAlchemy",
      "display": "def get_column_from_field(field: Any) -> Column:\n    field_info = field\n    sa_column = _get_sqlmodel_field_value(field_info, \"sa_column\", Undefined)\n    if isinstance(sa_column, Column):\n        return sa_column\n    sa_type = get_sqlalchemy_type(field)\n    primary_key = _get_sqlmodel_field_value(field_info, \"primary_key\", Undefined)\n    if primary_key is Undefined:\n        primary_key = False\n    index = _get_sqlmodel_field_value(field_info, \"index\", Undefined)\n    if index is Undefined:\n        index = False\n    nullable = not primary_key and is_field_noneable(field)\n    # Override derived nullability if the nullable property is set explicitly\n    # on the field\n    field_nullable = _get_sqlmodel_field_value(field_info, \"nullable\", Undefined)\n    if field_nullable is not Undefined:\n        assert not isinstance(field_nullable, UndefinedType)\n        nullable = field_nullable\n    args = []\n    foreign_key = _get_sqlmodel_field_value(field_info, \"foreign_key\", Undefined)\n    if foreign_key is Undefined:\n        foreign_key = None\n    unique = _get_sqlmodel_field_value(field_info, \"unique\", Undefined)\n    if unique is Undefined:\n        unique = False\n    if foreign_key:\n        ondelete_value = _get_sqlmodel_field_value(field_info, \"ondelete\", Undefined)\n        if ondelete_value is Undefined:\n            ondelete_value = None\n        if ondelete_value == \"SET NULL\" and not nullable:\n            raise RuntimeError('ondelete=\"SET NULL\" requires nullable=True')\n        assert isinstance(foreign_key, str)\n        assert isinstance(ondelete_value, (str, type(None)))  # for typing\n        args.append(ForeignKey(foreign_key, ondelete=ondelete_value))\n    kwargs: dict[str, Any] = {\n        \"primary_key\": primary_key,\n        \"nullable\": nullable,\n        \"index\": index,\n        \"unique\": unique,\n    }\n    sa_default = Undefined\n    if field_info.default_factory:\n        sa_default = field_info.default_factory\n    elif field_info.default is not Undefined:\n        sa_default = field_info.default\n    if sa_default is not Undefined:\n        kwargs[\"default\"] = sa_default\n    sa_column_args = _get_sqlmodel_field_value(field_info, \"sa_column_args\", Undefined)\n    if sa_column_args is not Undefined:\n        args.extend(list(cast(Sequence[Any], sa_column_args)))\n    sa_column_kwargs = _get_sqlmodel_field_value(\n        field_info, \"sa_column_kwargs\", Undefined\n    )\n    if sa_column_kwargs is not Undefined:\n        kwargs.update(cast(dict[Any, Any], sa_column_kwargs))\n    return Column(*args, type_=sa_type, **kwargs)",
      "asOf": "2026-11-19"
    },
    "F140": {
      "label": "Project source file, SQLAlchemy",
      "display": "sqlmodel/main.py",
      "asOf": "2026-11-19"
    },
    "F141": {
      "label": "Project full_name, SQLAlchemy",
      "display": "fastapi/sqlmodel",
      "asOf": "2026-11-19"
    },
    "F142": {
      "label": "Project stargazers_count, SQLAlchemy",
      "display": "18.6K",
      "asOf": "2026-11-19"
    },
    "F143": {
      "label": "Library name, Django",
      "display": "Django ORM",
      "asOf": "2026-11-19"
    },
    "F144": {
      "label": "Monthly downloads, Django",
      "display": "51.9M",
      "asOf": "2026-11-19"
    },
    "F145": {
      "label": "License, Django",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-19"
    },
    "F146": {
      "label": "Package release, Django",
      "display": "6.1.1",
      "asOf": "2026-11-19"
    },
    "F147": {
      "label": "Package release date, Django",
      "display": "Sep 2026",
      "asOf": "2026-11-19"
    },
    "F148": {
      "label": "Install, Django",
      "display": "pip install Django",
      "asOf": "2026-11-19"
    },
    "F149": {
      "label": "Quickstart, Django",
      "display": "import django\nfrom django.conf import settings\n\nsettings.configure(INSTALLED_APPS=[], DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}})\ndjango.setup()\nfrom django.db import connection, models\n\nclass Item(models.Model):\n    name = models.CharField(max_length=100)\n    class Meta:\n        app_label = 'example'\n\nwith connection.schema_editor() as editor:\n    editor.create_model(Item)\nitem = Item.objects.create(name='Hello')\n",
      "asOf": "2026-11-19"
    },
    "F150": {
      "label": "Official description, Django",
      "display": "A high-level Python web framework that encourages rapid development and clean, pragmatic design.",
      "asOf": "2026-11-19"
    },
    "F151": {
      "label": "Quickstart source file, Django",
      "display": "topics/settings; models/options; schema-editor",
      "asOf": "2026-11-19"
    },
    "F152": {
      "label": "Repository stars, Django",
      "display": "91.9K",
      "asOf": "2026-11-19"
    },
    "F153": {
      "label": "Awaitable ORM queries, Django",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F154": {
      "label": "Schema migration tools, Django",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F155": {
      "label": "Model/API role, Django",
      "display": "A high-level Python web framework that encourages rapid development and clean, pragmatic design.",
      "asOf": "2026-11-19"
    },
    "F156": {
      "label": "Package count scope, Django",
      "display": "Whole Django framework, including ORM",
      "asOf": "2026-11-19"
    },
    "F157": {
      "label": "Async transaction boundary, Django",
      "display": "Use synchronous transaction function with sync_to_async",
      "asOf": "2026-11-19"
    },
    "F158": {
      "label": "Project function, Django",
      "display": "def create_line_discount_models(self, order, order_line, basket_line):\n    for discount in basket_line.discounts:\n        if not discount.offer:\n            continue\n        order_discount = order.discounts.filter(offer_id=discount.offer.id).first()\n        # If we are unable to find the discount we do not care, the total amount is still saved on the discount model,\n        # these models are only created so we know how much discount was given per line for each offer\n        if order_discount:\n            order_line.discounts.create(\n                order_discount=order_discount,\n                is_incl_tax=discount.incl_tax,\n                amount=discount.amount,\n            )",
      "asOf": "2026-11-19"
    },
    "F159": {
      "label": "Project source file, Django",
      "display": "src/oscar/apps/order/utils.py",
      "asOf": "2026-11-19"
    },
    "F160": {
      "label": "Project full_name, Django",
      "display": "django-oscar/django-oscar",
      "asOf": "2026-11-19"
    },
    "F161": {
      "label": "Project stargazers_count, Django",
      "display": "6.6K",
      "asOf": "2026-11-19"
    },
    "F162": {
      "label": "Library name, peewee",
      "display": "Peewee",
      "asOf": "2026-11-19"
    },
    "F163": {
      "label": "Monthly downloads, peewee",
      "display": "42.4M",
      "asOf": "2026-11-19"
    },
    "F164": {
      "label": "License, peewee",
      "display": "MIT",
      "asOf": "2026-11-19"
    },
    "F165": {
      "label": "Package release, peewee",
      "display": "4.5.3",
      "asOf": "2026-11-19"
    },
    "F166": {
      "label": "Package release date, peewee",
      "display": "Oct 2026",
      "asOf": "2026-11-19"
    },
    "F167": {
      "label": "Install, peewee",
      "display": "pip install peewee",
      "asOf": "2026-11-19"
    },
    "F168": {
      "label": "Quickstart, peewee",
      "display": "from peewee import Model, SqliteDatabase, TextField\n\ndb = SqliteDatabase(':memory:')\nclass Item(Model):\n    name = TextField()\n    class Meta:\n        database = db\n\nItem.create_table()\nitem = Item.create(name='Hello')\n",
      "asOf": "2026-11-19"
    },
    "F169": {
      "label": "Repository stars, peewee",
      "display": "12.0K",
      "asOf": "2026-11-19"
    },
    "F170": {
      "label": "Awaitable ORM queries, peewee",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F171": {
      "label": "Schema migration tools, peewee",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F172": {
      "label": "Model/API role, peewee",
      "display": "a little orm",
      "asOf": "2026-11-19"
    },
    "F173": {
      "label": "Async prerequisites, peewee",
      "display": "greenlet plus aiosqlite, asyncpg, or aiomysql",
      "asOf": "2026-11-19"
    },
    "F174": {
      "label": "Project function, peewee",
      "display": "@router.get(\n    \"/event_ids\",\n    response_model=list[EventResponse],\n    dependencies=[Depends(allow_any_authenticated())],\n    summary=\"Get events by ids\",\n    description=\"\"\"Gets events by a list of ids.\n    Returns a list of events.\n    \"\"\",\n)\nasync def event_ids(ids: str, request: Request):\n    ids = ids.split(\",\")\n\n    if not ids:\n        return JSONResponse(\n            content=({\"success\": False, \"message\": \"Valid list of ids must be sent\"}),\n            status_code=400,\n        )\n\n    try:\n        events = list(Event.select().where(Event.id << ids).dicts().iterator())\n    except Exception:\n        return JSONResponse(\n            content=({\"success\": False, \"message\": \"Events not found\"}), status_code=400\n        )\n\n    for event in events:\n        await require_camera_access(event[\"camera\"], request=request)\n\n    return JSONResponse(events)\n",
      "asOf": "2026-11-19"
    },
    "F175": {
      "label": "Project source file, peewee",
      "display": "frigate/api/event.py",
      "asOf": "2026-11-19"
    },
    "F176": {
      "label": "Project full_name, peewee",
      "display": "blakeblackshear/frigate",
      "asOf": "2026-11-19"
    },
    "F177": {
      "label": "Project stargazers_count, peewee",
      "display": "37.5K",
      "asOf": "2026-11-19"
    },
    "F178": {
      "label": "Library name, sqlmodel",
      "display": "SQLModel",
      "asOf": "2026-11-19"
    },
    "F179": {
      "label": "Monthly downloads, sqlmodel",
      "display": "27.7M",
      "asOf": "2026-11-19"
    },
    "F180": {
      "label": "License, sqlmodel",
      "display": "MIT",
      "asOf": "2026-11-19"
    },
    "F181": {
      "label": "Package release, sqlmodel",
      "display": "0.0.50",
      "asOf": "2026-11-19"
    },
    "F182": {
      "label": "Package release date, sqlmodel",
      "display": "Nov 2026",
      "asOf": "2026-11-19"
    },
    "F183": {
      "label": "Install, sqlmodel",
      "display": "pip install sqlmodel",
      "asOf": "2026-11-19"
    },
    "F184": {
      "label": "Quickstart, sqlmodel",
      "display": "from sqlmodel import Field, Session, SQLModel, create_engine\n\nclass Item(SQLModel, table=True):\n    id: int | None = Field(default=None, primary_key=True)\n    name: str\n\nengine = create_engine('sqlite:///:memory:')\nSQLModel.metadata.create_all(engine)\nwith Session(engine) as session:\n    session.add(Item(name='Hello'))\n    session.commit()\n",
      "asOf": "2026-11-19"
    },
    "F185": {
      "label": "Official description, sqlmodel",
      "display": "SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.",
      "asOf": "2026-11-19"
    },
    "F186": {
      "label": "Quickstart source file, sqlmodel",
      "display": "tutorial/create-db-and-table",
      "asOf": "2026-11-19"
    },
    "F187": {
      "label": "Repository stars, sqlmodel",
      "display": "18.6K",
      "asOf": "2026-11-19"
    },
    "F188": {
      "label": "Awaitable ORM queries, sqlmodel",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F189": {
      "label": "Schema migration tools, sqlmodel",
      "display": "Via plugin",
      "asOf": "2026-11-19"
    },
    "F190": {
      "label": "Model/API role, sqlmodel",
      "display": "SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.",
      "asOf": "2026-11-19"
    },
    "F191": {
      "label": "Abstraction layer, sqlmodel",
      "display": "Pydantic and SQLAlchemy integration",
      "asOf": "2026-11-19"
    },
    "F192": {
      "label": "Datetime version boundary, sqlmodel",
      "display": "Aware UTC default since0.0.45",
      "asOf": "2026-11-19"
    },
    "F193": {
      "label": "Project function, sqlmodel",
      "display": "def create_user(*, session: Session, user_create: UserCreate) -> User:\n    db_obj = User.model_validate(\n        user_create, update={\"hashed_password\": get_password_hash(user_create.password)}\n    )\n    session.add(db_obj)\n    session.commit()\n    session.refresh(db_obj)\n    return db_obj",
      "asOf": "2026-11-19"
    },
    "F194": {
      "label": "Project source file, sqlmodel",
      "display": "backend/app/crud.py",
      "asOf": "2026-11-19"
    },
    "F195": {
      "label": "Project full_name, sqlmodel",
      "display": "fastapi/full-stack-fastapi-template",
      "asOf": "2026-11-19"
    },
    "F196": {
      "label": "Project stargazers_count, sqlmodel",
      "display": "46.3K",
      "asOf": "2026-11-19"
    },
    "F197": {
      "label": "Library name, pony",
      "display": "Pony ORM",
      "asOf": "2026-11-19"
    },
    "F198": {
      "label": "Monthly downloads, pony",
      "display": "855.0K",
      "asOf": "2026-11-19"
    },
    "F199": {
      "label": "License, pony",
      "display": "Apache-2.0",
      "asOf": "2026-11-19"
    },
    "F200": {
      "label": "Package release, pony",
      "display": "0.7.20",
      "asOf": "2026-11-19"
    },
    "F201": {
      "label": "Package release date, pony",
      "display": "Aug 2026",
      "asOf": "2026-11-19"
    },
    "F202": {
      "label": "Install, pony",
      "display": "pip install pony",
      "asOf": "2026-11-19"
    },
    "F203": {
      "label": "Quickstart, pony",
      "display": "from pony.orm import Database, Required, db_session\n\ndb = Database()\nclass Item(db.Entity):\n    name = Required(str)\n\ndb.bind(provider='sqlite', filename=':memory:')\ndb.generate_mapping(create_tables=True)\nwith db_session:\n    item = Item(name='Hello')\n",
      "asOf": "2026-11-19"
    },
    "F204": {
      "label": "Repository stars, pony",
      "display": "3.8K",
      "asOf": "2026-11-19"
    },
    "F205": {
      "label": "Awaitable ORM queries, pony",
      "display": "No",
      "asOf": "2026-11-19"
    },
    "F206": {
      "label": "Schema migration tools, pony",
      "display": "Undocumented",
      "asOf": "2026-11-19"
    },
    "F207": {
      "label": "Model/API role, pony",
      "display": "Pony Object-Relational Mapper",
      "asOf": "2026-11-19"
    },
    "F208": {
      "label": "Async-session restriction, pony",
      "display": "No await inside db_session; sync ORM calls only",
      "asOf": "2026-11-19"
    },
    "F209": {
      "label": "Project function, pony",
      "display": "@db_session\ndef query_with_augmenter(self, query: str, augmenter: AugmentedSearch, first: int = 1, last: int = 50,\n                         sort_desc: bool = True, sort_by: str = \"\") -> list[TorrentMetadata]:\n    \"\"\"\n    Use the given augmenter to perform a heavier search for the given query.\n\n    :returns: A Query object that evaluates to a list of TorrentMetadata.\n    \"\"\"\n    limit, offset = max(1, last - first), max(1, first)\n    results = [r[0] for r in self.db.get_connection().execute(*augmenter.augment(query, limit, offset)).fetchall()]\n\n    pony_query = select(g for g in cast(\"TorrentMetadata\", self.TorrentMetadata) if g.rowid in results)\n    return cast(\"list[TorrentMetadata]\", self.apply_sort_by_option(pony_query, sort_by, sort_desc))\n",
      "asOf": "2026-11-19"
    },
    "F210": {
      "label": "Project source file, pony",
      "display": "src/tribler/core/database/store.py",
      "asOf": "2026-11-19"
    },
    "F211": {
      "label": "Project full_name, pony",
      "display": "Tribler/tribler",
      "asOf": "2026-11-19"
    },
    "F212": {
      "label": "Project stargazers_count, pony",
      "display": "5.4K",
      "asOf": "2026-11-19"
    },
    "F213": {
      "label": "Library name, piccolo",
      "display": "Piccolo",
      "asOf": "2026-11-19"
    },
    "F214": {
      "label": "Monthly downloads, piccolo",
      "display": "696.7K",
      "asOf": "2026-11-19"
    },
    "F215": {
      "label": "License, piccolo",
      "display": "MIT",
      "asOf": "2026-11-19"
    },
    "F216": {
      "label": "Package release, piccolo",
      "display": "1.39.0",
      "asOf": "2026-11-19"
    },
    "F217": {
      "label": "Package release date, piccolo",
      "display": "Oct 2026",
      "asOf": "2026-11-19"
    },
    "F218": {
      "label": "Install, piccolo",
      "display": "pip install \"piccolo[sqlite]\"",
      "asOf": "2026-11-19"
    },
    "F219": {
      "label": "Quickstart, piccolo",
      "display": "from piccolo.table import Table\nfrom piccolo.columns import Varchar\nfrom piccolo.engine.sqlite import SQLiteEngine\n\nclass Item(Table, db=SQLiteEngine(path='example.sqlite')):\n    name = Varchar()\n\nItem.create_table(if_not_exists=True).run_sync()\n",
      "asOf": "2026-11-19"
    },
    "F220": {
      "label": "Official description, piccolo",
      "display": "An ORM and query builder that supports asyncio.",
      "asOf": "2026-11-19"
    },
    "F221": {
      "label": "Quickstart source file, piccolo",
      "display": "piccolo/table.py and engine SQLite API",
      "asOf": "2026-11-19"
    },
    "F222": {
      "label": "Repository stars, piccolo",
      "display": "2.0K",
      "asOf": "2026-11-19"
    },
    "F223": {
      "label": "Awaitable ORM queries, piccolo",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F224": {
      "label": "Schema migration tools, piccolo",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F225": {
      "label": "Model/API role, piccolo",
      "display": "A fast, user friendly ORM and query builder which supports asyncio.",
      "asOf": "2026-11-19"
    },
    "F226": {
      "label": "Project function, piccolo",
      "display": "def create_schema(persist: bool = False):\n    if not persist:\n        drop_db_tables_sync(*TABLE_CLASSES)\n\n    create_db_tables_sync(*TABLE_CLASSES, if_not_exists=True)",
      "asOf": "2026-11-19"
    },
    "F227": {
      "label": "Project source file, piccolo",
      "display": "piccolo_admin/example/tables.py",
      "asOf": "2026-11-19"
    },
    "F228": {
      "label": "Project full_name, piccolo",
      "display": "piccolo-orm/piccolo_admin",
      "asOf": "2026-11-19"
    },
    "F229": {
      "label": "Project stargazers_count, piccolo",
      "display": "467",
      "asOf": "2026-11-19"
    },
    "F230": {
      "label": "Library name, tortoise-orm",
      "display": "Tortoise ORM",
      "asOf": "2026-11-19"
    },
    "F231": {
      "label": "Monthly downloads, tortoise-orm",
      "display": "667.7K",
      "asOf": "2026-11-19"
    },
    "F232": {
      "label": "License, tortoise-orm",
      "display": "Apache-2.0",
      "asOf": "2026-11-19"
    },
    "F233": {
      "label": "Package release, tortoise-orm",
      "display": "1.1.9",
      "asOf": "2026-11-19"
    },
    "F234": {
      "label": "Package release date, tortoise-orm",
      "display": "Oct 2026",
      "asOf": "2026-11-19"
    },
    "F235": {
      "label": "Install, tortoise-orm",
      "display": "pip install tortoise-orm",
      "asOf": "2026-11-19"
    },
    "F236": {
      "label": "Quickstart, tortoise-orm",
      "display": "from tortoise import fields, run_async\nfrom tortoise.models import Model\nfrom tortoise.contrib.test import init_memory_sqlite\n\nclass Item(Model):\n    id = fields.IntField(primary_key=True)\n    name = fields.TextField()\n\n@init_memory_sqlite\nasync def main():\n    item = await Item.create(name='Hello')\n    print(item.id)\n\nrun_async(main())\n",
      "asOf": "2026-11-19"
    },
    "F237": {
      "label": "Repository stars, tortoise-orm",
      "display": "5.6K",
      "asOf": "2026-11-19"
    },
    "F238": {
      "label": "Awaitable ORM queries, tortoise-orm",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F239": {
      "label": "Schema migration tools, tortoise-orm",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F240": {
      "label": "Model/API role, tortoise-orm",
      "display": "Easy async ORM for python, built with relations in mind",
      "asOf": "2026-11-19"
    },
    "F241": {
      "label": "Migrations in selected1.1.9, tortoise-orm",
      "display": "Built-in CLI preferred; Aerich legacy alternative",
      "asOf": "2026-11-19"
    },
    "F242": {
      "label": "Project function, tortoise-orm",
      "display": "async def _do_init(self, safe: bool, pre_sql: str | None = None, offline: bool = False) -> bool:\n    \"\"\"Initialize the database for an app.\n\n    Returns True if a new initial migration was generated, or False when existing migration\n    files were found and applied to a fresh database (e.g. a cloned repository).\n    Raises FileExistsError when the database is already initialized.\n    \"\"\"\n    location = self.location\n    app = self.app\n    config = self.tortoise_config\n\n    await Tortoise.init(config=config)\n    connection = get_app_connection(config, app)\n    if offline:\n        await Migrate.init(config, app, location, offline=True)\n    elif pre_sql:\n        await connection.execute_script(pre_sql)\n\n    dirname = Migrate.get_migration_dir(location, app)\n    if not dirname.exists():\n        dirname.mkdir(parents=True)\n    else:\n        existing_version_files = [\n            f for f in dirname.glob(\"*.py\") if \"_\" in f.stem and f.stem.split(\"_\")[0].isdigit()\n        ]\n        if existing_version_files and not offline:\n            # Migration files already exist.  Check whether the database has been\n            # initialised by querying the aerich tracking table.\n            try:\n                already_initialized = await Aerich.exists(app=app)\n            except OperationalError:\n                already_initialized = False\n\n            if already_initialized:\n                raise FileExistsError(str(existing_version_files[0]))\n\n            # Fresh database with existing migration files (e.g. a repo that was cloned).\n            # Apply all migrations in order so the database reaches the current state.\n            Migrate.app = app\n            Migrate.migrate_location = dirname\n            app_conn_name = get_app_connection_name(config, app)\n            for version_module in Migrate.get_all_version_modules():\n                version_file = version_module.name + \".py\"\n                m = import_py_module(version_module)\n                if getattr(m, \"RUN_IN_TRANSACTION\", True):\n                    async with in_transaction(app_conn_name) as conn:\n                        await self._upgrade(conn, version_file, version_module=version_module)\n                else:\n                    await self._upgrade(connection, version_file, version_module=version_module)\n            return False\n\n        # Directory is empty (or offline mode with existing files): raise for any present file.\n        for unexpected_file in dirname.glob(\"*\"):\n            raise FileExistsError(str(unexpected_file))\n\n    schema = get_schema_sql(connection, safe)\n\n    version = await Migrate.generate_version(offline=offline)\n    aerich_content = get_models_describe(app)\n    version_path = Path(dirname, version)\n    content = Migrate.build_migration_file_text(upgrade_sql=schema, models_state=aerich_content)\n    version_path.write_text(content, encoding=\"utf-8\")\n    Migrate._last_version_content = aerich_content\n    if not offline:\n        await generate_schema_for_client(connection, safe)\n        await Aerich.create(version=version, app=app, content=aerich_content)\n    return True",
      "asOf": "2026-11-19"
    },
    "F243": {
      "label": "Project source file, tortoise-orm",
      "display": "aerich/__init__.py",
      "asOf": "2026-11-19"
    },
    "F244": {
      "label": "Project full_name, tortoise-orm",
      "display": "tortoise/aerich",
      "asOf": "2026-11-19"
    },
    "F245": {
      "label": "Project stargazers_count, tortoise-orm",
      "display": "1.1K",
      "asOf": "2026-11-19"
    },
    "F246": {
      "label": "Library name, ormar",
      "display": "Ormar",
      "asOf": "2026-11-19"
    },
    "F247": {
      "label": "Monthly downloads, ormar",
      "display": "123.9K",
      "asOf": "2026-11-19"
    },
    "F248": {
      "label": "License, ormar",
      "display": "MIT",
      "asOf": "2026-11-19"
    },
    "F249": {
      "label": "Package release, ormar",
      "display": "0.30.0",
      "asOf": "2026-11-19"
    },
    "F250": {
      "label": "Package release date, ormar",
      "display": "Nov 2026",
      "asOf": "2026-11-19"
    },
    "F251": {
      "label": "Install, ormar",
      "display": "pip install ormar aiosqlite",
      "asOf": "2026-11-19"
    },
    "F252": {
      "label": "Quickstart, ormar",
      "display": "import asyncio\nimport ormar\nimport sqlalchemy\n\nmetadata = sqlalchemy.MetaData()\ndatabase = ormar.DatabaseConnection('sqlite+aiosqlite:///example.sqlite')\nclass Item(ormar.Model):\n    ormar_config = ormar.OrmarConfig(tablename='items', database=database, metadata=metadata)\n    id = ormar.Integer(primary_key=True)\n    name = ormar.String(max_length=100)\n\nmetadata.create_all(sqlalchemy.create_engine('sqlite:///example.sqlite'))\nasync def main():\n    async with database:\n        await Item.objects.create(name='Hello')\n\nasyncio.run(main())\n",
      "asOf": "2026-11-19"
    },
    "F253": {
      "label": "Official description, ormar",
      "display": "An async ORM with fastapi in mind and pydantic validation.",
      "asOf": "2026-11-19"
    },
    "F254": {
      "label": "Quickstart source file, ormar",
      "display": "models/migrations and databases/connection",
      "asOf": "2026-11-19"
    },
    "F255": {
      "label": "Repository stars, ormar",
      "display": "1.8K",
      "asOf": "2026-11-19"
    },
    "F256": {
      "label": "Awaitable ORM queries, ormar",
      "display": "Yes",
      "asOf": "2026-11-19"
    },
    "F257": {
      "label": "Schema migration tools, ormar",
      "display": "Via plugin",
      "asOf": "2026-11-19"
    },
    "F258": {
      "label": "Model/API role, ormar",
      "display": "An async ORM with fastapi in mind and pydantic validation.",
      "asOf": "2026-11-19"
    },
    "F259": {
      "label": "Connection backend, ormar",
      "display": "DatabaseConnection wraps SQLAlchemy AsyncEngine",
      "asOf": "2026-11-19"
    },
    "F260": {
      "label": "Project function, ormar",
      "display": "async def apaginate(\n    query: QuerySet[TModel] | type[TModel],\n    params: AbstractParams | None = None,\n    *,\n    transformer: AsyncItemsTransformer | None = None,\n    additional_data: AdditionalData | None = None,\n    config: Config | None = None,\n) -> Any:\n    if not isinstance(query, QuerySet):\n        query = query.objects\n\n    return await run_async_flow(\n        generic_flow(\n            async_=True,\n            total_flow=flow_expr(lambda: query.count()),\n            limit_offset_flow=flow_expr(lambda raw_params: generic_query_apply_params(query, raw_params).all()),\n            params=params,\n            transformer=transformer,\n            additional_data=additional_data,\n            config=config,\n        )\n    )",
      "asOf": "2026-11-19"
    },
    "F261": {
      "label": "Project source file, ormar",
      "display": "fastapi_pagination/ext/ormar.py",
      "asOf": "2026-11-19"
    },
    "F262": {
      "label": "Project full_name, ormar",
      "display": "uriyyo/fastapi-pagination",
      "asOf": "2026-11-19"
    },
    "F263": {
      "label": "Project stargazers_count, ormar",
      "display": "1.7K",
      "asOf": "2026-11-19"
    },
    "F264": {
      "label": "Developer need, django",
      "display": "A Django project",
      "asOf": "2026-11-17"
    },
    "F265": {
      "label": "Pick reason, django",
      "display": "queries models inside the Django framework, with async APIs",
      "asOf": "2026-11-17"
    },
    "F266": {
      "label": "Developer need, sqlmodel",
      "display": "FastAPI models stored in SQL",
      "asOf": "2026-11-17"
    },
    "F267": {
      "label": "Pick reason, sqlmodel",
      "display": "one class serves as Pydantic model and SQLAlchemy table",
      "asOf": "2026-11-17"
    },
    "F268": {
      "label": "Developer need, piccolo",
      "display": "Async app with admin and migrations",
      "asOf": "2026-11-17"
    },
    "F269": {
      "label": "Pick reason, piccolo",
      "display": "includes migrations, authentication, and an admin GUI",
      "asOf": "2026-11-17"
    },
    "F270": {
      "label": "Developer need, ormar",
      "display": "One model for API and database",
      "asOf": "2026-11-17"
    },
    "F271": {
      "label": "Pick reason, ormar",
      "display": "async ORM whose models are also Pydantic models",
      "asOf": "2026-11-17"
    },
    "F272": {
      "label": "Strength, django",
      "display": "Migrations included",
      "asOf": "2026-11-17"
    },
    "F273": {
      "label": "Strength body, django",
      "display": "makemigrations writes migrations from model changes, and migrate applies them.",
      "asOf": "2026-11-17"
    },
    "F274": {
      "label": "Limit, django",
      "display": "Transactions run synchronously",
      "asOf": "2026-11-17"
    },
    "F275": {
      "label": "Limit body, django",
      "display": "Async code wraps transactional ORM work in a synchronous function called through sync_to_async.",
      "asOf": "2026-11-17"
    },
    "F276": {
      "label": "Strength, sqlmodel",
      "display": "One model, two roles",
      "asOf": "2026-11-17"
    },
    "F277": {
      "label": "Strength body, sqlmodel",
      "display": "A single class works as the Pydantic model and the SQLAlchemy table.",
      "asOf": "2026-11-17"
    },
    "F278": {
      "label": "Strength, piccolo",
      "display": "Migrations and admin included",
      "asOf": "2026-11-17"
    },
    "F279": {
      "label": "Strength body, piccolo",
      "display": "The package ships a User model, authentication, migrations, and an admin GUI.",
      "asOf": "2026-11-17"
    },
    "F280": {
      "label": "Strength, ormar",
      "display": "Pydantic models as tables",
      "asOf": "2026-11-17"
    },
    "F281": {
      "label": "Strength body, ormar",
      "display": "Each model validates data with Pydantic and maps a table.",
      "asOf": "2026-11-17"
    },
    "F282": {
      "label": "Limit, ormar",
      "display": "Migrations through Alembic",
      "asOf": "2026-11-17"
    },
    "F283": {
      "label": "Limit body, ormar",
      "display": "Tables are based on SQLAlchemy, so schema migrations run through Alembic.",
      "asOf": "2026-11-17"
    }
  },
  "dataCheckedAt": "2026-11-19",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python database ORM libraries SQLAlchemy Peewee Tortoise Pony code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
