This Rust crate, when built using the PyO3 project's maturin tool, produces a Python module that can be used to access the keyring ecosystem from Python. The built module is available on PyPI in the rust-native-keyring project; use
pip install rust-native-keyringto install it and
import rust_native_keyringto load it into your Python REPL. Here is a sample of what you can do:
import rust_native_keyring as rnk
rnk.use_named_store("sample", { 'backing-file': 'sample-test.ron' })
rnk.store_info()
entry = rnk.Entry('service', 'user')
entry.set_password('test password')
entry.info()
entry.get_credential().info()
if entry.get_password() == 'test password':
print('Passwords match!')
e2 = rnk.Entry('service', 'user2')
e2.set_password('test password 2')
entries = rnk.Entry.search({ 'service': 'service' })
print(list(map(lambda e: e.info(), entries)))
rnk.release_store()The crate doc gives more details on the API.
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.