Skip to main content

A simple yet beautiful ORM for Python

Project description

Orbit-Orator

Orbit-Orator 是一个简单而优雅的 Python ORM,基于 Orator ORM 进行二次开发。

安装

pip install orbit-orator

快速开始

from orbit_orator import DatabaseManager, Model

# 配置数据库连接
config = {
    'mysql': {
        'driver': 'mysql',
        'host': 'localhost',
        'database': 'database',
        'user': 'user',
        'password': 'password',
        'prefix': ''
    }
}

# 初始化数据库连接
db = DatabaseManager(config)
Model.set_connection_resolver(db)

# 定义模型
class User(Model):
    __fillable__ = ['name', 'email']

# 创建记录
user = User.create(name='John', email='john@example.com')

# 查询记录
user = User.where('name', 'John').first()

特性

  • 简单而优雅的 API
  • 支持多种数据库(MySQL, PostgreSQL, SQLite)
  • 支持模型关系
  • 支持查询构建器
  • 支持数据库迁移
  • 支持事务处理

文档

详细文档请访问 文档网站

许可证

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orbit_orator-0.9.9.2.tar.gz (299.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orbit_orator-0.9.9.2-py3-none-any.whl (170.0 kB view details)

Uploaded Python 3

File details

Details for the file orbit_orator-0.9.9.2.tar.gz.

File metadata

  • Download URL: orbit_orator-0.9.9.2.tar.gz
  • Upload date:
  • Size: 299.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for orbit_orator-0.9.9.2.tar.gz
Algorithm Hash digest
SHA256 fc92baeea2e12c09861083cecefac40af630313dd7bb743a3d03f4282d66e00b
MD5 87a3dcef1dc80793f2d552b8012db677
BLAKE2b-256 18296616b047ff4817831759dae00c5f85eb84d01d26508d22b9e98c220c63a8

See more details on using hashes here.

File details

Details for the file orbit_orator-0.9.9.2-py3-none-any.whl.

File metadata

  • Download URL: orbit_orator-0.9.9.2-py3-none-any.whl
  • Upload date:
  • Size: 170.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for orbit_orator-0.9.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 542c3820b7123da54f7b98bddd6a011a6377bbc4a49be334599ad6a904f805ea
MD5 3a09dfe1f6d8c159e403c7617c102c6b
BLAKE2b-256 3139140b4166d90cbfb8948a284edf394048eef30af623d3aace4aa46f2bf49b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page