Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Simple and easy rocksdb client for python.
NOTE: This client dosen't fully support rocksdb. Only the basic usage of rocksdb is supported.
We need to install and build rocksdb alongside rocksdb-python.
From source:
apt-get install build-essential libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
git clone https://github.com/facebook/rocksdb.git
cd rocksdb
mkdir build
cd build
make shared_lib
Choose where to install rocksdb after building
You can install rocksdb shared library in /usr/lib/
(systemwide) using:
make install-shared INSTALL_PATH=/usr
make uninstall INSTALL_PATH=/usr
If you don't like to install it systemwide you can set the following environment variables which will help the compiler to find rocksdb:
export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}:`pwd`/../include
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:`pwd`
export LIBRARY_PATH=${LIBRARY_PATH}:`pwd`
Using pip:
pip install rocksdb-python
From source (development version):
pip install git+https://github.com/AYMENJD/rocksdb-python
import rocksdb, asyncio
async def main():
db = rocksdb.RocksDB(db_path="myrocksdb/", options=rocksdb.Options(create_if_missing=True))
key = "123-456-789"
response = await db.put(rocksdb.WriteOptions(), key, "Hello world. Bye!")
if response.status.ok: # You always need to check if the request success.
get_value = await db.get(rocksdb.ReadOptions(), key)
print(get_value.value) # Hello world. Bye!
await db.delete(rocksdb.WriteOptions(), key)
else:
print(get_value.status.to_dict())
await db.close()
asyncio.run(main())
Check Documentation for more.
Pull requests are always welcome!!
MIT License
FAQs
Simple and easy rocksdb client for python
We found that Rocksdb-python demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.