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 create, retrieve, update, and delete items and resolve secret references.
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](#authentication) token. We recommend provisioning your token from the environment. For example, to export your token to the `OP_SERVICE_ACCOUNT_TOKEN` environment variable:
# Retrieves a secret from 1Password. Takes a secret reference as input and returns the secret to which it points.
39
72
value =await client.secrets.resolve("op://vault/item/field")
40
-
print(value)
73
+
# use value here
41
74
42
75
if__name__=='__main__':
43
76
asyncio.run(main())
44
77
45
78
```
46
79
47
-
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.
48
-
49
-
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.
80
+
Make sure to use [secret reference URIs](https://developer.1password.com/docs/cli/secrets-reference-syntax/) with the syntax `op://vault/item/field` to securely load secrets from 1Password into your code.
50
81
51
-
Inside ```Client.authenticate(...)```, set ```integration_name``` to the name of your application and ```integration_version``` to the version of your application.
82
+
Inside `Client.authenticate(...)`, set `integration_name` to the name of your application and `integration_version` to the version of your application.
0 commit comments