Skip to content

Commit 5dd6ed7

Browse files
authored
Update README.md
1 parent 0d2034d commit 5dd6ed7

File tree

1 file changed

+50
-100
lines changed

1 file changed

+50
-100
lines changed

README.md

Lines changed: 50 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# monday-api-python-sdk
22

3-
A Python SDK for interacting with Monday's GraphQL API.
3+
A Python SDK for interacting with Monday"s GraphQL API.
44

55
## Table of Contents
66

77
- [Installation](#installation)
88
- [Usage](#usage)
9-
- [Authentication](#authentication)
10-
- [API Methods](#api-methods)
119
- [Examples](#examples)
10+
- [Authentication](#authentication)
11+
- [Response Types](#response-types)
1212

1313
## Installation
1414

@@ -17,92 +17,70 @@ To install the SDK, use pip:
1717
```bash
1818
pip install monday-api-python-sdk
1919
```
20-
## Usage
21-
22-
### Authentication
20+
## Authentication
2321
To use the SDK, you need to authenticate with your Monday API token:
2422

2523
```python
26-
from monday_sdk import MondayClient
24+
from monday_sdk import MondayClient, MondayApiResponse, Board
2725

28-
client = MondayClient(token='your_token')
26+
client = MondayClient(token="your_token")
2927
```
3028

31-
## API Methods
32-
33-
### Get Boards
34-
```python
35-
boards = client.boards.fetch_boards()
36-
print(boards)
37-
```
38-
### Create Item
39-
```python
40-
item = client.items.create_item(board_id='your_board_id', group_id='your_group_id', item_name='New Item')
41-
print(item)
42-
```
4329
## Examples
4430

4531
Here are some examples of how to use the SDK:
4632

47-
### Example 1: List all boards
33+
### Example 1: Create a new item
4834
```python
4935
from monday_sdk import MondayClient
5036

51-
client = MondayClient(token='your_token')
52-
boards = client.boards.fetch_boards()
53-
for board in boards:
54-
print(board['name'])
55-
```
56-
### Example 2: Create a new item
57-
```python
58-
from monday_sdk import MondayClient
37+
client = MondayClient(token="your_token")
5938

60-
client = MondayClient(token='your_token')
61-
item = client.create_item(board_id='your_board_id', item_name='New Item')
62-
print(item)
63-
```
39+
column_values = {
40+
"status_column_id": "In Progress", # Replace with your actual status column ID and value
41+
"date_column_id": "2025-01-06", # Replace with your actual date column ID and date (YYYY-MM-DD format)
42+
"text_column_id": "Important task" # Replace with your actual text column ID and value
43+
}
6444

45+
item = client.create_item(
46+
board_id="your_board_id",
47+
group_id="your_group_id",
48+
item_name="New Item",
49+
column_values=column_values
50+
)
6551

66-
# monday-api-python-sdk
67-
68-
A Python SDK for interacting with Monday's GraphQL API.
69-
70-
## Table of Contents
71-
72-
- [Installation](#installation)
73-
- [Usage](#usage)
74-
- [Authentication](#authentication)
75-
- [API Methods](#api-methods)
76-
- [Response Types](#response-types)
77-
- [Examples](#examples)
78-
79-
## Installation
80-
81-
To install the SDK, use pip:
82-
```python
83-
pip install monday-api-python-sdk
84-
```
85-
## Usage
86-
87-
### Authentication
88-
To use the SDK, you need to authenticate with your Monday API token:
89-
```bash
90-
from monday_sdk import MondayClient
91-
92-
client = MondayClient(token='your_token')
93-
```
94-
## API Methods
95-
96-
### Get Boards
97-
```python
98-
boards = client.boards.fetch_boards()
99-
print(boards)
52+
print(item)
10053
```
101-
### Create Item
54+
### Example 2: Create an Update and Update Column Values
10255
```python
103-
item = client.items.create_item(board_id='your_board_id', item_name='New Item')
104-
print(item)
56+
from monday_sdk import MondayClient, StatusColumnValue, DateColumnValue
57+
58+
client = MondayClient(token="your_token")
59+
60+
# Create an update for an item
61+
update_response = client.updates.create_update(
62+
item_id="your_item_id",
63+
update_value="This is a new update message for the item."
64+
)
65+
66+
# Change a status column value
67+
status_response = client.items.change_status_column_value(
68+
board_id="your_board_id",
69+
item_id="your_item_id",
70+
column_id="status_column_id", # Replace with the actual column ID
71+
value="Done" # Replace with the desired status value
72+
)
73+
print(f"Status column updated: {status_response}")
74+
75+
# Change a date column value
76+
date_response = client.items.change_date_column_value(
77+
board_id="your_board_id",
78+
item_id="your_item_id",
79+
column_id="date_column_id",
80+
timestamp="2025-01-06"
81+
)
10582
```
83+
10684
## Response Types
10785

10886
The SDK provides structured types to help you work with API responses more effectively. These types allow you to easily access and manipulate the data returned by the API.
@@ -127,10 +105,10 @@ Here is an example of how to use these types with the SDK to deserialize API res
127105
from monday_sdk import MondayClient, MondayApiResponse
128106
import dacite
129107

130-
client = MondayClient(token='your_token')
108+
client = MondayClient(token="your_token")
131109

132110
# Fetch the raw response data
133-
response_data = client.boards.fetch_all_items_by_board_id(board_id='your_board_id')
111+
response_data = client.boards.fetch_all_items_by_board_id(board_id="your_board_id")
134112

135113
# Deserialize the response data into typed objects
136114
monday_response = dacite.from_dict(data_class=MondayApiResponse, data=response_data)
@@ -142,31 +120,3 @@ first_item_name = first_board.items_page.items[0].name
142120
print(f"First item name: {first_item_name}")
143121
```
144122
By using these types, you can ensure type safety and better code completion support in your IDE, making your work with the Monday API more efficient and error-free.
145-
146-
## Examples
147-
148-
Here are some examples of how to use the SDK:
149-
150-
### Example 1: List all boards
151-
```python
152-
from monday_sdk import MondayClient
153-
154-
client = MondayClient(token='your_token')
155-
boards = client.boards.fetch_boards()
156-
for board in boards:
157-
print(board['name'])
158-
```
159-
### Example 2: Create a new item
160-
```python
161-
from monday_sdk import MondayClient
162-
163-
client = MondayClient(token='your_token')
164-
item = client.items.create_item(board_id='your_board_id', item_name='New Item')
165-
print(item)
166-
```
167-
### Example 3: Create an update
168-
```python
169-
from monday_sdk import MondayClient
170-
171-
client = MondayClient(token='your_token')
172-
```

0 commit comments

Comments
 (0)