Skip to main content

Sqlee

由中国左旋联盟开阳信息序列开发的基于Gitee API搭建的数据存储系统.

安装

你可以通过命令pip install sqlee或python -m pip install sqlee来安装Sqlee数据库.

Sqlee目录树

├─utils
│  │  backend.py
│  │  crypto.py
│  │  exceptions.py
│  │  gitee.py
│  │  urlparse.py
│  │  __init__.py
│  │
│  └─django
│        handler.py
│        models.py
│        verify.py
│        __init__.py
├─sqlee.py
└─__init__.py

基本使用

创建新的Sqlee数据库

from sqlee.utils import gitee
gitee.make_repo(name="数据库名", token="Gitee API Token", user="Gitee用户名")

连接已有的Sqlee数据库

你可以使用以下代码来创建一个新的数据库实例:

import sqlee

db = sqlee.connect(
        access_token = "你的Gitee API Token",
        user = "你的Gitee用户名",
        name = "你的数据库名",
    )

创建表

db.objects.create(name="表名", namespace=["索引", "命名域1", "命名域2"])

删除表

db.objects.delete(name="表名")

读取表

db.objects.all() #读取所有表(同时捕获所有数据)
db.objects.get(name="实例表名") #读取指定数据表(同时捕获该表所有数据)
db.objects.get(name="实例表名", directly_load=False) #读取指定数据表(但不捕获该表所有数据)

数据的读取与筛选

table = db.objects.get(name="Table")
table.objects.all() #读取全部的数据
table.objects.create(index=0, name1=1, name2=2) #创建新的数据
table.objects.get(index=0) #读取索引为 int 0 的数据(如果筛选出了多个数据,它将抛出异常)
table.objects.get(index=0).delete() #删除索引为 int 0 的数据
table.objects.filter(name1=1) #筛选命名域 name1 值为 int 1 的数据栏

Sqlee和其它的数据库不同,它并不强制你在同一栏的同一命名域中使用同样类型的数据,同时,任何数据对于Sqlee来说都是可被存储的。同时,Sqlee和其它的数据库不同,它的索引并不一定为int id,它同样可以是str index,当然,你同样可以将命名域的第一位设置为id,但是在创建新的数据栏时,你不必传入栏id的数据,否则它将抛出ValueError的异常. 值得注意的是,如果你采用索引来读取和筛选数据,它将提供一个更加迅捷的查询.

命令行

db.interact()

版权

Copyright © 2011-2021 中国左旋联盟 All Rights Reserved.

Metadata

Release files for sqlee 2.2.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlee 2.2.16
File Size Uploaded Provenance Actions
sqlee-2.2.16.tar.gz 14.0 kB Without provenance Details for sqlee-2.2.16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sqlee 2.2.16
File Interpreter ABI Platform Actions
sqlee-2.2.16-py3-none-any.whl Python 3 none any Details for sqlee-2.2.16-py3-none-any.whl

Total release size: 30.3 kB

Release files / sqlee-2.2.16.tar.gz

Download URL sqlee-2.2.16.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ac910c7a5fb7872b09f83bc69920501c0d6a37ce83c07e7f25f489df47c301a0
BLAKE2b-256 checksum
How to use checksums
9b641c906483f885426ac7ddc399e1d4270d9f7e53dafefb92679c976411f32a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.3

Release files / sqlee-2.2.16-py3-none-any.whl

Download URL sqlee-2.2.16-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
728b811954a8e9653c1ea1dfa9f906668318704b6afd1d79c20e43c392457ba1
BLAKE2b-256 checksum
How to use checksums
5336be93b31f51ed845fb313cbb2c8a759735051fc62fc36722f381d976963ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.3

Security for sqlee 2.2.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.2.16 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page