clixmlcreds
Simple solution to call Windows prompt for credentials through PowerShell command Get-Credential. Result of command above will be exported in xml using Windows Data Protection API (Export-Clixml PowerShell command).
You can store your credentials and reuse it in scripts by CredentialManager.read(...).
Very handy when you just need to store credentials for different services and call them based on different <cred_name>.
Usage
from clixmlcreds import Credential, CredentialManager
cred_name: str = 'Name_of_secret_xml_file' # cred name without file extension
if not Credential.exists(name=cred_name):
CredentialManager.write(
cred_name=cred_name,
username='Your_username',
prompt_message='Input username and password:'
)
cred = CredentialManager.read(cred_name=cred_name)
username = cred.username
password = cred.get_password() # return unsecure password string
Secrets storage
The default secrets storage is the corresponding folder inside the package. All credentials are hashed and stored in this folder as a <cred_name>.xml file.
You can change this behavior using:
from pathlib import Path
from clixmlcreds import CredentialManager
CredentialManager.path = Path('your_own_secrets_storage_folder')
Metadata
Release files for clixmlcreds 1.0.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| clixmlcreds-1.0.post1.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clixmlcreds-1.0.post1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.0 kB
Release files / clixmlcreds-1.0.post1.tar.gz
| Download URL | clixmlcreds-1.0.post1.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79fdce6dda75c01f7a16732d94c140f31316c6f9e627695af726ac7e98c3e42a
|
|
BLAKE2b-256 checksum How to use checksums |
2a82fa604442ea7e7bce9237c87f83ef7a18eae7de2c1147bfdc6ae1ca83966b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.19
|
Release files / clixmlcreds-1.0.post1-py3-none-any.whl
| Download URL | clixmlcreds-1.0.post1-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41c9704675e57be1fa77921971fb563143a483388b03508e601e0eb93e7b33a4
|
|
BLAKE2b-256 checksum How to use checksums |
10683933ae0633373a3cf15f7259bb464e58ad98543e35234e1a0cf1c5fe4f80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.19
|