Sterces library package.
Top level module constants in package sterces.
Db module from sterces library.
- class StercesDatabase(**kwargs)[source]¶
Bases:
objectStercesDatabase class.
- Parameters:
**kwargs – The keyword arguments are used for …
- Variables:
debug (int, default 0) – debug level
verbose (int, default 0) – verbose level
db_fn (str, default ~/.sterces/db.kdbx) – path of db file
pwd_fn (str, default ~/.sterces/.ssapeek) – path of passphrase file
key_fn (str, optional) – path of key_fn
tf_key (str, optional) – transformation_key
warn (bool, default True) – warn if permission are inadequate
- property kpo: PyKeePass¶
Return the KeePass database object.
- Raises:
ValueError – When protected instance variable _kpobj is None
- Returns:
return code
- Return type:
int
- property version: str¶
Return the version of the sterces library.
- dump(path, mask=True, indent=0)[source]¶
Dump the database to stdout.
- Parameters:
path (Optional[str]) – path to the output file
mask (bool) – mask password fields when True
indent (int) – indent size when > 0 defaults to 0
- Returns:
return code
- Return type:
int
- group(path, action, quiet=True)[source]¶
Manage groups.
- Parameters:
path (Optional[str]) – path of the group
action (str) – action to perform (ADD, REMOVE)
quiet (bool) – don’t show groups when True
- Returns:
return code
- Return type:
int
- lookup(path, attr)[source]¶
Return the value of the attribute.
- Parameters:
path (str) – path of the entry
attr (str) – attribute to lookup
- Returns:
value of found attribute or None
- Return type:
Optional[str]
- remove(path)[source]¶
Remove an entry.
- Parameters:
path (str) – path of the entry to remove
- Returns:
return code
- Return type:
int
- show(path=None, mask=True)[source]¶
Show one or all entries.
- Parameters:
path (Optional[str], optional) – path of the entry to show, defaults to None
mask (bool, optional) – mask password, defaults to True
- Returns:
return code
- Return type:
int
- store(path, expiry, tags, **kwargs)[source]¶
Add a new entry to the database.
- Parameters:
path (str) – path of the entry to add
expiry (Optional[datetime]) – datetime of expiration
tags (Optional[list[str]]) – list of tag strings
**kwargs – The keyword arguments are used for …
- Variables:
username (str, default 'undef') – Value of username property
password (str, default 'undef') – Value of password property
url (str, optional) – Value of url property
notes (str, optional) – Value of notes property
otp (str, optional) – Value of otp property
- Returns:
return code
- Return type:
int
- update(path, **kwargs)[source]¶
Update the entry specified by path.
- Parameters:
path (str) – path of the entry to update
**kwargs – The keyword arguments are used for …
- Variables:
username (str, optional) – Value of username property
password (str, optional) – Value of password property
url (str, optional) – Value of url property
notes (str, optional) – Value of notes property
otp (str, optional) – Value of otp property
expires (str, optional) – Value of expiration datetime
- Raises:
ValueError – When expires is not parsable
- Returns:
return code
- Return type:
int
Foos module for package sterces.