Skip to content

Commit 8659458

Browse files
authored
Update README for beta
Updates README for beta
1 parent d429832 commit 8659458

File tree

1 file changed

+71
-17
lines changed

1 file changed

+71
-17
lines changed

README.md

Lines changed: 71 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,77 @@
1-
# 1Password Python SDK
1+
<p align="center">
2+
<a href="https://1password.com">
3+
<h1 align="center">1Password Python SDK (beta)</h1>
4+
</a>
5+
</p>
26

3-
> ❗ 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+
<p align="center">
8+
<h4 align="center"> ❗ The 1Password SDK project is in beta. Future iterations may bring backwards-incompatible changes.</h4>
9+
</p>
410

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/).
11+
<p align="center">
12+
<a href="https://developer.1password.com/docs/sdks/">Documentation</a> | <a href="https://github.com/1Password/onepassword-sdk-python/tree/main/example">Examples</a>
13+
<br/>
614

7-
## Get started
15+
---
16+
17+
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
834

935
To use the 1Password Python SDK in your project:
1036

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:
38+
39+
**Mac**
40+
41+
```bash
42+
export OP_SERVICE_ACCOUNT_TOKEN=<your-service-account-token>
43+
```
44+
45+
**Windows**
46+
47+
```powershell
48+
$Env:OP_SERVICE_ACCOUNT_TOKEN = "<your-service-account-token>"
49+
```
1350

14-
```bash
15-
export OP_SERVICE_ACCOUNT_TOKEN=<your-service-account-token>
16-
```
51+
2. Install the 1Password Python SDK in your project:
1752

18-
3. In your project, download the 1Password Python SDK:
53+
```bash
54+
pip install git+ssh://[email protected]/1Password/onepassword-sdk-python.git
55+
```
1956

20-
```bash
21-
pip install git+ssh://[email protected]/1Password/onepassword-sdk-python.git
22-
```
57+
3. Import the SDK in your project:
58+
59+
```python
60+
from onepassword.client import Client
61+
```
62+
63+
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.
68+
token = os.getenv("OP_SERVICE_ACCOUNT_TOKEN")
69+
70+
# Connects to 1Password.
71+
client = await Client.authenticate(auth=token, integration_name="My 1Password Integration", integration_version="v1.0.0")
72+
```
2373

24-
4. Use the SDK in your project:
74+
### Example
2575

2676
```python
2777
import asyncio
@@ -44,8 +94,12 @@ if __name__ == '__main__':
4494
4595
```
4696
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.
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)
103+
- [1Password SDK concepts](https://developer.1password.com/docs/sdks/concepts)
48104
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.
50105
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

Comments
 (0)