Skip to content

V3#3

Merged
Qwizi merged 2 commits intomasterfrom
v3
Feb 18, 2026
Merged

V3#3
Qwizi merged 2 commits intomasterfrom
v3

Conversation

@Qwizi
Copy link
Copy Markdown
Owner

@Qwizi Qwizi commented Feb 18, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added comprehensive async client support alongside synchronous APIs.
    • Introduced expanded exception hierarchy for better error handling (authentication, forbidden, not found, validation, rate limit, server, connection errors).
    • Added authentication resource with login functionality.
    • Added multiple new resource endpoints (Account, Commissions, Files, Kanbans, Places, Products, Serviced Products, Users).
  • Breaking Changes

    • Removed v2 package and legacy query builder.
    • Updated public API exports; some previous classes no longer available.

@Qwizi Qwizi merged commit 6134388 into master Feb 18, 2026
1 check was pending
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 18, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR performs a substantial architectural refactor of the swapi-client library, removing the legacy v2 implementation (APIModel-based ORM, QuerySet, Q filtering) and introducing a new resource-based HTTP client pattern with sync/async variants, improved error handling, and simplified parameter building.

Changes

Cohort / File(s) Summary
IDE Configuration
.idea/...
Added 9 IntelliJ IDEA project configuration files for workspace, modules, inspection profiles, linters (Ruff, ESLint), material theme, and VCS settings.
Documentation
CLAUDE.md
Added comprehensive project guide covering architecture, usage examples, query parameters, exception handling, resource patterns, authentication, CI/CD, and REST conventions for Claude AI integration.
Core HTTP & Parameter Handling
src/swapi_client/_http.py, src/swapi_client/_params.py
Introduced low-level HTTP clients (BaseSyncClient, BaseAsyncClient) wrapping httpx with token/header management and error mapping; added build_params function for declarative query parameter construction from kwargs.
Exception Hierarchy
src/swapi_client/exceptions.py
Replaced minimal exception base with comprehensive HTTP error hierarchy (SWHTTPError, SWAuthenticationError, SWForbiddenError, SWNotFoundError, SWValidationError, SWRateLimitError, SWServerError, SWConnectionError) including status code and response data tracking.
Resource Base Classes
src/swapi_client/resources/_base.py
Introduced SyncResource and AsyncResource base classes providing standard CRUD operations (list, retrieve, create, update, partial_update, delete, bulk_update, bulk_delete, meta, autoselect, all with pagination).
Resource Implementations
src/swapi_client/resources/{auth,account,commissions,files,kanbans,places,products,serviced_products,users}.py, src/swapi_client/resources/__init__.py
Added 9 new resource modules with sync/async variants covering authentication, account management, commissions, files, kanbans, places, products, serviced products, and users; centralized exports in init.py.
API Surface Updates
src/swapi_client/__init__.py
Updated main package exports to include AsyncSWApiClient, expanded exception types (SWHTTPError and variants); removed SWQueryBuilder export.
Legacy v2 Package Removal
src/swapi_client/v2/**
Removed entire v2 subsystem (17 files/modules) including old client implementation, APIModel base class with dirty-tracking, SWAPIQuerySet/CoreQuerySet, Q filtering utility, and all model definitions (Commission, Product, User, etc.).
Query Builder Removal
src/swapi_client/query_builder.py
Deleted SWQueryBuilder class and all its parameter-building methods, replaced by simpler build_params function in _params.py.
Test Updates
test_filters.py
Rewrote test suite to validate new build_params API with assertion-based tests covering filters, ordering, pagination, and metadata; removed SWQueryBuilder compatibility tests.

Sequence Diagram(s)

No sequence diagrams generated—this refactor is primarily architectural/structural (removal of v2, introduction of resource layer) without new multi-component interactions or control flows that would benefit from visualization.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

The refactor spans multiple subsystems with heterogeneous changes: removal of large legacy modules (v2 package, QueryBuilder), introduction of new HTTP/resource abstractions, exception hierarchy redesign, and public API updates. While many resource classes follow repetitive patterns, the core logic (HTTP clients, error handling, parameter building) introduces new complexity requiring separate reasoning for correctness.

Possibly related PRs

  • V2 version, like django-orm #2: Directly inverse relationship—that PR implements the v2 package (APIModel, QuerySet, Q, client) that this PR removes; these PRs target the same modules in opposite architectural directions.

Poem

🐰 A fresh warren built from the old
No more QuerySets, models growing old
Resources dance in sync and async delight
Parameters flow simple and light
The v2 kingdom has passed away
Long live the new SDK today! 🌟

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch v3

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant