Skip to main content

使用手册

快速开始

import mapdb

# default map db file : {userHome}/sqlitemap.db

# 写普通属性
mapdb.put("int", 20)
mapdb.put("float", 1.75)
mapdb.put("bool", False)
mapdb.put("string", 'kancy')
mapdb.put("hobby", ["play games"])
mapdb.putBytes("bytes", b"I am bytearray.")

print(mapdb.gets(['int', 'float', 'bool', 'string', 'hobby', 'bytes']))

# 写json
json = {
    "name":"kancy",
    "age":20,
    "height":1.75,
    "hobby":["play games"],
    "map":{
        "k":"v"
    }
}
mapdb.put("json", json)
print(mapdb.get("json"))
print(mapdb.get().getJson("json"))

# 写文件
mapdb.putFile("textfile", "data/text.txt")
mapdb.putFile("imgfile", "data/img.png")
mapdb.getFile("textfile", "data/text.txt")
mapdb.getFile("imgfile", "data/img.png")

自定义MapDB

import mapdb

# SQLite实现
db1 = mapdb.SQLiteMapDB(debug=True)

# MySQL实现
db2 = mapdb.MySQLMapDB(host="localhost", username="root", password="root")

Metadata

Release files for mapdb 0.0.1

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

Source distribution (sdist)

Source distribution for mapdb 0.0.1
File Size Uploaded Provenance
mapdb-0.0.1.tar.gz 6.0 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for mapdb 0.0.1
File Interpreter ABI Platform
mapdb-0.0.1-py3.9.egg Legacy Egg format - - Details
mapdb-0.0.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 19.9 kB

Release files / mapdb-0.0.1.tar.gz

Download URL mapdb-0.0.1.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b28f074d13aa389971c7636d0da8972a1807cb8cc74dfa9a1256250e11544e1b
BLAKE2b-256 checksum
How to use checksums
aabf8b8ebae35b600c13941501035f5ffc88b7250e954b7d1bf3feb9183960d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / mapdb-0.0.1-py3.9.egg

Download URL mapdb-0.0.1-py3.9.egg
Size 9.5 kB
Tags Egg
SHA-256 checksum
How to use checksums
a252a76e4aa712b7892a9a46aa003266a5ad2c6f97b664e8392a54431682b366
BLAKE2b-256 checksum
How to use checksums
9196bce81ef5df2b3ce1f1698c72c806721c2dcfdb4a8099a515245f4ff1c822
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / mapdb-0.0.1-py2.py3-none-any.whl

Download URL mapdb-0.0.1-py2.py3-none-any.whl
Size 4.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d34f9e9a0b6ab8b1e039a32dbc6a73c6bf39664d7ee3e858cca25f847b41dff5
BLAKE2b-256 checksum
How to use checksums
8b7455bd5aebcb80dc0b91adbc5a6f3a88bd2decd9460752d249e8622658573e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Security for mapdb 0.0.1

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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

3 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