You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> ❗ This project is still in its early, pre-alpha stages of development. Its stability is not yet fully assessed, and future iterations may bring backwards incompatible changes. Proceed with caution.
7
+
<palign="center">
8
+
<h4align="center"> ❗ The 1Password SDK project is in beta. Future iterations may bring backwards-incompatible changes.</h4>
9
+
</p>
4
10
5
-
The 1Password Python SDK offers programmatic read access to your secrets in 1Password in an interface native to Python. The SDK currently supports authentication with [1Password Service Accounts](https://developer.1password.com/docs/service-accounts/).
The 1Password Python SDK offers programmatic access to your secrets in 1Password with Python. During the beta, you can retrieve, create, read, update, and delete items.
18
+
19
+
## 🔑 Authentication
20
+
21
+
1Password SDKs support authentication with [1Password Service Accounts](https://developer.1password.com/docs/service-accounts/get-started/). You can create service accounts if you're an owner or administrator on your team. Otherwise, ask your administrator for a service account token.
22
+
23
+
Before you get started, [create a service account](https://developer.1password.com/docs/service-accounts/get-started/#create-a-service-account) and give it the appropriate permissions in the vaults where the items you want to use with the SDK are saved.
24
+
25
+
## ❗ Limitations
26
+
27
+
1Password SDKs currently only support operations on text and concealed fields. If you update or delete an item that has information saved in other field types, that information will be permanently lost.
28
+
29
+
1Password SDKs don't yet support using secret references with query parameters, so you can't retrieve file attachments or SSH keys, or get more information about field metadata.
30
+
31
+
When managing items with 1Password SDKs, you must use unique identifiers (IDs) in place of vault, item, and field names.
32
+
33
+
## 🚀 Get started
8
34
9
35
To use the 1Password Python SDK in your project:
10
36
11
-
1.[Create a 1Password Service Account](https://developer.1password.com/docs/service-accounts/get-started/#create-a-service-account). You can create service accounts if you're an owner or administrator on your team. Otherwise, ask your administrator for a service account token.
12
-
2. Export your service account token to the `OP_SERVICE_ACCOUNT_TOKEN` environment variable:
37
+
1. Provision your service account token. We recommend provisioning your token from the environment. For example, to export your token to the `OP_SERVICE_ACCOUNT_TOKEN` environment variable:
5. Initialize the SDK. Provision your service account token and use `integration_name` and `integration_version` to specify a name and version for your application.
64
+
65
+
```python
66
+
async def main():
67
+
# Gets your service account token from the OP_SERVICE_ACCOUNT_TOKEN environment variable.
Make sure to use [secret reference URIs](https://developer.1password.com/docs/cli/secret-references/) with the syntax `op://vault/item/field` to securely load secrets from 1Password into your code.
97
+
Make sure to use [secret reference URIs](https://developer.1password.com/docs/cli/secret-reference-syntax/) with the syntax `op://vault/item/field` to securely load secrets from 1Password into your code.
98
+
99
+
## 📖 Learn more
100
+
101
+
- [Load secrets with 1Password SDKs](https://developer.1password.com/docs/sdks/load-secrets)
102
+
- [Manage items with 1Password SDKs](https://developer.1password.com/docs/sdks/manage-items)
Note: The SDK doesn't yet support using secret references with query parameters, so you can't use secret references to retrieve file attachments or SSH keys, or to get more information about field metadata.
50
105
51
-
Inside ```Client.authenticate(...)```, set ```integration_name``` to the name of your application and ```integration_version``` to the version of your application.
0 commit comments