mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-07 14:58:56 +00:00
update
This commit is contained in:
31
docs/docs/content/02-examples/01-entry_management_demo.py
Normal file
31
docs/docs/content/02-examples/01-entry_management_demo.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from pathlib import Path
|
||||
from cryptography.fernet import Fernet
|
||||
|
||||
from password_manager.encryption import EncryptionManager
|
||||
from password_manager.vault import Vault
|
||||
from password_manager.entry_management import EntryManager
|
||||
from password_manager.backup import BackupManager
|
||||
from constants import initialize_app
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Demonstrate basic EntryManager usage."""
|
||||
initialize_app()
|
||||
key = Fernet.generate_key()
|
||||
enc = EncryptionManager(key, Path("."))
|
||||
vault = Vault(enc, Path("."))
|
||||
backup_mgr = BackupManager(Path("."))
|
||||
manager = EntryManager(vault, backup_mgr)
|
||||
|
||||
index = manager.add_entry(
|
||||
"Example Website",
|
||||
16,
|
||||
username="user123",
|
||||
url="https://example.com",
|
||||
)
|
||||
print(manager.retrieve_entry(index))
|
||||
manager.list_all_entries()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
15
docs/docs/content/02-examples/02-password_manager_demo.py
Normal file
15
docs/docs/content/02-examples/02-password_manager_demo.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from password_manager.manager import PasswordManager
|
||||
from nostr.client import NostrClient
|
||||
from constants import initialize_app
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Show how to initialise PasswordManager with Nostr support."""
|
||||
initialize_app()
|
||||
manager = PasswordManager()
|
||||
manager.nostr_client = NostrClient(encryption_manager=manager.encryption_manager)
|
||||
# Sample actions could be called on ``manager`` here.
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Reference in New Issue
Block a user