'Using blockchain_parser to parse blk files stored on S3

I'm trying to use alecalve's bitcoin-parser pkg for python. The problem is, my node is saved on an s3 bucket. As the parser uses os.path.expanduser for the .dat files dir, expecting a filesystem, I can't just use my s3 path. The example from the documentation is:

import os
from blockchain_parser.blockchain import Blockchain


blockchain = Blockchain(os.path.expanduser('~/.bitcoin/blocks'))
for block in blockchain.get_ordered_blocks(os.path.expanduser('~/.bitcoin/blocks/index'), end=1000):
    print("height=%d block=%s" % (block.height, block.hash))

And the error I'm getting is as follows:

'name' arg must be a byte string or a unicode string

Is there a way to use s3fs or any different s3-to-filesystem method to use the s3 paths as dirs for the parser to work as intended?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source