Skip to content

Commit 2d6d850

Browse files
franccescoclaude
andcommitted
docs: update documentation for v0.21.0 refactoring
- Add CHANGELOG entry for v0.21.0 with breaking changes - Update README with correct method names - Update CLAUDE.md with mixins architecture and patterns - Fix outdated examples in guide docs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e19b91a commit 2d6d850

6 files changed

Lines changed: 42 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.21.0] - 2026-01-09
11+
12+
### Changed
13+
14+
- **BREAKING**: `HeadlineListItem` model removed and merged into `HeadlineDetails` (now a type alias for backward compatibility)
15+
- Refactored internal operations structure to use mixins for better code organization
16+
- Improved bulk operations with generic validation and processing helpers in base classes
17+
- Standardized error handling across all operations to consistently use `raise_for_status()`
18+
19+
### Added
20+
21+
- New `mixins/` folder with transform mixins for each operation type (goals, meetings, issues, headlines, todos, users)
22+
- Generic bulk operation helpers in `AbstractOperations` base class (`_validate_bulk_item`, `_process_bulk_sync`)
23+
- Generic async bulk processing in `AsyncBaseOperations` with configurable semaphore for concurrency control
24+
- Reusable `OptionalDatetime` and `OptionalFloat` annotated types using Pydantic's `BeforeValidator`
25+
26+
### Fixed
27+
28+
- Removed duplicate datetime and float validators across models (Todo, Issue, Goal)
29+
- Removed redundant `__init__` methods from async operations
30+
1031
## [0.20.1] - 2025-12-10
1132

1233
### Fixed
@@ -231,7 +252,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
231252
- Configuration management with multiple API key sources
232253
- httpx-based HTTP client with bearer token authentication
233254

234-
[Unreleased]: https://github.com/franccesco/bloomy-python/compare/v0.20.1...HEAD
255+
[Unreleased]: https://github.com/franccesco/bloomy-python/compare/v0.21.0...HEAD
256+
[0.21.0]: https://github.com/franccesco/bloomy-python/compare/v0.20.1...v0.21.0
235257
[0.20.1]: https://github.com/franccesco/bloomy-python/compare/v0.20.0...v0.20.1
236258
[0.20.0]: https://github.com/franccesco/bloomy-python/compare/v0.19.0...v0.20.0
237259
[0.19.0]: https://github.com/franccesco/bloomy-python/compare/v0.18.0...v0.19.0

CLAUDE.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,17 @@ The Bloomy Python SDK is organized as a client-based architecture where all API
8080
- Sync operations in `src/bloomy/operations/` inherit from `BaseOperations`
8181
- Async operations in `src/bloomy/operations/async_/` inherit from `AsyncBaseOperations`
8282
- Both inherit from `AbstractOperations` which provides shared logic
83+
- Response transformation is handled by mixins in `src/bloomy/operations/mixins/` (e.g., `UserOperationsMixin`, `MeetingOperationsMixin`)
84+
- Mixins use `_transform` suffix naming convention (e.g., `goals_transform.py`, `users_transform.py`)
85+
- Generic bulk operations logic is provided in base classes (`_validate_bulk_item`, `_process_bulk_sync`, `_process_bulk_async`)
8386
- Operations are accessed via client attributes: `client.user`, `client.meeting`, etc.
8487

8588
4. **Models (`src/bloomy/models.py`)**:
8689
- Pydantic models for type-safe API responses
8790
- All models inherit from `BloomyBaseModel` with common config
8891
- Field aliases map PascalCase API responses to snake_case Python attributes
92+
- Reusable annotated types: `OptionalDatetime` and `OptionalFloat` using Pydantic's `BeforeValidator`
93+
- Some models are type aliases for backward compatibility (e.g., `HeadlineListItem = HeadlineDetails`)
8994

9095
5. **API Endpoints**:
9196
- Base URL: `https://app.bloomgrowth.com/api/v1`
@@ -101,7 +106,7 @@ The Bloomy Python SDK is organized as a client-based architecture where all API
101106
3. **Error Handling**:
102107
- Custom exception hierarchy rooted at `BloomyError`
103108
- `APIError` includes status code
104-
- HTTP errors are raised via `response.raise_for_status()`
109+
- All operations consistently use `response.raise_for_status()` for error handling
105110

106111
4. **Type Annotations**: Uses Python 3.12+ union syntax (`|`) and Pydantic models for structured return types.
107112

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
A Python SDK for interacting with the Bloom Growth API, providing easy access to users, meetings, todos, goals, scorecards, issues, and headlines.
77

8-
**New in v0.13.0**: Full async/await support with `AsyncClient` for better performance in async applications!
8+
**New in v0.21.0**: Improved internal architecture with reusable mixins and enhanced bulk operation performance!
99

1010
## Installation
1111

@@ -59,13 +59,13 @@ asyncio.run(main())
5959
user = client.user.details()
6060

6161
# Get user with direct reports and positions
62-
user = client.user.details(user_id=123, all=True)
62+
user = client.user.details(user_id=123, include_all=True)
6363

6464
# Search users
6565
results = client.user.search("john")
6666

67-
# Get all users
68-
users = client.user.all()
67+
# List all users
68+
users = client.user.list()
6969
```
7070

7171
### Meetings

docs/guide/async.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@ async def bulk_create_todos(client: AsyncClient, todos_data: list[dict]):
226226
async def sync_user_data(client: AsyncClient):
227227
"""Sync all user data efficiently."""
228228
# Get all users
229-
all_users = await client.user.all()
230-
229+
all_users = await client.user.list()
230+
231231
# Process users in batches to avoid overwhelming the API
232232
batch_size = 10
233233
user_details = []
234-
234+
235235
for i in range(0, len(all_users), batch_size):
236236
batch = all_users[i:i + batch_size]
237237
batch_tasks = [
@@ -240,7 +240,7 @@ async def sync_user_data(client: AsyncClient):
240240
]
241241
batch_results = await asyncio.gather(*batch_tasks)
242242
user_details.extend(batch_results)
243-
243+
244244
return user_details
245245
```
246246

docs/guide/authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ client_account1 = Client(api_key="api-key-for-account-1")
260260
client_account2 = Client(api_key="api-key-for-account-2")
261261

262262
# Use different clients for different operations
263-
users_account1 = client_account1.user.all()
264-
users_account2 = client_account2.user.all()
263+
users_account1 = client_account1.user.list()
264+
users_account2 = client_account2.user.list()
265265
```
266266

267267
## Next Steps

docs/guide/bulk-operations.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Each bulk operation returns a `BulkCreateResult` containing:
2323
!!! note "Best-Effort Processing"
2424
Bulk operations are not transactional. If one item fails, the operation continues with the remaining items. Always check both successful and failed results.
2525

26+
!!! tip "Enhanced in v0.21.0"
27+
Bulk operations now use generic validation and processing helpers in the base classes, providing consistent error handling and performance across all resource types.
28+
2629
## BulkCreateResult Structure
2730

2831
```python

0 commit comments

Comments
 (0)