User:Jberkel/partial decompress

Hello, you have come here looking for the meaning of the word User:Jberkel/partial decompress. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:Jberkel/partial decompress, but we will also tell you about its etymology, its characteristics and you will know how to say User:Jberkel/partial decompress in singular and plural. Everything you need to know about the word User:Jberkel/partial decompress you have here. The definition of the word User:Jberkel/partial decompress will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:Jberkel/partial decompress, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

A short Python script to partially decompress multistream mediawiki dumps. Also see Wiktionary:Grease_pit/2015/February#multi-stream_bz2_Wiktionary_dumps.

#!/usr/bin/env python

from bz2 import BZ2Decompressor

decompressor = BZ2Decompressor()
offset = 39191316

with open("enwiktionary-20150224-pages-articles-multistream.xml.bz2") as f:
    f.seek(offset, 0)
    while True:
        bytes = f.read(8192)
        if bytes:
            try:
                result = decompressor.decompress(bytes)
                if result:
                    print result
            except EOFError:
                break # current stream finished
        else:
            break # EOF