{"id":19667252,"url":"https://github.com/willnet/gimei","last_synced_at":"2026-01-06T10:15:23.250Z","repository":{"id":5768006,"uuid":"6981206","full_name":"willnet/gimei","owner":"willnet","description":"random Japanese name and address generator","archived":false,"fork":false,"pushed_at":"2025-05-02T01:22:16.000Z","size":678,"stargazers_count":417,"open_issues_count":4,"forks_count":32,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-13T13:10:50.016Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"https://willnet.github.io/gimei","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/willnet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-12-03T11:31:18.000Z","updated_at":"2025-05-05T12:10:41.000Z","dependencies_parsed_at":"2024-06-18T15:16:33.758Z","dependency_job_id":"699f46fa-4691-4107-af61-f9fdec96699e","html_url":"https://github.com/willnet/gimei","commit_stats":{"total_commits":136,"total_committers":16,"mean_commits":8.5,"dds":0.2941176470588235,"last_synced_commit":"b618868f600eb048a69593e3bff372efbbe87c2b"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Fgimei","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Fgimei/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Fgimei/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Fgimei/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willnet","download_url":"https://codeload.github.com/willnet/gimei/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310515,"owners_count":22049469,"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":["ruby"],"created_at":"2024-11-11T16:31:21.838Z","updated_at":"2026-01-06T10:15:23.244Z","avatar_url":"https://github.com/willnet.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gimei\n\n[![Coveralls](https://coveralls.io/repos/willnet/gimei/badge.svg)](https://coveralls.io/r/willnet/gimei)\n[![Code Climate](https://codeclimate.com/github/willnet/gimei/badges/gpa.svg)](https://codeclimate.com/github/willnet/gimei)\n[![Gem](https://img.shields.io/gem/v/gimei.svg)](https://rubygems.org/gems/gimei)\n\n[日本語のドキュメントはこちら(Japanese README)](README.ja.md)\n\ngimei is a library that generates random Japanese names and addresses. It is useful for testing purposes. A similar library is [faker](https://github.com/stympy/faker). [faker](https://github.com/stympy/faker) is an excellent library with multilingual support, but naturally does not support furigana (reading of Japanese characters). gimei supports furigana.\n\n## Usage\n\n### Generate random names\n\nYou can use it as follows:\n\n```ruby\ngimei = Gimei.name\ngimei.kanji          #=\u003e \"斎藤 陽菜\" (Saitou Haruna)\ngimei.hiragana       #=\u003e \"さいとう はるな\"\ngimei.katakana       #=\u003e \"サイトウ ハルナ\"\ngimei.romaji         #=\u003e \"Haruna Saitou\"\ngimei.gender         #=\u003e :female\ngimei.male?          #=\u003e false\ngimei.female?        #=\u003e true\ngimei.last.kanji     #=\u003e \"斎藤\" (Saitou)\ngimei.last.hiragana  #=\u003e \"さいとう\"\ngimei.last.katakana  #=\u003e \"サイトウ\"\ngimei.last.romaji    #=\u003e \"Saitou\"\ngimei.first.kanji    #=\u003e \"陽菜\" (Haruna)\ngimei.first.hiragana #=\u003e \"はるな\"\ngimei.first.katakana #=\u003e \"ハルナ\"\ngimei.first.romaji   #=\u003e \"Haruna\"\n```\n\nYou can also use `gimei.family` and `gimei.given` instead of `gimei.last` and `gimei.first`.\n\n```ruby\ngimei.family.kanji     #=\u003e \"斎藤\"\ngimei.family.hiragana  #=\u003e \"さいとう\"\ngimei.family.katakana  #=\u003e \"サイトウ\"\ngimei.family.romaji    #=\u003e \"Saitou\"\n\ngimei.given.kanji    #=\u003e \"陽菜\"\ngimei.given.hiragana #=\u003e \"はるな\"\ngimei.given.katakana #=\u003e \"ハルナ\"\ngimei.given.romaji   #=\u003e \"Haruna\"\n```\n\nYou can explicitly specify whether to return a male or female name as shown below. `Gimei.name` returns male and female names with equal probability.\n\n```ruby\ngimei = Gimei.male\ngimei.male?   #=\u003e true\ngimei.female? #=\u003e false\ngimei.gender  #=\u003e :male\ngimei.kanji   #=\u003e \"小林 顕士\" (Kobayashi Kenji)\n\ngimei = Gimei.female\ngimei.male?   #=\u003e false\ngimei.female? #=\u003e true\ngimei.gender  #=\u003e :female\ngimei.kanji   #=\u003e \"根本 彩世\" (Nemoto Ayase)\n```\n\nIf you only need one type of script (Kanji, Hiragana, Katakana, or Romaji), you can write it in a shortened form as follows:\n\n```ruby\nGimei.kanji          #=\u003e \"伊藤 結衣\"\nGimei.hiragana       #=\u003e \"いとう みさき\"\nGimei.katakana       #=\u003e \"タカハシ ユイナ\"\nGimei.romaji         #=\u003e \"Miki Obara\"\nGimei.last.kanji     #=\u003e \"清水\"\nGimei.last.hiragana  #=\u003e \"いとう\"\nGimei.last.katakana  #=\u003e \"コバヤシ\"\nGimei.last.romaji    #=\u003e \"Wakabayashi\"\nGimei.first.kanji    #=\u003e \"結菜\"\nGimei.first.hiragana #=\u003e \"ここあ\"\nGimei.first.katakana #=\u003e \"ヤマト\"\nGimei.first.romaji   #=\u003e \"Noriyuki\"\n\nGimei.family.kanji     #=\u003e \"黒沢\"\nGimei.family.hiragana  #=\u003e \"いずみ\"\nGimei.family.katakana  #=\u003e \"エノモト\"\nGimei.family.romaji    #=\u003e \"Okada\"\n\nGimei.given.kanji    #=\u003e \"航\"\nGimei.given.hiragana #=\u003e \"まさみつ\"\nGimei.given.katakana #=\u003e \"ユカ\"\nGimei.given.romaji   #=\u003e \"Haruto\"\n```\n\nIf you do not want to retrieve the same name twice, you can use `unique`. By doing so, Gimei will keep track of the names used and ensure that a unique name is returned.\n\n```ruby\nGimei.unique.name\n```\n\nIn the above case, the full name in Kanji is guaranteed to be unique. That is, there may be duplicates in terms of surname or given name, as shown below.\n\n```ruby\nGimei.unique.name.kanji #=\u003e \"前島 真一\"\nGimei.unique.name.kanji #=\u003e \"神谷 真一\"\nGimei.unique.name.kanji #=\u003e \"前島 太郎\"\n```\n\nIf you want to avoid this, use `last` or `first` as follows. This returns a unique name for the surname or given name.\n\n```ruby\nGimei.unique.last\nGimei.unique.first\n```\n\nEven in this case, there may be duplicates in terms of furigana.\n\n```ruby\nGimei.unique.first.hiragana #=\u003e \"しんいち\"\nGimei.unique.first.hiragana #=\u003e \"しんいち\"\n```\n\nIf unique names cannot be returned (e.g., if the list of candidates is exhausted), an error will be raised.\n\nIf you want to clear the list of names used so far, do the following:\n\n```ruby\nGimei.unique.clear # Clear all\nGimei.unique.clear(:name) # Clear results of Gimei.unique.name\nGimei.unique.clear(:first) # Clear results of Gimei.unique.first\n```\n\nNames generated by the following methods are cleared with `Gimei.unique.clear(:name)`.\n\n- `Gimei.unique.male`\n- `Gimei.unique.female`\n- `Gimei.unique.kanji`\n\nThe candidate data for names is located in `lib/data/names.yml`. Modify the file if necessary.\n\n### Generate random addresses\n\nFrom version 0.2.0, you can also retrieve address information. You can get address information combining prefecture, city/ward, and town in Kanji, Hiragana, and Katakana.\n\n```ruby\naddress = Gimei.address\naddress.kanji                 # =\u003e 岡山県大島郡大和村稲木町\naddress.to_s                  # =\u003e 岡山県大島郡大和村稲木町\naddress.hiragana              # =\u003e おかやまけんおおしまぐんやまとそんいなぎちょう\naddress.katakana              # =\u003e オカヤマケンオオシマグンヤマトソンイナギチョウ\naddress.romaji                # =\u003e Okayamaken Ooshimagunyamatoson Inagicho\n\naddress.prefecture.kanji      # =\u003e 岡山県\naddress.prefecture.to_s       # =\u003e 岡山県\naddress.prefecture.hiragana   # =\u003e おかやまけん\naddress.prefecture.katakana   # =\u003e オカヤマケン\naddress.prefecture.romaji     # =\u003e Okayamaken\n\naddress.city.kanji            # =\u003e 大島郡大和村\naddress.city.to_s             # =\u003e 大島郡大和村\naddress.city.hiragana         # =\u003e おおしまぐんやまとそん\naddress.city.katakana         # =\u003e オオシマグンヤマトソン\naddress.city.romaji           # =\u003e Ooshimagunyamatoson\n\naddress.town.kanji            # =\u003e 稲木町\naddress.town.to_s             # =\u003e 稲木町\naddress.town.hiragana         # =\u003e いなぎちょう\naddress.town.katakana         # =\u003e イナギチョウ\naddress.town.romaji           # =\u003e Inagicho\n```\n\nAbbreviations are also available.\n\n```ruby\nGimei.prefecture.kanji        # =\u003e 青森県\nGimei.prefecture.to_s         # =\u003e 滋賀県\nGimei.prefecture.hiragana     # =\u003e やまがたけん\nGimei.prefecture.katakana     # =\u003e チバケン\nGimei.prefecture.romaji       # =\u003e Wakayamaken\n\nGimei.city.kanji              # =\u003e 利根郡昭和村\nGimei.city.hiragana           # =\u003e うべし\nGimei.city.katakana           # =\u003e カモグンヤオツチョウ\nGimei.city.romaji             # =\u003e Itanogunaizumichou\n\nGimei.town.kanji              # =\u003e 竹野\nGimei.town.to_s               # =\u003e 富久山町南小泉\nGimei.town.hiragana           # =\u003e じょうしんでん\nGimei.town.katakana           # =\u003e イケナイ\nGimei.town.romaji             # =\u003e Heisei\n```\n\nIf you do not want to retrieve the same address twice, use `unique` as follows. By doing so, Gimei will keep track of the addresses used and ensure that a unique address is returned.\n\n```ruby\naddress = Gimei.unique.address\n```\n\nIn the above case, the entire address is guaranteed to be unique. That is, duplicates may occur at the prefecture or municipality level as shown below.\n\n```ruby\nGimei.unique.address.prefecture.kanji #=\u003e 東京都\nGimei.unique.address.prefecture.kanji #=\u003e 東京都\n```\n\nIf you want to ensure uniqueness at the prefecture or municipality level, use the abbreviated forms as follows.\n\n```ruby\nGimei.unique.prefecture.kanji #=\u003e 東京都\nGimei.unique.prefecture.kanji #=\u003e 神奈川県\n```\n\nIf unique names cannot be returned (e.g., if the list of candidates is exhausted), an error will be raised.\n\nIf you want to clear the list of addresses used so far, do the following:\n\n```ruby\nGimei.unique.clear # Clear all\nGimei.unique.clear(:address) # Clear results of Gimei.unique.address\nGimei.unique.clear(:prefecture) # Clear results of Gimei.unique.prefecture\n```\n\nThe candidate data for addresses is located in `lib/data/addresses.yml`. Modify the file if necessary.\n\n### Reproducible random data\n\nYou can generate reproducible random data by setting a random number generator as follows.\n\n```ruby\nGimei.config.rng = Random.new(42)\nGimei.name.kanji    #=\u003e \"飯島 誠吾\"\nGimei.address.kanji #=\u003e \"熊本県日進市東場内\"\n\nGimei.config.rng = Random.new(42)\nGimei.name.kanji    #=\u003e \"飯島 誠吾\"\nGimei.address.kanji #=\u003e \"熊本県日進市東場内\"\n```\n\n## Supported versions\n\nRuby 2.3 or higher\n\n## Implementations in other languages\n\n- .NET       [matarillo/dot-gimei](https://github.com/matarillo/dot-gimei)\n- Elixir     [ma2gedev/gimei_ex](https://github.com/ma2gedev/gimei_ex)\n- Emacs Lisp [gongo/emacs-gimei](https://github.com/gongo/emacs-gimei)\n- Go         [mattn/go-gimei](https://github.com/mattn/go-gimei)\n- Java       [moznion/gimei-java](https://github.com/moznion/gimei-java)\n- Node.js    [sabakan404/node-gimei](https://github.com/sabakan404/node-gimei)\n- Perl       [youpong/Data-Gimei](https://github.com/youpong/Data-Gimei)\n- Python     [nabetama/gimei](https://github.com/nabetama/gimei)\n- TypeScript [abcb2/type-gimei](https://github.com/abcb2/type-gimei)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'gimei'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install gimei\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillnet%2Fgimei","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillnet%2Fgimei","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillnet%2Fgimei/lists"}