Overview
Domain interfaces define the contracts that infrastructure implementations must fulfill. They enable dependency inversion and loose coupling between layers.ScraperInterface
Base interface for movie scrapers.Class Definition
domain/interfaces/scraper_interface.py:5-21
Methods
scrape
Executes the scraping process and returns a list of extracted movies.List of Movie objects with data obtained from scraping.
Implementation Example
See ImdbScraper for the concrete implementation.UseCaseInterface
Base interface for all application use cases.Class Definition
domain/interfaces/use_case_interface.py:4-25
Methods
execute
Executes the main use case logic.Data required to execute the use case. Can be an object, dictionary, or other type depending on the context.
Use cases perform side effects (e.g., saving to database) and return nothing.
Implementation Examples
See Use Cases for concrete implementations:SaveMovieWithActorsCsvUseCaseSaveMovieWithActorsPostgresUseCaseCompositeSaveMovieWithActorsUseCase
ProxyProviderInterface
Interface for proxy providers supporting various proxy types.Class Definition
domain/interfaces/proxy_interface.py:5-35
Methods
get_proxy
Returns the current proxy configuration to use.Proxy configuration dictionary (e.g.,
{'http': 'socks5h://127.0.0.1:9050', 'https': 'socks5h://127.0.0.1:9050'}), or None for direct connection.get_proxy_location
Retrieves geographic information associated with the proxy.Proxy configuration dictionary.
Tuple containing (public IP, city, country).
Implementation Example
See ProxyProvider for the concrete implementation.TorInterface
Interface for Tor network control.Class Definition
domain/interfaces/tor_interface.py:3-29
Methods
rotate_ip
Rotates the current Tor IP address and returns the new public IP.New public IP address obtained after rotation.
get_current_ip
Retrieves the current public IP address without performing rotation.Current Tor public IP address.