https://github.com/savonrb/nori
XML to Hash translator
https://github.com/savonrb/nori
Keywords from Contributors
rubygem mvc activerecord activejob sidekiq rspec feature-flag soap soap-client crash-reporting
Last synced: about 4 hours ago
JSON representation
Repository metadata
XML to Hash translator
- Host: GitHub
- URL: https://github.com/savonrb/nori
- Owner: savonrb
- License: mit
- Created: 2011-02-27T14:40:01.000Z (about 15 years ago)
- Default Branch: main
- Last Pushed: 2026-01-19T09:09:48.000Z (about 1 month ago)
- Last Synced: 2026-02-10T06:24:42.343Z (21 days ago)
- Language: Ruby
- Homepage:
- Size: 259 KB
- Stars: 249
- Watchers: 6
- Forks: 73
- Open Issues: 21
- Releases: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
README.md
Nori
Really simple XML parsing ripped from Crack, which ripped it from Merb.
Nori supports pluggable parsers and ships with both REXML and Nokogiri implementations.
It defaults to Nokogiri since v2.0.0, but you can change it to use REXML via:
Nori.new(:parser => :rexml) # or :nokogiri
Make sure Nokogiri is in your LOAD_PATH when parsing XML, because Nori tries to load it when it's needed.
Examples
Nori.new.parse("<tag>This is the content</tag>")
# => {"tag"=>"This is the content"}
Nori.new.parse('<foo />')
#=> {"foo"=>nil}
Nori.new.parse('<foo bar />')
#=> {}
Nori.new.parse('<foo bar="baz"/>')
#=> {"foo"=>{"@bar"=>"baz"}}
Nori.new.parse('<foo bar="baz">Content</foo>')
#=> {"foo"=>"Content"}
Nori::StringWithAttributes
You can access a string node's attributes via attributes.
result = Nori.new.parse('<foo bar="baz">Content</foo>')
#=> {"foo"=>"Content"}
result["foo"].class
# => Nori::StringWithAttributes
result["foo"].attributes
# => {"bar"=>"baz"}
advanced_typecasting
Nori can automatically convert string values to TrueClass, FalseClass, Time, Date, and DateTime:
# "true" and "false" String values are converted to `TrueClass` and `FalseClass`.
Nori.new.parse("<value>true</value>")
# => {"value"=>true}
# String values matching xs:time, xs:date and xs:dateTime are converted to `Time`, `Date` and `DateTime` objects.
Nori.new.parse("<value>09:33:55.7Z</value>")
# => {"value"=>2022-09-29 09:33:55.7 UTC
# disable with advanced_typecasting: false
Nori.new(advanced_typecasting: false).parse("<value>true</value>")
# => {"value"=>"true"}
strip_namespaces
Nori can strip the namespaces from your XML tags. This feature is disabled by default.
Nori.new.parse('<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"></soap:Envelope>')
# => {"soap:Envelope"=>{"@xmlns:soap"=>"http://schemas.xmlsoap.org/soap/envelope/"}}
Nori.new(:strip_namespaces => true).parse('<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"></soap:Envelope>')
# => {"Envelope"=>{"@xmlns:soap"=>"http://schemas.xmlsoap.org/soap/envelope/"}}
convert_tags_to
Nori lets you specify a custom formula to convert XML tags to Hash keys using convert_tags_to.
Nori.new.parse('<userResponse><accountStatus>active</accountStatus></userResponse>')
# => {"userResponse"=>{"accountStatus"=>"active"}}
parser = Nori.new(:convert_tags_to => lambda { |tag| Nori::StringUtils.snakecase(tag).to_sym })
parser.parse('<userResponse><accountStatus>active</accountStatus></userResponse>')
# => {:user_response=>{:account_status=>"active"}}
convert_dashes_to_underscores
By default, Nori will automatically convert dashes in tag names to underscores.
Nori.new.parse('<any-tag>foo bar</any-tag>')
# => {"any_tag"=>"foo bar"}
# disable with convert_dashes_to_underscores
parser = Nori.new(:convert_dashes_to_underscores => false)
parser.parse('<any-tag>foo bar</any-tag>')
# => {"any-tag"=>"foo bar"}
Owner metadata
- Name: savonrb
- Login: savonrb
- Email:
- Kind: organization
- Description:
- Website: https://www.savonrb.com/
- Location:
- Twitter: savonrb
- Company:
- Icon url: https://avatars.githubusercontent.com/u/2353495?v=4
- Repositories: 12
- Last ynced at: 2024-03-25T19:56:36.386Z
- Profile URL: https://github.com/savonrb
GitHub Events
Total
- Issues event: 1
- Watch event: 2
- Issue comment event: 3
- Pull request event: 1
- Fork event: 1
Last Year
- Watch event: 1
- Issue comment event: 3
- Pull request event: 1
- Fork event: 1
Committers metadata
Last synced: 3 days ago
Total Commits: 213
Total Committers: 37
Avg Commits per committer: 5.757
Development Distribution Score (DDS): 0.521
Commits in past year: 1
Committers in past year: 1
Avg Commits per committer in past year: 1.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| rubiii | me@r****m | 102 |
| John Nunemaker | n****r@g****m | 30 |
| Tim Jarratt | t****t@g****m | 14 |
| Wynn Netherland | w****d@g****m | 11 |
| Peter Cai | 2****i | 9 |
| Olle Jonsson | o****n@g****m | 8 |
| weidenfreak | m****n@b****e | 4 |
| Korny Sietsma | k****y@s****m | 3 |
| robuye | r****k@g****m | 3 |
| Gene Drabkin | g****n@g****m | 2 |
| Tim Jarratt | p****t@g****m | 1 |
| Sergey Baev | s****v@a****u | 1 |
| Jussi Koljonen | j****n@m****m | 1 |
| Henry Hsu | h****u@z****m | 1 |
| Alethea Rose | a****a@a****m | 1 |
| Andrzej Kajetanowicz | a****z@g****m | 1 |
| Douglas Eichelberger | d****g | 1 |
| Felix Wang | m****x@g****m | 1 |
| sanemat | o****n@g****m | 1 |
| gaaady | g****y@g****m | 1 |
| edmz | e****z@g****m | 1 |
| deadprogrammer | r****s@g****m | 1 |
| barberj | b****n@g****m | 1 |
| Yuri Zubov | y****u@g****m | 1 |
| Tim Riley | t****m@o****m | 1 |
| Thomas Jachmann | s****f@t****m | 1 |
| Tamal White | t****e@a****m | 1 |
| Sandro Turriate | s****e@g****m | 1 |
| Michael Chu | 1****u | 1 |
| László Bácsi | l****c@l****u | 1 |
| and 7 more... | ||
Committer domains:
- florian-duetsch.de: 1
- autonomousmachine.com: 1
- geekdaily.org: 1
- technicalpickles.com: 1
- dataart.com: 1
- lackac.hu: 1
- apple.com: 1
- thomasjachmann.com: 1
- openmonkey.com: 1
- alethearose.com: 1
- zendesk.com: 1
- maventa.com: 1
- at-consulting.ru: 1
- sietsma.com: 1
- blau.de: 1
- rubiii.com: 1
Issue and Pull Request metadata
Last synced: 7 days ago
Total issues: 55
Total pull requests: 54
Average time to close issues: over 1 year
Average time to close pull requests: 7 months
Total issue authors: 52
Total pull request authors: 40
Average comments per issue: 3.42
Average comments per pull request: 1.76
Merged pull request: 32
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 1
Past year average time to close issues: N/A
Past year average time to close pull requests: 3 days
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 1.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- pokonski (2)
- inossidabile (2)
- rubiii (2)
- arkes (1)
- ArnoldMEDLINQ (1)
- toobulkeh (1)
- barberj (1)
- mrnovalles (1)
- arjunmenon (1)
- jedbeard (1)
- munshkr (1)
- burlesona (1)
- james-em (1)
- pcai (1)
- sathish316 (1)
Top Pull Request Authors
- olleolleolle (9)
- robuye (4)
- ekzobrain (2)
- Pepan (2)
- mchu (2)
- thomasjachmann (1)
- gaaady (1)
- anandagrawal84 (1)
- HarlemSquirrel (1)
- alethea (1)
- barberj (1)
- hsume2 (1)
- weidenfreak (1)
- yuri-zubov (1)
- joshwlewis (1)
Top Issue Labels
- support (4)
- bug (4)
- improvement (2)
- Help wanted (1)
- feature (1)
- release (1)
- roadmap (1)
Top Pull Request Labels
- bug (1)
Package metadata
- Total packages: 12
-
Total downloads:
- rubygems: 241,342,113 total
- Total docker downloads: 1,175,885,386
- Total dependent packages: 173 (may contain duplicates)
- Total dependent repositories: 7,179 (may contain duplicates)
- Total versions: 60
- Total maintainers: 4
- Total advisories: 2
gem.coop: nori
XML to Hash translator
- Homepage: https://github.com/savonrb/nori
- Documentation: http://www.rubydoc.info/gems/nori/
- Licenses: MIT
- Latest release: 2.7.1 (published over 1 year ago)
- Last Synced: 2026-03-01T20:31:31.791Z (2 days ago)
- Versions: 25
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 120,675,281 Total
- Docker Downloads: 587,942,693
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.092%
- Docker downloads count: 0.157%
- Downloads: 0.211%
- Maintainers (4)
- Advisories:
rubygems.org: nori
XML to Hash translator
- Homepage: https://github.com/savonrb/nori
- Documentation: http://www.rubydoc.info/gems/nori/
- Licenses: MIT
- Latest release: 2.7.1 (published over 1 year ago)
- Last Synced: 2026-03-01T09:57:14.093Z (2 days ago)
- Versions: 25
- Dependent Packages: 173
- Dependent Repositories: 7,179
- Downloads: 120,666,832 Total
- Docker Downloads: 587,942,693
-
Rankings:
- Downloads: 0.189%
- Docker downloads count: 0.189%
- Dependent packages count: 0.205%
- Dependent repos count: 0.38%
- Average: 1.282%
- Forks count: 3.065%
- Stargazers count: 3.666%
- Maintainers (4)
- Advisories:
debian-10: ruby-nori
- Homepage: https://github.com/savonrb/nori
- Documentation: https://packages.debian.org/buster/ruby-nori
- Licenses:
- Latest release: 2.6.0-1 (published 20 days ago)
- Last Synced: 2026-02-13T04:23:28.258Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-nori
- Homepage: https://github.com/savonrb/nori
- Documentation: https://packages.debian.org/bullseye/ruby-nori
- Licenses:
- Latest release: 2.6.0-1.1 (published 21 days ago)
- Last Synced: 2026-02-13T08:23:00.076Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-nori
- Homepage: https://github.com/savonrb/nori
- Documentation: https://packages.debian.org/bookworm/ruby-nori
- Licenses:
- Latest release: 2.6.0-1.1 (published 19 days ago)
- Last Synced: 2026-02-12T23:36:31.536Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
debian-13: ruby-nori
- Homepage: https://github.com/savonrb/nori
- Documentation: https://packages.debian.org/trixie/ruby-nori
- Licenses: mit
- Latest release: 2.6.0-1.1 (published 19 days ago)
- Last Synced: 2026-02-13T13:17:56.382Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- rexml ~> 3.2
- nokogiri >= 1.4.0 development
- rake ~> 12.3.3 development
- rspec ~> 3.11.0 development
- actions/checkout v2 composite
- ruby/setup-ruby v1 composite
Score: 30.281313890485574