标签(空格分隔): python leveldb


import leveldb

db = leveldb.LevelDB('./db')

db.Put('hello', 'world')
print db.Get('hello') db.Delete('hello')
print db.Get('hello') batch = leveldb.WriteBatch()
batch.Put('hello', 'world')
batch.Put('hello again', 'world')
batch.Delete('hello')
db.Write(batch, sync = True)

class LevelDB(builtin.object) | LevelDB(filename, **kwargs) -> leveldb object |
| Open a LevelDB database, from the given directory. |
| Only the parameter filename is mandatory. |
| filename the database directory | create_if_missing (default: True) if True, creates a new database if none exists | error_if_exists (default: False) if True, raises and error if the database already exists | paranoid_checks (default: False) if True, raises an error as soon as an internal corruption is detected | block_cache_size (default: 8 * (2 << 20)) maximum allowed size for the block cache in bytes | write_buffer_size (default 2 * (2 << 20))
| block_size (default: 4096) unit of transfer for the block cache in bytes | max_open_files: (default: 1000) | block_restart_interval
|
| Snappy compression is used, if available. |
| Some methods support the following parameters, having these semantics: |
| verify_checksum: iff True, the operation will check for checksum mismatches | fill_cache: iff True, the operation will fill the cache with the data read | sync: iff True, the operation will be guaranteed to sync the operation to disk | | Methods supported are: | | Get(key, verify_checksums = False, fill_cache = True): get value, raises KeyError if key not found | | key: the query key |
| Put(key, value, sync = False): put key/value pair |
| key: the key | value: the value |
| Delete(key, sync = False): delete key/value pair, raises no error kf key not found | | key: the key |
| Write(write_batch, sync = False): apply multiple put/delete operations atomatically |
| write_batch: the WriteBatch object holding the operations |
| RangeIter(key_from = None, key_to = None, include_value = True, verify_checksums = False, fill_cache = True): return iterator |
| key_from: if not None: defines lower bound (inclusive) for iterator | key_to: if not None: defined upper bound (inclusive) for iterator | include_value: if True, iterator returns key/value 2-tuples, otherwise, just keys |
| GetStats(): get a string of runtime information
class WriteBatch(builtin.object) | WriteBatch() -> write batch object |
| Create an object, which can hold a list of database operations, which | can be applied atomically. |
| Methods supported are: |
| Put(key, value): add put operation to batch |
| key: the key | value: the value |
| Delete(key): add delete operation to batch |
| key: the key |
'CompactRange',
'CreateSnapshot',
'Delete',
'Get',
'GetStats',
'Put',
'RangeIter',//通过Key进行切片处理,因为所有的存储都是有序的
'Write',
'__class__',
'__delattr__',
'__doc__',
'__format__',
'__getattribute__',
'__hash__',
'__init__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__']

python leveldb 文档的更多相关文章

  1. 如何在命令行模式下查看Python帮助文档---dir、help、__doc__

    如何在命令行模式下查看Python帮助文档---dir.help.__doc__ 1.dir函数式可以查看对象的属性,使用方法很简单,举str类型为例,在Python命令窗口输入 dir(str) 即 ...

  2. python统计文档中词频

    python统计文档中词频的小程序 python版本2.7 效果如下: 程序如下,测试文件与完整程序在我的github中 #统计空格数与单词数 本函数只返回了空格数 需要的可以自己返回多个值 def ...

  3. 在命令行模式下查看Python帮助文档---dir、help、__doc__

    在命令行模式下查看Python帮助文档---dir.help.__doc__   1.dir函数式可以查看对象的属性,使用方法很简单,举str类型为例,在Python命令窗口输入 dir(str) 即 ...

  4. Python帮助文档中Iteration iterator iterable 的理解

    iteration这个单词,是循环,迭代的意思.也就是说,一次又一次地重复做某件事,叫做iteration.所以很多语言里面,循环的循环变量叫i,就是因为这个iteration. iteration指 ...

  5. 使用Python对文档单词进行计数

    做hacker.org上面的题目时,遇到了一个题目需要对RFC3280种长度为9的单词进行计数,并找出这些单词中出现次数最多的那个:Didactic Byte RFC3280文档有7000多行,靠人工 ...

  6. 三言两语聊Python模块–文档测试模块doctest

    doctest是属于测试模块里的一种,对注释文档里的示例进行检测. 给出一个例子: splitter.pydef split(line, types=None, delimiter=None): &q ...

  7. python 本地文档查看

    本地安装Python文档本地查看,在命令行中运行: python -m pydoc -p 1234 在浏览器中访问如下链接,就可以访问到本地文档: http://localhost:1234/ 本地文 ...

  8. 使用Sphinx生成本地的Python帮助文档

    第一步:安装Sphinx 首先我们需要安装Sphinx,如果已经安装了Anaconda,那么只需要使用如下命令即可安装,关于其中的参数 -c anaconda,可以在链接[1]中查看: conda i ...

  9. Python asyncio文档阅读摘要

    文档地址:https://docs.python.org/3/library/asyncio.html 文档第一句话说得很明白,asyncio是单线程并发,这种event loop架构是很多新型异步并 ...

随机推荐

  1. 身份认证系统(一)单WEB应用的身份认证

    身份认证技术,也就是所谓的登录功能,是现代WEB系统最常见的功能之一.本系列文章就试图为大家详细的介绍身份认证技术. Basic认证模式 Basic认证模式是较早被广泛应用的一种HTTP标准提供的认证 ...

  2. Linux - CentOS 7 yum方式快速安装MongoDB

    一.安装环境及配置yum # more /etc/redhat-release CentOS Linux release 7.2.1511 (Core) # vi /etc/yum.repos.d/m ...

  3. 03.安装jdk8作为系统环境

    博客为日常工作学习积累总结: 1.安装JDK8 创建安装目录:mkdir /application/java8 解压-安装包自行下载:tar -zxf jdk-8u202-linux-x64.tar. ...

  4. Virtualization state: Optimized (version 7.4 installed)

    [Virtualization state: Optimized (version 7.4 installed)] [root@localhost ~]# cd /mnt/ [root@localho ...

  5. shell脚本实现目录的“5S”作业

    shell,又称为命令解释器.首先它是一个软件,有很多个版本,现在最流行的为bash,它作为用户和内核沟通的中间桥梁,在系统中起着举足轻重的作用 shell脚本,是一个以.sh结尾的文件,里面是诸如l ...

  6. mongodb C++ Driver安装

    前言 mongocxx官网地址 http://mongocxx.org/?jmp=docs 本文的安装版本是:mongocxx-r3.2.0.tar.gz . 参考文档安装过程http://mongo ...

  7. thinkphp5访问sql2000数据库

    大家都知道php跟mysql是绝配,但是因为有时候工作需要,要求php访问操作sql2000,怎么办呢? 一般来说有两种方式: 1. sqlsrv驱动方式 2. odbc方式 sqlsrv驱动方式,因 ...

  8. ES5拓展

    一.JSON拓展 1.JSON.parse(str,fun):将JSON字符串转为js对象 两个参数:str表示要处理的字符串:fun处理函数,函数有两个参数,属性名.属性值 // 定义json字符串 ...

  9. consonant_摩擦音

    consonant_摩擦音_[t∫].[dʒ].[tr].[dr].[ts].[dz] 破擦音:即有爆破音又有摩擦音. [t∫]:噘嘴,舌尖抵住上牙龈,舌头下切,用一瞬间的气流发出声音,不震动. ch ...

  10. Qt——模态、非模态

    模态: 只能操作对话框非模态:要使用 QDialog *_d = new QDialog();_d->setattribute(Qt::WA_DeleteOnClose);_d->show ...