[PR #31] [WIP] Client Interface Implementation #16

Closed
opened 2026-03-07 19:32:03 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/AliAkhtari78/SpotifyScraper/pull/31

State: closed
Merged: No


Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

Primary Task: Complete Client Interface Implementation (Task 5.1)

Context

The SpotifyScraper library modernization is 60% complete. You're tasked with completing the client interface (client.py), which serves as the main entry point for users. This component integrates all the extractors, browsers, and media handlers into a unified API.

Specifications

  • File location: src/spotify_scraper/client.py
  • Dependencies: All extractors (track, album, artist, playlist), browser components, and media handlers are implemented
  • Key requirements:
    • Implement all missing methods in the SpotifyClient class
    • Methods should support both URL and ID-based access
    • Add support for the extractors previously implemented (album, artist, playlist)
    • Maintain consistent error handling

Implementation Details

  1. Implement these methods based on existing extractors:

    def get_album(self, url_or_id: str) -> Dict[str, Any]:
        # Extract album information using AlbumExtractor
    
    def get_artist(self, url_or_id: str) -> Dict[str, Any]:
        # Extract artist information using ArtistExtractor
    
    def get_playlist(self, url_or_id: str) -> Dict[str, Any]:
        # Extract playlist information using PlaylistExtractor
    
  2. Add utility methods for ID extraction and normalization:

    def _normalize_id(self, url_or_id: str, expected_type: Optional[str] = None) -> str:
        # Convert URL to ID or validate existing ID
    

Secondary Task: Implement Package Initialization (Task 5.2)

Once the client interface is complete, implement the package initialization in src/spotify_scraper/__init__.py. This file should expose the public API and provide backward compatibility with version 1.x.

Testing Tasks (Tasks 6.1, 6.2)

After completing the client implementation, create test fixtures in tests/fixtures/ and implement unit tests for all components, focusing on:

  • URL utilities
  • Extractors
  • Client interface

Final Task: Update Packaging Configuration (Task 6.4)

Update setup.py, pyproject.toml, and setup.cfg to prepare for PyPI release.

Success Criteria

  • All methods are implemented with proper docstrings
  • Methods handle both URL and ID inputs correctly
  • Error handling is consistent
  • Code follows type hints and best practices

Fixes #30.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

**Original Pull Request:** https://github.com/AliAkhtari78/SpotifyScraper/pull/31 **State:** closed **Merged:** No --- Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress. Original issue description: > ## Primary Task: Complete Client Interface Implementation (Task 5.1) > > ### Context > The SpotifyScraper library modernization is 60% complete. You're tasked with completing the client interface (`client.py`), which serves as the main entry point for users. This component integrates all the extractors, browsers, and media handlers into a unified API. > > ### Specifications > - **File location**: `src/spotify_scraper/client.py` > - **Dependencies**: All extractors (track, album, artist, playlist), browser components, and media handlers are implemented > - **Key requirements**: > - Implement all missing methods in the `SpotifyClient` class > - Methods should support both URL and ID-based access > - Add support for the extractors previously implemented (album, artist, playlist) > - Maintain consistent error handling > > ### Implementation Details > 1. Implement these methods based on existing extractors: > ```python > def get_album(self, url_or_id: str) -> Dict[str, Any]: > # Extract album information using AlbumExtractor > > def get_artist(self, url_or_id: str) -> Dict[str, Any]: > # Extract artist information using ArtistExtractor > > def get_playlist(self, url_or_id: str) -> Dict[str, Any]: > # Extract playlist information using PlaylistExtractor > ``` > > 2. Add utility methods for ID extraction and normalization: > ```python > def _normalize_id(self, url_or_id: str, expected_type: Optional[str] = None) -> str: > # Convert URL to ID or validate existing ID > ``` > > ## Secondary Task: Implement Package Initialization (Task 5.2) > > Once the client interface is complete, implement the package initialization in `src/spotify_scraper/__init__.py`. This file should expose the public API and provide backward compatibility with version 1.x. > > ## Testing Tasks (Tasks 6.1, 6.2) > > After completing the client implementation, create test fixtures in `tests/fixtures/` and implement unit tests for all components, focusing on: > - URL utilities > - Extractors > - Client interface > > ## Final Task: Update Packaging Configuration (Task 6.4) > > Update `setup.py`, `pyproject.toml`, and `setup.cfg` to prepare for PyPI release. > > ### Success Criteria > - All methods are implemented with proper docstrings > - Methods handle both URL and ID inputs correctly > - Error handling is consistent > - Code follows type hints and best practices Fixes #30. --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.
kerem 2026-03-07 19:32:03 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SpotifyScraper#16
No description provided.