Skip to main content

Call Windows prompt for credentials with Python through PowerShell command Get-Credential.

Project description

clixmlcreds

Static Badge Static Badge Static Badge

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')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clixmlcreds-1.0.post1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clixmlcreds-1.0.post1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file clixmlcreds-1.0.post1.tar.gz.

File metadata

  • Download URL: clixmlcreds-1.0.post1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.19

File hashes

Hashes for clixmlcreds-1.0.post1.tar.gz
Algorithm Hash digest
SHA256 79fdce6dda75c01f7a16732d94c140f31316c6f9e627695af726ac7e98c3e42a
MD5 23b0487a217006fcb9632acbfab6b5b7
BLAKE2b-256 2a82fa604442ea7e7bce9237c87f83ef7a18eae7de2c1147bfdc6ae1ca83966b

See more details on using hashes here.

File details

Details for the file clixmlcreds-1.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for clixmlcreds-1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 41c9704675e57be1fa77921971fb563143a483388b03508e601e0eb93e7b33a4
MD5 fb7f815a73563e0bbad8f4b69bab69e0
BLAKE2b-256 10683933ae0633373a3cf15f7259bb464e58ad98543e35234e1a0cf1c5fe4f80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page