Skip to content

Commit 7d0c5b1

Browse files
authored
Merge pull request #24 from 1Password/libutcher-patch-1
Update README for beta
2 parents aa66459 + 3b67f0d commit 7d0c5b1

File tree

1 file changed

+52
-21
lines changed

1 file changed

+52
-21
lines changed

README.md

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,60 @@
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://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 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
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](#authentication) token. We recommend provisioning your token from the environment. For example, to export your token to the `OP_SERVICE_ACCOUNT_TOKEN` environment variable:
1338

14-
```bash
15-
export OP_SERVICE_ACCOUNT_TOKEN=<your-service-account-token>
16-
```
39+
**macOS or Linux**
1740

18-
3. In your project, download the 1Password Python SDK:
41+
```bash
42+
export OP_SERVICE_ACCOUNT_TOKEN=<your-service-account-token>
43+
```
1944

20-
```bash
21-
pip install git+ssh://[email protected]/1Password/onepassword-sdk-python.git
22-
```
45+
**Windows**
46+
47+
```powershell
48+
$Env:OP_SERVICE_ACCOUNT_TOKEN = "<your-service-account-token>"
49+
```
50+
51+
2. Install the 1Password Python SDK in your project:
2352

24-
4. Use the SDK in your project:
53+
```bash
54+
pip install git+ssh://[email protected]/1Password/[email protected]
55+
```
56+
57+
3. Use the Python SDK in your project:
2558

2659
```python
2760
import asyncio
@@ -31,21 +64,19 @@ from onepassword.client import Client
3164
async def main():
3265
# Gets your service account token from the OP_SERVICE_ACCOUNT_TOKEN environment variable.
3366
token = os.getenv("OP_SERVICE_ACCOUNT_TOKEN")
34-
67+
3568
# Connects to 1Password.
3669
client = await Client.authenticate(auth=token, integration_name="My 1Password Integration", integration_version="v1.0.0")
37-
70+
3871
# Retrieves a secret from 1Password. Takes a secret reference as input and returns the secret to which it points.
3972
value = await client.secrets.resolve("op://vault/item/field")
40-
print(value)
73+
# use value here
4174

4275
if __name__ == '__main__':
4376
asyncio.run(main())
4477

4578
```
4679

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.
5081

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

Comments
 (0)