credstore 0.3.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
credstore/__init__.py ADDED
@@ -0,0 +1,75 @@
1
+ """credstore — secure credential storage via OS keyring.
2
+
3
+ Cross-platform API for retrieving secrets stored in the OS keyring
4
+ with keyrings.cryptfile encrypted backup. Secrets are *stored* only
5
+ via the CLI (``credstore set``) which reads from masked stdin — never
6
+ through Python function arguments.
7
+
8
+ Modules::
9
+
10
+ _store.py CredentialStore + module-level API
11
+ _shell.py Shell formatting helpers
12
+ _backend.py Dual-write backends (system keyring + cryptfile)
13
+ _enumerate.py Platform-specific credential enumeration
14
+ _config.py Config file loading
15
+ _resolver.py keyring: URI resolution
16
+ _tty.py Masked terminal input
17
+ __main__.py CLI (entry point)
18
+
19
+ Usage::
20
+
21
+ import credstore
22
+
23
+ # Retrieve a secret
24
+ value = credstore.get_credential("myapp/api_key")
25
+
26
+ # Resolve keyring: URIs in config values
27
+ resolved = credstore.resolve_uri("keyring:myapp/api_key")
28
+
29
+ # Delete
30
+ credstore.delete_credential("myapp/api_key")
31
+
32
+ # Shell formatting
33
+ credstore.format_export("KEY", "value", "bash") # → export statement
34
+
35
+ # Check backend
36
+ info = credstore.check_backend()
37
+ """
38
+
39
+ from credstore._shell import format_export, format_unset
40
+ from credstore._store import (
41
+ get_credential,
42
+ exists_credential,
43
+ list_credential_keys,
44
+ set_credential,
45
+ delete_credential,
46
+ get_backend_name,
47
+ check_backend,
48
+ init_store,
49
+ )
50
+ from credstore._resolver import (
51
+ resolve_uri,
52
+ is_keyring_uri,
53
+ parse_keyring_uri,
54
+ )
55
+
56
+ __all__ = [
57
+ # Read / write / delete
58
+ "get_credential",
59
+ "exists_credential",
60
+ "list_credential_keys",
61
+ "set_credential",
62
+ "delete_credential",
63
+ # URI resolution
64
+ "is_keyring_uri",
65
+ "parse_keyring_uri",
66
+ "resolve_uri",
67
+ # Shell formatting
68
+ "format_export",
69
+ "format_unset",
70
+ # Diagnostics
71
+ "get_backend_name",
72
+ "check_backend",
73
+ "init_store",
74
+ ]
75
+ __version__ = "0.3.6"