{"id":16389594,"url":"https://github.com/yuce/random","last_synced_at":"2025-03-23T04:31:37.721Z","repository":{"id":10365173,"uuid":"12506540","full_name":"yuce/random","owner":"yuce","description":"Elixir port of Python 3 random module.","archived":false,"fork":false,"pushed_at":"2017-08-05T11:59:36.000Z","size":25,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T17:50:51.836Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuce.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}},"created_at":"2013-08-31T14:21:38.000Z","updated_at":"2023-09-01T10:50:38.000Z","dependencies_parsed_at":"2022-09-26T18:31:48.192Z","dependency_job_id":null,"html_url":"https://github.com/yuce/random","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuce%2Frandom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuce%2Frandom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuce%2Frandom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuce%2Frandom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuce","download_url":"https://codeload.github.com/yuce/random/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056889,"owners_count":20553855,"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-10-11T04:33:44.070Z","updated_at":"2025-03-23T04:31:37.340Z","avatar_url":"https://github.com/yuce.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elixir Random module\n\nThis module contains pseudo-random number generators for various distributions\nported from Python 3 `random` module for [Elixir](http://elixir-lang.org).\nThe documentation below is adapted from that module as well.\n\n\u003e For integers, there is uniform selection from a range. For sequences, there is uniform\nselection of a random element, a function to generate a random permutation of a list in-place,\nand a function for random sampling without replacement.\n\n\u003e On the real line, there are functions to compute uniform, normal (Gaussian), lognormal,\nnegative exponential, gamma, and beta distributions. For generating distributions of angles,\nthe von Mises distribution is available.\n\n## Documentation\n\n* [Module documentation](http://yuce.github.io/random/)\n\n* [Python 3 random module documentation](http://docs.python.org/3/library/random.html)\n\n\n## Build\n\nThe only dependency is [TinyMT Erlang](https://github.com/jj1bdx/tinymt-erlang), which\nis available on [hex.pm](https://hex.pm/packages/tinymt)\n\n    $ mix get.deps\n    $ mix\n\n## Test\n\n    $ mix test\n\n## Usage\n\n**Random** is available on [hex.pm](https://hex.pm/packages/random).\nYou neeed to include `{:random, \"~\u003e 0.2.3\"}` as a dependency in your project.\n\n## Examples\n\n    iex(1)\u003e Random.randint(10, 20)\n    14\n    iex(2)\u003e Random.sample(0..10000, 4)\n    [4436, 5015, 7231, 9459]\n    iex(3)\u003e {n, gauss_next} = Random.gauss(1, 2)\n    {-2.0056082102271917, 0.5561885306380824}\n    iex(4)\u003e {n, gauss_next} = Random.gauss(1, 2, gauss_next)\n    {2.112377061276165, nil}\n\n## Thanks\n\n* [Kenji Rikitake](https://github.com/jj1bdx) pointed out a range error in the module and provided code which enables using his [TinyMT Erlang](https://github.com/jj1bdx/tinymt-erlang)\nlibrary to produce floats in `[0.0, 1.0)` range.\n\n* [p2k](https://github.com/p2k) updated the project to be compatible with Elixir 1.2.\n\n* [sashaegorov](https://github.com/sashaegorov) updated the project to be compatible with Elixir 1.4.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuce%2Frandom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuce%2Frandom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuce%2Frandom/lists"}