python leveldb 文档
标签(空格分隔): 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 文档的更多相关文章
- 如何在命令行模式下查看Python帮助文档---dir、help、__doc__
如何在命令行模式下查看Python帮助文档---dir.help.__doc__ 1.dir函数式可以查看对象的属性,使用方法很简单,举str类型为例,在Python命令窗口输入 dir(str) 即 ...
- python统计文档中词频
python统计文档中词频的小程序 python版本2.7 效果如下: 程序如下,测试文件与完整程序在我的github中 #统计空格数与单词数 本函数只返回了空格数 需要的可以自己返回多个值 def ...
- 在命令行模式下查看Python帮助文档---dir、help、__doc__
在命令行模式下查看Python帮助文档---dir.help.__doc__ 1.dir函数式可以查看对象的属性,使用方法很简单,举str类型为例,在Python命令窗口输入 dir(str) 即 ...
- Python帮助文档中Iteration iterator iterable 的理解
iteration这个单词,是循环,迭代的意思.也就是说,一次又一次地重复做某件事,叫做iteration.所以很多语言里面,循环的循环变量叫i,就是因为这个iteration. iteration指 ...
- 使用Python对文档单词进行计数
做hacker.org上面的题目时,遇到了一个题目需要对RFC3280种长度为9的单词进行计数,并找出这些单词中出现次数最多的那个:Didactic Byte RFC3280文档有7000多行,靠人工 ...
- 三言两语聊Python模块–文档测试模块doctest
doctest是属于测试模块里的一种,对注释文档里的示例进行检测. 给出一个例子: splitter.pydef split(line, types=None, delimiter=None): &q ...
- python 本地文档查看
本地安装Python文档本地查看,在命令行中运行: python -m pydoc -p 1234 在浏览器中访问如下链接,就可以访问到本地文档: http://localhost:1234/ 本地文 ...
- 使用Sphinx生成本地的Python帮助文档
第一步:安装Sphinx 首先我们需要安装Sphinx,如果已经安装了Anaconda,那么只需要使用如下命令即可安装,关于其中的参数 -c anaconda,可以在链接[1]中查看: conda i ...
- Python asyncio文档阅读摘要
文档地址:https://docs.python.org/3/library/asyncio.html 文档第一句话说得很明白,asyncio是单线程并发,这种event loop架构是很多新型异步并 ...
随机推荐
- oracle导出sequences
将某个用户的全部sequence查询出来,并拼成创建语句: select 'create sequence '||sequence_name|| ' minvalue '||min_value|| ' ...
- mac Axure RP 8 授权码 以及汉化
Koshy wTADPqxn3KChzJxLmUr5jTTitCgsfRkftQQ1yIG9HmK83MYSm7GPxLREGn+Ii6xY 汉化包 汉化包链接 密码: upri 汉化步骤 以Win7 ...
- js函数和window对象
- 「PHP」简单工厂模式
引言 所属:创建型模式,常用设计模式之一 工厂模式分为:简单工厂模式.工厂方法模式.静态工厂模式.抽象工厂模式. 下面为简单工厂模式. 参考资料: <大话设计模式>程杰 模式概 ...
- django_orm 基本操作
单表操作 增的操作: 一种方式:表名.objects.create(name='xxoo') 第二种方式:表名(name='xxoo') obj=表名(name='xxoo') obj.save() ...
- python2x和python3x的一些区别
python2x:各种按照自己代码习惯给python贡献源码 python3x:重写之后的源码,优美,清晰,简单 版本 打印函数 rang函数 输入函数 python2x print 或 print( ...
- ruby 爬虫爬取拉钩网职位信息,产生词云报告
思路:1.获取拉勾网搜索到职位的页数 2.调用接口获取职位id 3.根据职位id访问页面,匹配出关键字 url访问采用unirest,由于拉钩反爬虫,短时间内频繁访问会被限制访问,所以没有采用多线程, ...
- BGP扩展属性
安全特性: BGP安全特性: MD5 GTSM:通用TTL安全保护机制通过对TTL的检测来达到防止攻击的目的,如果攻击者模拟真实的BGP协议报文(TCP),对一台路由器不断地发送报文,路由器接收报文后 ...
- java 用户修改密码
import java.util.Scanner; class Member { private String mima; private String name; public String get ...
- Mybatis中Mapper的Xml映射文件中,除了常见的select|insert|updae|delete标签之外,还有哪些标签?
还有很多其他的标签,<resultMap>.<parameterMap>.<sql>.<include>.<selectKey>,加上动态s ...