Skip to content

Commit 03e4e6e

Browse files
committed
Edited README to better reflect what is actually happening in the example code
1 parent 1433c45 commit 03e4e6e

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

example/README.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,42 @@
11
# Examples
2+
This folder contains a code snippet demonstrating how to use the 1Password Python SDK for performing various operations on 1Password vaults and items. Specifically, the example showcases how to:
23

3-
This folder contains a code snippet that demonstrates how to use the 1Password Python SDK to retrieve a secret from 1Password and export it as an environment variable.
4+
- Authenticate with the 1Password API using a service account token.
5+
- List available vaults and items within those vaults.
6+
- Retrieve a specific secret and resolve a one-time password (TOTP).
7+
- Create a new item in a vault with multiple fields and tags.
8+
- Update an existing item by modifying its fields and adding a new website.
9+
- Generate different types of passwords (PIN, memorable, and random).
10+
- Share an item with valid recipients and create a shareable link.
11+
- Archive or delete items from the vault.
412

513
## Prerequisites
614

715
1. Clone the repository and follow the steps to [get started](https://github.com/1Password/onepassword-sdk-python/blob/main/README.md).
8-
2. Make sure to export a valid service account token. For example:
9-
```bash
10-
export OP_SERVICE_ACCOUNT_TOKEN="<your token>"
11-
```
12-
3. Make sure to export a valid vault uuid. For example:
16+
2. Ensure that you have a valid service account token by exporting it as an environment variable:
17+
```bash
18+
export OP_SERVICE_ACCOUNT_TOKEN="<your token>"
19+
```
20+
3. Export the vault UUID you wish to interact with as an environment variable:
1321
```bash
1422
export OP_VAULT_ID="<your vault uuid>"
1523
```
24+
25+
## Execution
26+
27+
To run the example file, navigate to project root directory and run":
28+
```bash
29+
python example/example.py
30+
```
31+
32+
## Terminal Output
33+
34+
When running the example, the terminal will display:
35+
36+
- A list of vaults and items.
37+
- Retrieved secrets and TOTP codes.
38+
- Details of newly created and updated items.
39+
- Generated passwords (PIN, memorable, random).
40+
- A shareable link for shared items.
41+
42+
These outputs show the results of vault and item operations, password generation, and sharing.

0 commit comments

Comments
 (0)