Skip to main content

简单的kv数据操作工具。

Project description

使用手册

快速开始

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")

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

mapdb-0.0.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distributions

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

mapdb-0.0.1-py3.9.egg (9.5 kB view details)

Uploaded Egg

mapdb-0.0.1-py2.py3-none-any.whl (4.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mapdb-0.0.1.tar.gz.

File metadata

  • Download URL: mapdb-0.0.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for mapdb-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b28f074d13aa389971c7636d0da8972a1807cb8cc74dfa9a1256250e11544e1b
MD5 624ffa8327e3deb65b4284f6b6e0979e
BLAKE2b-256 aabf8b8ebae35b600c13941501035f5ffc88b7250e954b7d1bf3feb9183960d5

See more details on using hashes here.

File details

Details for the file mapdb-0.0.1-py3.9.egg.

File metadata

  • Download URL: mapdb-0.0.1-py3.9.egg
  • Upload date:
  • Size: 9.5 kB
  • Tags: Egg
  • Uploaded using 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

File hashes

Hashes for mapdb-0.0.1-py3.9.egg
Algorithm Hash digest
SHA256 a252a76e4aa712b7892a9a46aa003266a5ad2c6f97b664e8392a54431682b366
MD5 336b0dd433c502586c6c5f5b7549a6b9
BLAKE2b-256 9196bce81ef5df2b3ce1f1698c72c806721c2dcfdb4a8099a515245f4ff1c822

See more details on using hashes here.

File details

Details for the file mapdb-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: mapdb-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for mapdb-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d34f9e9a0b6ab8b1e039a32dbc6a73c6bf39664d7ee3e858cca25f847b41dff5
MD5 692a8a12f36787ebf1fcf47ee8721078
BLAKE2b-256 8b7455bd5aebcb80dc0b91adbc5a6f3a88bd2decd9460752d249e8622658573e

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