Full Stack Python logo Full Stack Python

全部主题 | Blog | 时讯 | @fullstackpython | Facebook | 源码

Peewee

Peewee (source code) is a object-relational mapper (ORM) implementation for bridging data stored in relational database tables with Python objects.

Peewee logo.

What makes Peewee a useful ORM?

Peewee can be an easier library to wrap your head around than SQLAlchemy and other ORMs. It is designed to be easier to hack on and understand, similar to how Bottle is a smaller, one-file web framework compared to the comprehensive Django framework. If you are just getting started with web development, it may be worth using Peewee for your database mapping and operations, especially if you use a microframework such as Flask or Bottle.

Peewee can be used with pretty much any web framework (although using it with Django would currently be complicated due to its tight built-in ORM coupling) or without a web framework. In the latter case Peewee is good for pulling data out of a relational database in a script or Jupyter notebook.

Any of the common relational database backends such as PostgreSQL, MySQL or SQLite are supported, although a database driver is still required. The chart below shows a few example configurations that could use Peewee as an ORM.

Example SQLAlchemy configurations with different web frameworks.

Peewee is an implementation of the object-relational mapping (ORM) concept. Learn more in the data chapter or view all topics.

How does Peewee compare to other Python ORMs?

The analogy used by the core Peewee author is that Peewee is to SQLAlchemy as SQLite is to PostgreSQL. An ORM does not have to work for every exhaustive use case in order to be useful.

Peewee resources

Peewee is a much newer library than several other Python ORMs. For example, Peewee's first public commit was in 2010, compared to 2005 for SQLAlchemy. The project is still over five years old though and matured substantially in development during that time. However, there are typically less resources and examples available to demonstrate how to use Peewee in your projects than some other ORMs that have been around for a longer period of time.

Many of the best resources come from the project's author, Charles Leifer, on his blog and on the official site. There are also hundreds of questions answered on the Stack Overflow peewee tag, so as usual that can be a rich source of examples for your Peewee-powered Python applications.

关于构建 Python Web 应用你想学习什么?

告诉我有关标准关系型数据库的知识。

那些时髦的开发者一直谈论的 NoSQL 数据存储到底是什么?

我想知道在 Python 中如何处理数据。

#### 在这里注册以便每月能收到一份邮件资料,内容包含本站的主要更新、教程和 Python 书籍的打折码等。

The Full Stack Python Guide to Deployments 想找到一个完整的,一步一步的部署方案吗?请看《The Full Stack Python Guide to Deployments》.

邮件获取更新

##### 注册以便每月能收到一份邮件资料,内容包含本站的主要更新和 Python 教程。

目录

1. 简介学习编程为什么用 Python?Python 2 还是 3?企业 PythonPython CommunityBest Python Podcasts最佳 Python 资源最佳 Python 视频2. 开发环境VimEmacs3. 核心语言生成器推导式4. Web 开发Web 框架DjangoFlaskBottlePyramidMorepath其它 Web 框架Web 设计级联样式表 (CSS)JavaScriptWebSockets模板引擎Web 应用安全静态网站生成器Jinja25. 数据关系型数据库NoSQL 数据存储对象关系映射器PostgreSQLMySQLSQLite6. Web APIsAPI 集成API 的创建Twilio7. 部署服务器平台即服务(PaaS)操作系统Web 服务器WSGI 服务器源码控制应用程序依赖静态内容任务队列配置管理持续集成日志监控Web 分析Docker缓存微服务DevOpsNginxApache HTTP 服务器CaddyGreen Unicorn (Gunicorn)UbuntuPelicanLektorMkDocs8. 测试单元测试集成测试代码度量调试9. MetaBotsChange LogFuture DirectionsAbout the AuthorSQLAlchemyPeewee …或者显示全部目录内容.

Peewee

重要的更新内容会通过 Twitter 账号@fullstackpython发布。


需要更加详细的教程吗?请看 《The Full Stack Python Guide to Deployments》。

Chapters

1. 简介2. 开发环境3. 核心语言4. Web 开发5. 数据6. Web APIs7. 部署8. 测试9. Meta » Peewee …or view the full table of contents.


This site is based on Matt Makai's project Full Stack Python, thanks for his excellent work!

此网站由 @haiiiiiyun开源爱好者们 共同维护。 若发现错误或想贡献,请访问: Github fullstackpython.cn 项目