{"id":16621884,"url":"https://github.com/forscht/namegen","last_synced_at":"2025-07-27T22:38:51.877Z","repository":{"id":154089085,"uuid":"631602958","full_name":"forscht/namegen","owner":"forscht","description":"Namegen is a Go package for generating random names. It provides a simple library for generating names based on different settings like the number of words, the separator between words, and the capitalization style.","archived":false,"fork":false,"pushed_at":"2023-04-23T15:59:51.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T08:29:06.482Z","etag":null,"topics":["namegenerator","random","unique"],"latest_commit_sha":null,"homepage":"","language":"Go","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/forscht.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-04-23T14:45:11.000Z","updated_at":"2023-06-27T02:25:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6f59b1f-fd02-4f13-b518-98c880894628","html_url":"https://github.com/forscht/namegen","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/forscht/namegen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forscht%2Fnamegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forscht%2Fnamegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forscht%2Fnamegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forscht%2Fnamegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forscht","download_url":"https://codeload.github.com/forscht/namegen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forscht%2Fnamegen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260780809,"owners_count":23062097,"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":["namegenerator","random","unique"],"created_at":"2024-10-12T02:48:48.962Z","updated_at":"2025-07-27T22:38:51.859Z","avatar_url":"https://github.com/forscht.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Namegen\n\nNamegen is a Go package for generating random names. It provides a simple library for generating names based on different settings like the number of words, the separator between words, and the capitalization style.\n\n## Installation\nTo install the namegen package, use the following command:\n```shell\ngo get github.com/forscht/namegen\n```\n\n## Usage\nTo use the namegen package, import it in your Golang code and create a new Generator object. You can then customize the generator using the various With methods to set the number of words, word separator, dictionaries, style, and seed. Finally, call the Generate method to generate a new random name based on the settings of the generator.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"time\"\n\n    \"github.com/forscht/namegen\"\n    \"github.com/forscht/namegen/dictionaries\"\n)\n\nfunc main() {\n    // Generate a new name\n    name := namegen.New().\n        WithNumberOfWords(3). // Number of words. Default 3\n        WithWordSeparator(\"-\"). // Words Separator, Default \" \"\n        WithStyle(namegen.Title). // Default Title, Opt Title,UpperCase,LowerCase\n        WithDictionaries(dictionaries.Adjectives, []string{\"red\", \"blue\", \"green\"}, dictionaries.Animals). // Use Default Dictionaries\n        WithSeed(time.Now().UnixNano()). // Use custom seed\n        Generate()\n    fmt.Println(name) // Output: Evil-Red-Hyena\n\n    // Generate with Default settings\n    name = namegen.GenerateName()\n    fmt.Println(name) // Output: Real Purple Barracuda\n\n    // Use same settings to use multiple names\n    ng := namegen.New().WithStyle(namegen.Lowercase).WithNumberOfWords(2)\n    name1 := ng.Generate()\n    name2 := ng.Generate()\n    fmt.Println(name1) // Output: top magenta\n    fmt.Println(name2) // Output: adverse burgundy\n}\n```\n\n## API\nNamegen provides the following methods for generating names:\n\n- GenerateName() string: generate a new random name with default settings\n- New() *Generator: creates a new generator instance with default settings\n\nNamegen provides the following methods for customizing the Generator object:\n\n- WithNumberOfWords(numWords int): set the number of words in the generated name\n- WithWordSeparator(separator string): set the separator between words in the generated name\n- WithDictionary(dictionaries ...[]string): set the dictionaries to be used for generating names\n- WithStyle(style string): set the capitalization style for the generated name\n- WithSeed(seed int64): set the seed for the random number generator used for generating names\n\n## License\nThis package is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforscht%2Fnamegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforscht%2Fnamegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforscht%2Fnamegen/lists"}