Is BeautifulSoup open-source?

Feb 5, 2024 ยท 2 min read

BeautifulSoup is one of the most popular Python libraries for web scraping and parsing HTML and XML documents. With over 18,000 stars on GitHub, developers often wonder - is BeautifulSoup open-source?

The short answer is yes, BeautifulSoup is open-source and available under a permissive MIT license. This allows anyone to freely use, modify, and distribute the source code, without restriction.

But there's a bit more nuance to BeautifulSoup's licensing. The main BeautifulSoup library that most developers use is BSD-licensed. However, BeautifulSoup depends on other open-source projects with different licenses:

Beautiful Soup -> lxml -> libxml2 -> MIT License
            -> html5lib -> MIT License

The key things to know:

  • BeautifulSoup itself is released under a BSD 3-Clause license, which allows commercial and closed-source use.
  • It depends on other open-source libraries like lxml and html5lib which are under more permissive MIT licenses.
  • So while BeautifulSoup is "open core", you can freely use BeautifulSoup in commercial products as long as you comply with the MIT licenses of its dependencies.
  • The practical effect of this licensing structure is that BeautifulSoup is very permissively licensed for commercial use cases. For most developers, you can think of BeautifulSoup as MIT-licensed even though the core library itself is under BSD.

    Some key takeaways around BeautifulSoup's open-source status:

  • BeautifulSoup is open-source and can be freely modified and redistributed.
  • Its license (BSD) is very permissive and allows commercial usage.
  • It depends on other MIT-licensed libraries that also allow commercial use.
  • For most use cases, you can effectively think of BeautifulSoup as MIT-licensed.
  • BeautifulSoup is open-source all the way down and quite liberally licensed for usage in commercial products and closed-source codebases. This permissive licensing has helped fuel BeautifulSoup's popularity over the years.

    Browse by tags:

    Browse by language:

    Tired of getting blocked while scraping the web?

    ProxiesAPI handles headless browsers and rotates proxies for you.
    Get access to 1,000 free API credits, no credit card required!