Announcing IndieWeb Utils v0.3.1
Published on under the IndieWeb category.Toggle Memex mode

I am excited to announce that IndieWeb Utils is now in v0.3.1. This update is the culmination of months of work from project contributors. Before I get any further, I want to note a special thank you to James, Tantek and Angelo for their collaboration in this project. Their contributions, code reviews, and suggestions have greatly enhanced this library.
The changes featured in this version of IndieWeb Utils can be summed up in four categories: an Input/Output refactor, new functions, documentation improvements, and miscelaneous bug fixes and changes.
IO refactor
The IO refactor is one of the most significant changes to the library. In previous versions of IndieWeb Utils, most functions that required parsing a HTML document would ask explicitly for a URL to parse. A function would then retrieve the contents at the destination URL then do its job. But, this locks developers into a single method of IO. This is not ideal because a developer may already have HTML. Asking developers to provide a URL that would then be parsed involves making two network requests. This would be compounded if you used multiple library functions in sequence that accepted a URL as an input.
In this refactor, we decided to allow three new methods of input, where appropriate:
- A HTML string
- A parsed BeautifulSoup 4 object
- A parsed mf2py object
We chose these methods of IO, in addition to a regular URL string whose contents would then be retrived, because they represent the forms of content that IndieWeb Utils needs to work. If you pass a HTML string, BeautifulSoup object, or mf2py object, the library will use those values instead of making another network request to retrieve the contents at a URL to then parse them into the required form.
The IndieWeb Utils documentation gives guidance with regard to the functions in which each method of input can be used.
New functions
In addition, this release contains five new functions, which let you:
- Discover a representative h-feed on a page
- Discover and validate rel=me auth links an a page
- Retrieve a representative h-card
- Retrieve a summary of a URL
- Replace hashtags and @ tags with links
These functions are documented in the release changelog.
Documentation improvements
Alongside these changes, we massively overhauled the documentation for the library. We now have docstrings and code examples for every function in the library. Where exceptions are raised, these are documented in the docstrings. We reorganised the documentation so that functions are grouped by theme rather than listing all functions in two big files like we previously did.
Conclusion
This release is the biggest since the beginning of the IndieWeb Utils library. The code in the library is now cleaner, more consistent, easier to read, and gives developers more flexibility in terms of the input required to use library functions. There are also a few small bug fixes to address issues that were discovered in the previous release.
If you are building an IndieWeb application in Python, I would recommend checking out IndieWeb Utils to see if the library can help you out. Our library implements functions that relate to IndieAuth, endpoint discovery, retrieving reply and URL contexts, webmention handling, and more. You can read about all the functions IndieWeb Utils has in the project documentation.
If you have ideas on how we can improve the library, we would love to hear from you. Please read through the project CONTRIBUTING.md file for guidance on how you can help us!
Tagged in indieweb-utils, python, indieweb.
Responses
Comment on this post
Respond to this post by sending a Webmention.
Have a comment? Email me at readers@jamesg.blog.