Try our Chrome extension
Easily add the current web-page from your browser directly into your changedetection.io tool, more great features coming soon!Changedetection.io needs your support!
You can help us by supporting changedetection.io on these platforms;
- Rate us at AlternativeTo.net
- Star us on GitHub
- Follow us at Twitter/X
- G2 Software reviews
- Check us out on LinkedIn
- And tell your friends and colleagues :)
The more popular changedetection.io is, the more time we can dedicate to adding amazing features!
Many thanks :)
changedetection.io team
Еще нет секунды назад
False
Еще нет секунды назад
Триггерный текст Игнорируемый текст Заблокированный текст
6 минут назад
Skip to content
Navigation Menu
Sign in Appearance settings
* Platform
+ AI CODE CREATION
o GitHub Copilot Write better code with AI
o GitHub Copilot app Direct agents from issue to merge
o MCP Registry Integrate external tools
+ DEVELOPER WORKFLOWS
o Actions Automate any workflow
o Codespaces Instant dev environments
o Issues Plan and track work
o Code Review Manage code changes
o Code Quality Enforce quality at merge
+ APPLICATION SECURITY
o GitHub Advanced Security Find and fix vulnerabilities
o Code security Secure your code as you build
o Secret protection Stop leaks before they start
+ EXPLORE
o Why GitHub
o Documentation
o Blog
o Changelog
o Marketplace
View all features
* Solutions
+ BY COMPANY SIZE
o Enterprises
o Small and medium teams
o Startups
o Nonprofits
+ BY USE CASE
o App Modernization
o DevSecOps
o DevOps
o CI/CD
o View all use cases
+ BY INDUSTRY
o Healthcare
o Financial services
o Manufacturing
o Government
o View all industries
View all solutions
* Resources
+ EXPLORE BY TOPIC
o AI
o Software Development
o DevOps
o Security
o View all topics
+ EXPLORE BY TYPE
o Customer stories
o Events & webinars
o Ebooks & reports
o Business insights
o GitHub Skills
+ SUPPORT & SERVICES
o Documentation
o Customer support
o Community forum
o Trust center
o Partners
View all resources
* Open Source
+ COMMUNITY
o GitHub Sponsors Fund open source developers
+ PROGRAMS
o Security Lab
o Maintainer Community
o Accelerator
o GitHub Stars
o Archive Program
+ REPOSITORIES
o Topics
o Trending
o Collections
* Enterprise
+ ENTERPRISE SOLUTIONS
o Enterprise platform AI-powered developer platform
+ AVAILABLE ADD-ONS
o GitHub Advanced Security Enterprise-grade security features
o Copilot for Business Enterprise-grade AI features
o Premium Support Enterprise-grade 24/7 support
* Pricing
Type / to search
Sign in
Sign up Appearance settings
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Uh oh!
There was an error while loading. Please reload this page.
fastapi / sqlmodel Public
* Uh oh!
There was an error while loading. Please reload this page.
* Notifications You must be signed in to change notification settings
* Fork 884
* Star 18.3k
* Code
* Issues 1
* Pull requests 59
* Discussions
* Actions
* Projects
* Security and quality 0
* Insights
Additional navigation options
* Code
* Issues
* Pull requests
* Discussions
* Actions
* Projects
* Security and quality
* Insights
main
Branches Tags
Go to file
Code
Open more actions menu
Folders and files
Name Name Last commit message Last commit date
Latest commit
History
1,333 Commits
1,333 Commits
.github .github
data data
docs docs
docs_src docs_src
scripts scripts
sqlmodel sqlmodel
tests tests
.gitignore .gitignore
.pre-commit-config.yaml .pre-commit-config.yaml
.python-version .python-version
CITATION.cff CITATION.cff
LICENSE LICENSE
README.md README.md
mkdocs.env.yml mkdocs.env.yml
mkdocs.yml mkdocs.yml
pyproject.toml pyproject.toml
uv.lock uv.lock
View all files
Repository files navigation
*
* README
* Contributing
* MIT license
* Security
More items
SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.
Documentation: https://sqlmodel.tiangolo.com
Source Code: https://github.com/fastapi/sqlmodel
SQLModel is a library for interacting with SQL databases from Python code, with Python objects. It is designed to be intuitive, easy to use, highly compatible, and robust.
SQLModel is based on Python type annotations, and powered by Pydantic and SQLAlchemy.
The key features are:
* Intuitive to write: Great editor support. Completion everywhere. Less time debugging. Designed to be easy to use and learn. Less time reading docs.
* Easy to use: It has sensible defaults and does a lot of work underneath to simplify the code you write.
* Compatible: It is designed to be compatible with FastAPI, Pydantic, and SQLAlchemy.
* Extensible: You have all the power of SQLAlchemy and Pydantic underneath.
* Short: Minimize code duplication. A single type annotation does a lot of work. No need to duplicate models in SQLAlchemy and Pydantic.
Sponsors
SQL Databases in FastAPI
SQLModel is designed to simplify interacting with SQL databases in FastAPI applications, it was created by the same author. 😁
It combines SQLAlchemy and Pydantic and tries to simplify the code you write as much as possible, allowing you to reduce the code duplication to a minimum, but while getting the best developer experience possible.
SQLModel is, in fact, a thin layer on top of Pydantic and SQLAlchemy, carefully designed to be compatible with both.
Requirements
A recent and currently supported version of Python.
As SQLModel is based on Pydantic and SQLAlchemy, it requires them. They will be automatically installed when you install SQLModel.
Installation
First, install uv, and then add SQLModel to your project:
$ uv add sqlmodel
---> 100%
If you prefer to use pip, install sqlmodel inside a virtual environment. See the installation guide for the alternative steps.
Example
For an introduction to databases, SQL, and everything else, see the SQLModel documentation.
Here's a quick example. ✨
A SQL Table
Imagine you have a SQL table called hero with:
* id
* name
* secret_name
* age
And you want it to have this data:
id name secret_name age
1 Deadpond Dive Wilson null
2 Spider-Boy Pedro Parqueador null
3 Rusty-Man Tommy Sharp 48
Create a SQLModel Model
Then you could create a SQLModel model like this:
from sqlmodel import Field, SQLModel
class Hero(SQLModel, table=True):
id: int | None = Field(default=None, primary_key=True)
name: str
secret_name: str
age: int | None = None
That class Hero is a SQLModel model, the equivalent of a SQL table in Python code.
And each of those class attributes is equivalent to each table column.
Create Rows
Then you could create each row of the table as an instance of the model:
hero_1 = Hero(name="Deadpond", secret_name="Dive Wilson")
hero_2 = Hero(name="Spider-Boy", secret_name="Pedro Parqueador")
hero_3 = Hero(name="Rusty-Man", secret_name="Tommy Sharp", age=48)
This way, you can use conventional Python code with classes and instances that represent tables and rows, and that way communicate with the SQL database.
Editor Support
Everything is designed for you to get the best developer experience possible, with the best editor support.
Including autocompletion:
And inline errors:
Write to the Database
You can learn a lot more about SQLModel by quickly following the tutorial, but if you need a taste right now of how to put all that together and save to the database, you can do this:
from sqlmodel import Field, Session, SQLModel, create_engine
class Hero(SQLModel, table=True):
id: int | None = Field(default=None, primary_key=True)
name: str
secret_name: str
age: int | None = None
hero_1 = Hero(name="Deadpond", secret_name="Dive Wilson")
hero_2 = Hero(name="Spider-Boy", secret_name="Pedro Parqueador")
hero_3 = Hero(name="Rusty-Man", secret_name="Tommy Sharp", age=48)
engine = create_engine("sqlite:///database.db")
SQLModel.metadata.create_all(engine)
with Session(engine) as session:
session.add(hero_1)
session.add(hero_2)
session.add(hero_3)
session.commit()
That will save a SQLite database with the 3 heroes.
Select from the Database
Then you could write queries to select from that same database, for example with:
from sqlmodel import Field, Session, SQLModel, create_engine, select
class Hero(SQLModel, table=True):
id: int | None = Field(default=None, primary_key=True)
name: str
secret_name: str
age: int | None = None
engine = create_engine("sqlite:///database.db")
with Session(engine) as session:
statement = select(Hero).where(Hero.name == "Spider-Boy")
hero = session.exec(statement).first()
print(hero)
Editor Support Everywhere
SQLModel was carefully designed to give you the best developer experience and editor support, even after selecting data from the database:
SQLAlchemy and Pydantic
That class Hero is a SQLModel model.
But at the same time, ✨ it is a SQLAlchemy model ✨. So, you can combine it and use it with other SQLAlchemy models, or you could easily migrate applications with SQLAlchemy to SQLModel.
And at the same time, ✨ it is also a Pydantic model ✨. You can use inheritance with it to define all your data models while avoiding code duplication. That makes it very easy to use with FastAPI.
License
This project is licensed under the terms of the MIT license.
About
SQL databases in Python, designed for simplicity, compatibility, and robustness.
sqlmodel.tiangolo.com/
Topics
fastapijsonjson-schemapydanticpythonsqlsqlalchemy
Resources
Readme
MIT license
Contributing
Contributing
Security policy
Security policy
Cite this repository
Activity
Custom properties
Stars
18.3k stars
Watchers
127 watching
Forks
884 forks
Report repository
Releases
Sponsor this project
Packages
Used by
Contributors
Languages
Footer
© 2026 GitHub, Inc.
Footer navigation
* Terms
* Privacy
* Security
* Status
* Community
* Docs
* Contact
* Manage cookies
* Do not share my personal information
You can’t perform that action at this time.
На данный момент различия выполняются в текстовом виде, а не графически, доступен только последний скриншот.
Для создания снимков экрана требуется сборщик контента (Sockpuppetbrowser, selenium и т. д.), поддерживающий снимки экрана.