Skip to content

Comments

feat: align library with latest Embed API documentation#15

Merged
TaslimOseni merged 8 commits intomainfrom
update/refactor-codebase
Feb 9, 2026
Merged

feat: align library with latest Embed API documentation#15
TaslimOseni merged 8 commits intomainfrom
update/refactor-codebase

Conversation

@TaslimOseni
Copy link
Collaborator

Description

This PR focuses on improving the developer experience and ensuring the embedpy library reflects the current state of the Cowrywise Embed API.

The primary objectives were to standardize the inline documentation across all resource classes, implement previously missing (commented-out) features for Custom Index management, and ensure the test suite is robust and up-to-date with recent API changes.

Key Changes

  1. Documentation
  • Standardized Docstrings: Refactored the docstrings for Account, Investment, Asset, Index, Wallet, and Saving classes. They now follow the Google Python Style Guide, providing clear information on required/optional parameters, return types, and usage context.
  • README Overhaul: Updated the main README.md to include a corrected REST methods table and a more comprehensive "Usage" section. The new examples demonstrate modern initialization and multi-step integration flows (Account -> Asset Discovery -> Investment).
  1. Feature Implementation
  • Custom Index Management: Fully implemented the create_custom_index and modify_custom_index methods in embed/resources/index.py. These methods are now production-ready and support idempotency keys.
  1. Test Suite Updates
  • Account Tests: Added test coverage for the terms_of_use_accepted field and phone_number in the account creation flow.
  • Investment Tests: Added validation for the amount field in the investment creation test case.
  • Index Tests: Removed the @pytest.mark.skip decorators from index tests. Fixed a validation error in test_can_modify_custom_index where the index_id was being incorrectly asserted within the payload instead of the URL path.

Verification Results

  • Ran all resource-specific tests.
  • tests/resources/test_indexes.py now passes with 100% success (5/5 tests).
  • Verified that all new docstrings are correctly parsed and consistent across the codebase.

Checklist

[x] Necessary tests for the code changes requested are added
[x] Code is formatted according to PEP8
[x] Documentation updated (README and Docstrings)

@TaslimOseni TaslimOseni self-assigned this Feb 9, 2026
@TaslimOseni TaslimOseni merged commit 1cee12d into main Feb 9, 2026
2 checks passed
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.

2 participants