{"id":22588341,"url":"https://github.com/danini-the-panini/tag_monster","last_synced_at":"2025-03-28T17:42:25.161Z","repository":{"id":22541041,"uuid":"25881876","full_name":"danini-the-panini/tag_monster","owner":"danini-the-panini","description":"EAT ALL THE TAGS!","archived":false,"fork":false,"pushed_at":"2015-01-22T19:29:06.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-02T18:19:24.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danini-the-panini.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":"2014-10-28T17:42:23.000Z","updated_at":"2014-10-28T17:43:00.000Z","dependencies_parsed_at":"2022-08-21T07:00:43.248Z","dependency_job_id":null,"html_url":"https://github.com/danini-the-panini/tag_monster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danini-the-panini%2Ftag_monster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danini-the-panini%2Ftag_monster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danini-the-panini%2Ftag_monster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danini-the-panini%2Ftag_monster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danini-the-panini","download_url":"https://codeload.github.com/danini-the-panini/tag_monster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246071838,"owners_count":20719192,"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":[],"created_at":"2024-12-08T08:09:15.860Z","updated_at":"2025-03-28T17:42:25.132Z","avatar_url":"https://github.com/danini-the-panini.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tag Monster!\n\nTag monster helps you extract information from enormous XML files without eating up all your memory and knocking your server over. It does this by going through the file one tag at a time without loading the whole thing in memory, so you can data mine the crap out of those massive XML files you got from who-knows-where.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'tag_monster'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install tag_monster\n\n## Usage\n\nGiven this XML:\n\n```xml\n\u003croot\u003e\n  \u003centity id=\"1\"\u003e\n    \u003cname\u003eFoo\u003c/name\u003e\n    \u003cproduct\u003e\n      \u003cprice\u003e100\u003c/price\u003e\n      \u003cunits\u003e\n        \u003cunit\u003eBob\u003c/unit\u003e\n        \u003cunit\u003eLarry\u003c/unit\u003e\n      \u003c/units\u003e\n    \u003c/product\u003e\n  \u003c/entity\u003e\n  \u003centity id=\"2\"\u003e\n    \u003cname\u003eBar\u003c/name\u003e\n    \u003cproduct\u003e\n      \u003cprice\u003e250\u003c/price\u003e\n      \u003cunits\u003e\n        \u003cunit\u003eSally\u003c/unit\u003e\n      \u003c/units\u003e\n    \u003c/product\u003e\n  \u003c/entity\u003e\n  ...\n\u003c/root\u003e\n```\n\nAnd this ruby:\n\n```ruby\ndoc = TagMonster::Document.new input_stream\n\ndoc.each_element '/root/entity' do |element|\n\n  id = element.attributes['id']\n\n  data = element.extract name: '/name', price: '/product/price', units: '/product/units/unit'\n\n  name = data[:name][0]\n  price = data[:price][0]\n  units = data[:units]\n\nend\n```\n\nYou'll get the following values:\n\n```ruby\nid = \"1\"\nname = \"Foo\"\nprice = \"100\"\nunits = [\"Bob\",\"Larry\"]\n\nid = \"2\"\nname = \"Bar\"\nprice = \"250\"\nunits = [\"Sally\"]\n\n...\n```\n\n## Limitations\n\nCurrently can only be used for simple XML processing.\n\n## Contributing\n\n  1. Fork it ( https://github.com/[my-github-username]/tag_remover/fork )\n  2. Create your feature branch (`git checkout -b my-new-feature`)\n  3. Commit your changes (`git commit -am 'Add some feature'`)\n  4. Push to the branch (`git push origin my-new-feature`)\n  5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanini-the-panini%2Ftag_monster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanini-the-panini%2Ftag_monster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanini-the-panini%2Ftag_monster/lists"}