mongo-tfrecords - Library that exports mongodb data to tensorflow files (tf-record)
pip install mongo-tfrecords
# from bash
python3 -m mongo_tfrecords
# api docs
python3 -m mongo_tfrecords --help
# from python
from mongo_tfrecords import export
export(
collection="test",
database="mongodb://user:password@hostname:27017/database_name?authSource=admin",
path="/path/to/",
files_template="{}.tfrecord",
count_per_file=100000, # count items per one file
features=["field1", "field2"], # fields [int, float, string, bytes, ...],
skip=10,
limit=10000,
verbose=True, # show progress bar
)
Apache License 2.0 (See LICENSE)
Copyright 2020, Vadim Sharay