feat: Add enterprise-grade Markdown output format across entire SDK#14
Open
vzucher wants to merge 1 commit intobrightdata:mainfrom
Open
feat: Add enterprise-grade Markdown output format across entire SDK#14vzucher wants to merge 1 commit intobrightdata:mainfrom
vzucher wants to merge 1 commit intobrightdata:mainfrom
Conversation
|
Does this also include the Markdown data format documentation here: It would be important to have the option to specify the markdown data format instead of just raw and json as shown below |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements GitHub-flavored Markdown output format using Strategy and Registry design patterns. Addresses user request for markdown export functionality with zero breaking changes.
Implementation
Architecture (FAANG-Level)
New Formatter Infrastructure
Created:
src/brightdata/formatters/__init__.py- Package exportssrc/brightdata/formatters/base.py- BaseFormatter interfacesrc/brightdata/formatters/registry.py- FormatterRegistrysrc/brightdata/formatters/json_formatter.py- Refactored existingsrc/brightdata/formatters/pretty_formatter.py- Refactored existingsrc/brightdata/formatters/minimal_formatter.py- Refactored existingsrc/brightdata/formatters/markdown.py- NEW Markdown formatterFeatures
Markdown formatter includes:
Integration
SDK Usage:
CLI Usage:
Changes
Modified:
src/brightdata/models.py- Addedto_markdown()method to BaseResultsrc/brightdata/models.py- Updatedsave_to_file()to support all formats via registrysrc/brightdata/cli/commands/scrape.py- Added markdown to output choicessrc/brightdata/cli/commands/search.py- Added markdown to output choicessrc/brightdata/cli/utils.py- Refactored to use FormatterRegistryREADME.md- Added markdown examples and documentationAdded:
tests/unit/test_markdown.py- 13 comprehensive testsTesting
Benefits
For Users:
For Architecture:
Backward Compatibility
✅ All existing code works unchanged:
Performance
No impact - formatters are lazy-loaded and only used when requested.
Documentation