macOS Keychain access from Python — powered by Swift & ApplePy
Project description
SwiftKeychain
macOS Keychain access from Python — powered by Swift & ApplePy.
macOS only — requires Swift 6.0+ toolchain
Install
pip install -e .
This compiles the embedded Swift code and installs the Python package.
Usage
import swiftkeychain as kc
# Store & retrieve passwords
kc.set_password("myapp", "user@email.com", "s3cret")
pw = kc.get_password("myapp", "user@email.com")
# List all accounts for a service
accounts = kc.find_passwords("myapp")
# Internet passwords
kc.set_internet_password("api.example.com", "bot", "token", "https", "/v1")
pw = kc.get_internet_password("api.example.com", "bot")
# Delete
kc.delete_password("myapp", "user@email.com")
API
| Function | Returns | Description |
|---|---|---|
set_password(service, account, password) |
None |
Store a generic password |
get_password(service, account) |
str | None |
Retrieve a password |
delete_password(service, account) |
bool |
Delete a password |
find_passwords(service) |
list[str] |
List accounts for a service |
set_internet_password(server, account, password, protocol, path) |
None |
Store an internet password |
get_internet_password(server, account) |
str | None |
Retrieve an internet password |
Examples
See swiftkeychain/examples/demo.py for a full demo.
License
BSD-3-Clause © Jagtesh Chadha — see LICENSE.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swiftkeychain-0.1.0.tar.gz.
File metadata
- Download URL: swiftkeychain-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1a63c49f508899a682a102c67c0dc1e951b43aecb3bcdb2fa0d66f62233176a
|
|
| MD5 |
2ddb0b5a80b6e348e3f4e221d8083cd2
|
|
| BLAKE2b-256 |
6477781c18c3a68b149cae73e15ab1005e872e13dbf2cd34e305a2874895c86e
|
File details
Details for the file swiftkeychain-0.1.0-py3-none-any.whl.
File metadata
- Download URL: swiftkeychain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
412e6fcd2c4630370fbf5d23b5d1a68e5e0e67c419bb8adde0fba43655b428f5
|
|
| MD5 |
2a3b7a58714891887644cd7a58e3c028
|
|
| BLAKE2b-256 |
27e46fbc9c4e0cebc79efd1c0241bdedcde0988969fe261c655cf62b462c8416
|