typed_soup 1.0.3
typed_soup: ^1.0.3 copied to clipboard
Dart native package inspired by Beautiful Soup 4 Python library. Provides easy ways of navigating, searching, and modifying the HTML tree.
1.0.3 #
- Direct Node Text: Added
element.ownTextandelement.ownTextTrimmedto extract text belonging solely to the element directly (excluding nested child elements). - Form Data Serialization: Added
form.toFormData()to serialize form controls (<input>,<select>,<textarea>,<button>) intoMap<String, String>. - List Collection Extensions: Added
TsElementListExtfor easy mapping and filtering (.hrefs,.srcs,.texts,.trimmedTexts,.withClass(),.withAttr()). - Custom Predicate Search: Added
ts.findWhere(predicate)andts.findAllWhere(predicate)to query elements using custom Dart functions. - Table Parsing to Maps: Added
table.toTableData()to parse HTML table elements intoList<Map<String, String>>. - HTML5 Data Attributes: Added
element.dataAttr(name)andelement.dataAttrsmap getter fordata-*attributes. - Ancestor Matching: Added
element.closest(selector)andelement.matches(selector)to query matching ancestor elements up the tree. - Text Lines Utility: Added
element.strippedLinesto extract trimmed, non-blank text lines. - Convenient String Extension: Added
String.parseSoup()andString.parseSoupFragment(). - Expanded Tag Shortcuts & Collections: Added single tag getters (
div,span,form,input,button,label,selectTag,textarea,section,article,header,footer,nav,main,li,tr,td,th,code,pre,iframe) and plural collection getters (links,paragraphs,imgs,divs,spans,buttons,inputs,forms,tables,rows,cells,items,headings). - Attribute Accessors: Added
href,src,alt,value,type,target,actionproperty getters & setters onTsElement.
1.0.2 #
- Prettify Enhancements: Rewrote
prettify()with a recursive HTML formatter that outputs clean, 2-space indented HTML trees; added optionalindentparameter (prettify({String indent = ' '})). - Standardized Naming: Updated variable names to
tsacross all code examples, tests, and documentation. - Extension Getter: Added
Element.tsextension property getter (Element.ts). - Documentation & Examples:
- Replaced external doc links in README with verified inline Dart code examples.
- Added documentation on in-place tree mutations and exporting modified HTML via
ts.toString()/ts.prettify(). - Expanded
example/main.dartwith a complete API feature demonstration.
- Automated Verification: Added automated README example test generator (
tool/generate_examples.dart) and verification suite (test/readme_examples_test.dart). - Package Distribution: Added and configured
.gitignoreand.pubignorefiles for clean package publishing.
1.0.1 #
- Updated repository URLs and badges in documentation and package metadata.
- Updated
lintsdev dependency.
1.0.0 #
- Major Release: Full API alignment with Python Beautiful Soup 4
- Package Rename: Renamed from
beautiful_soup_darttotyped_soup - Navigation Methods:
- Added
selfAndDescendants- includes current element with descendants - Added
selfAndParents- includes current element with parents - Added
selfAndNextSiblings- includes current element with next siblings - Added
selfAndPreviousSiblings- includes current element with previous siblings - Added
selfAndNextElements- includes current element with next elements - Added
selfAndPreviousElements- includes current element with previous elements
- Added
- Search Methods:
- Added
select()- CSS selector method for finding all matching elements - Added
select_one()- CSS selector method for finding first matching element
- Added
- Modification Methods:
- Added
replaceWithChildren()- replaces element with its children - Added
wrapWithString()- wraps element with optional string content - Made
smooth()public - consolidates adjacent text nodes
- Added
- Output Methods:
- Added
strings- generator of all strings in document and descendants - Added
strippedStrings- generator of stripped strings (returns Iterable
- Added
- Element Methods:
- Added
get()- gets attribute value with optional default
- Added
- CSS Selector Support:
- Enhanced
:nth-child()selector support (integers, keywords, formulas) - Added
:first-childselector support
- Enhanced
- Improvements:
- Enhanced
prettify()method to support additional node types - Improved recursive search for
nextParsedAllandpreviousParsedAll - Updated all tests to align with new API behavior
- Enhanced
- Documentation:
- Updated README with complete feature list
- Updated all documentation URLs to official Beautiful Soup 4
- Removed deprecated API references
0.3.0 #
- Added new Modifying the Tree methods:
newTag(),clear(),decompose(),wrap(),unwrap(),setter for .name (tag name). - Added new parameters to
getText()Output method:separator,strip. - Added new Output method (partial support):
prettify(). - Added new helper methods for element's attributes:
removeAttr(),hasAttr(),setAttr(),getAttrValue(). - Added new Tags:
b,i. - Added tests & coverage.
- Updated README.
0.2.0 #
- Renamed parameter
customSelectortoselectorin Searching the Tree methods. - Added new parameters to Searching the Tree methods:
id,class_,regex,stringandlimit.
0.1.0 #
- Added new Navigating the Tree methods:
.nextElement,.nextElements,.previousElement,.previousElements,.nextParsed,.nextParsedAll,.previousParsed,.previousParsedAll. - Added new Searching the Tree methods:
findParent(),findParents(),findNextSibling(),findNextSiblings(),findPreviousSibling(),findPreviousSiblings(),findNextElement(),findAllNextElements(),findPreviousElement(),findAllPreviousElements(),findNextParsed(),findNextParsedAll(),findPreviousParsed(),findPreviousParsedAll(). - Added new Output method:
.text. - Added more tests.
- Removed unused dependency.
- Updated README.
- Improved documentation.
0.0.1 #
- Initial version.