We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there some MacOs Install instructions ?
The text was updated successfully, but these errors were encountered:
Check this out. Prebuilt: just pip install rocksdict without any fuss of compiling.
pip install rocksdict
https://github.com/Congyuwang/RocksDict
A RocksDB-based python on-disk dict.
It is also easy to use.
from rocksdict import Rdict import numpy as np import pandas as pd path = str("./test_dict") # create a Rdict with default options at `path` db = Rdict(path) db[1.0] = 1 db[1] = 1.0 db["huge integer"] = 2343546543243564534233536434567543 db["good"] = True db["bad"] = False db["bytes"] = b"bytes" db["this is a list"] = [1, 2, 3] db["store a dict"] = {0: 1} db[b"numpy"] = np.array([1, 2, 3]) db["a table"] = pd.DataFrame({"a": [1, 2], "b": [2, 1]}) # close Rdict db.close() # reopen Rdict from disk db = Rdict(path) assert db[1.0] == 1 assert db[1] == 1.0 assert db["huge integer"] == 2343546543243564534233536434567543 assert db["good"] == True assert db["bad"] == False assert db["bytes"] == b"bytes" assert db["this is a list"] == [1, 2, 3] assert db["store a dict"] == {0: 1} assert np.all(db[b"numpy"] == np.array([1, 2, 3])) assert np.all(db["a table"] == pd.DataFrame({"a": [1, 2], "b": [2, 1]})) # iterate through all elements for k, v in db.items(): print(f"{k} -> {v}") # batch get: print(db[["good", "bad", 1.0]]) # [True, False, 1] # delete Rdict from dict db.close() Rdict.destroy(path)
Sorry, something went wrong.
No branches or pull requests
Is there some MacOs Install instructions ?
The text was updated successfully, but these errors were encountered: