{"id":21897890,"url":"https://github.com/rgladwell/microtesia","last_synced_at":"2026-04-11T21:35:13.789Z","repository":{"id":57736561,"uuid":"43818527","full_name":"rgladwell/microtesia","owner":"rgladwell","description":"Simple microdata parsing library for Scala.","archived":false,"fork":false,"pushed_at":"2020-02-03T09:46:58.000Z","size":1368,"stargazers_count":3,"open_issues_count":7,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-05T06:54:07.486Z","etag":null,"topics":["html","html-parsing","html5","microdata","parsing-library","scala"],"latest_commit_sha":null,"homepage":"http://rgladwell.github.io/microtesia/latest/api/#microtesia.package","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgladwell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-07T13:43:51.000Z","updated_at":"2020-02-02T12:51:28.000Z","dependencies_parsed_at":"2022-08-24T02:50:55.652Z","dependency_job_id":null,"html_url":"https://github.com/rgladwell/microtesia","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rgladwell/microtesia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgladwell%2Fmicrotesia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgladwell%2Fmicrotesia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgladwell%2Fmicrotesia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgladwell%2Fmicrotesia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgladwell","download_url":"https://codeload.github.com/rgladwell/microtesia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgladwell%2Fmicrotesia/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265269725,"owners_count":23737898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","html-parsing","html5","microdata","parsing-library","scala"],"created_at":"2024-11-28T14:20:19.857Z","updated_at":"2025-10-08T18:12:18.763Z","avatar_url":"https://github.com/rgladwell.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microtesia [![Build Status](https://travis-ci.org/rgladwell/microtesia.svg)](https://travis-ci.org/rgladwell/microtesia) [ ![Download](https://api.bintray.com/packages/rgladwell/maven/microtesia/images/download.svg) ](https://bintray.com/rgladwell/maven/microtesia/_latestVersion) [![Dependencies](https://app.updateimpact.com/badge/702556651743481856/microtesia.svg?config=runtime)](https://app.updateimpact.com/latest/702556651743481856/microtesia)\n\n[Microdata](http://www.w3.org/TR/microdata/) parsing library for\nScala.\n\nTo install add the following line to your SBT configuration:\n\n```\nlibraryDependencies += \"me.gladwell.microtesia\" %% \"microtesia\" % \"0.5.1\"\n```\n\nTo use simply put the Microtesia API in scope and call the `parseMicrodata`\nmethod as follows:\n\n```scala\nscala\u003e import microtesia._\nimport microtesia._\n\nscala\u003e parseMicrodata(\"\"\"\u003cdiv\n     |                    itemscope\n     |                    itemtype=\"http://schema.org/Movie\"\u003e\n     |                      \u003ch1 itemprop=\"name\"\u003eAvatar\u003c/h1\u003e\n     |                    \u003c/div\u003e\"\"\")\nres0: scala.util.Try[microtesia.MicrodataDocument] = Success(MicrodataDocument(List(MicrodataItem(List((name,MicrodataString(Avatar))),Some(http://schema.org/Movie),None))))\n```\n\nSee the [API reference](http://rgladwell.github.io/microtesia/latest/api) for\nmore information.\n\nOnce the HTML has been parsed, you can extract microdata values using for-comprehensions:\n\n```scala\nscala\u003e import microtesia._\nimport microtesia._\n\nscala\u003e val items = List(MicrodataItem(properties = Seq((\"name\", MicrodataString(\"Brian\")))))\n\nscala\u003e for {\n     |   MicrodataItem(properties, _, _) \u003c- items\n     |   MicrodataProperty(\"name\", MicrodataString(string)) \u003c- properties\n     | } yield string\nres1: List[String] = List(Brian)\n```\n\nSee [MicrodataValueSpec.scala](https://github.com/rgladwell/microtesia/blob/master/src/test/scala/microtesia/MicrodataValueSpec.scala) for more examples of microdata for-comprehensions.\n\nYou can also query microdata using an XPath-like syntax:\n\n```scala\nscala\u003e import microtesia._\nimport microtesia._\n\nscala\u003e val item = MicrodataItem(properties = Seq((\"name\", MicrodataString(\"Brian\"))))\n\nscala\u003e item \\ \"name\"\nres1: MicrodataQuery = QueryResults(List(MicrodataString(Brian)))\n```\n\n## Readers\n\nWhile you can use the for-comprehensions to write custom parsers, microtesia provides a `formats` API (based on [https://github.com/milessabin/shapeless](shapeless)) to automatically de-serialise `MicrodataValue` instances into value types and case classes:\n\n```scala\nscala\u003e import microtesia._, formats._\nimport microtesia._\nimport formats._\n\nscala\u003e case class Person(name: String, age: Int, adult: Boolean)\ndefined class Person\n\nscala\u003e MicrodataItem(\n     |   Seq(\n     |     (\"name\", MicrodataString(\"hello\")),\n     |     (\"age\", MicrodataString(\"13\")),\n     |     (\"adult\", MicrodataString(\"true\"))\n     |   )\n     | ).convertTo[Person]\nres0: scala.util.Try[Person] = Success(Person(hello,13,true))\n```\n\n## Releasing\n\nTo release a new, [tagged](https://git-scm.com/book/en/v2/Git-Basics-Tagging) version of Microtesia, execute the following:\n\n```sh\n$ sbt +publish\n$ sbt ghpages-push-site\n```\n\n## License\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation, either version 3 of the\nLicense, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this program.  If not, see\n\u003chttp://www.gnu.org/licenses/\u003e.\n\nCopyright 2015-2018 [Ricardo Gladwell](http://gladwell.me).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgladwell%2Fmicrotesia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgladwell%2Fmicrotesia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgladwell%2Fmicrotesia/lists"}