{"id":15759210,"url":"https://github.com/nwtgck/rubyize-python","last_synced_at":"2026-05-03T06:36:21.816Z","repository":{"id":52421338,"uuid":"116485281","full_name":"nwtgck/rubyize-python","owner":"nwtgck","description":"Write Python in Ruby-like way","archived":false,"fork":false,"pushed_at":"2021-04-29T19:19:20.000Z","size":64,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"feature/basic","last_synced_at":"2025-02-06T13:30:06.369Z","etag":null,"topics":["python","python-library","ruby"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nwtgck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-06T13:31:41.000Z","updated_at":"2019-02-18T15:13:16.000Z","dependencies_parsed_at":"2022-09-06T10:20:29.960Z","dependency_job_id":null,"html_url":"https://github.com/nwtgck/rubyize-python","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/nwtgck%2Frubyize-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtgck%2Frubyize-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtgck%2Frubyize-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtgck%2Frubyize-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwtgck","download_url":"https://codeload.github.com/nwtgck/rubyize-python/tar.gz/refs/heads/feature/basic","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246443537,"owners_count":20778249,"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":["python","python-library","ruby"],"created_at":"2024-10-04T10:04:09.902Z","updated_at":"2026-05-03T06:36:16.787Z","avatar_url":"https://github.com/nwtgck.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rubyize\n\n![Rubyize logo](logo.png)\n\n| branch | Travis status|\n| --- | --- |\n| [`develop`](https://github.com/nwtgck/rubyize-python/tree/develop) | [![Build Status](https://travis-ci.com/nwtgck/rubyize-python.svg?token=TuxNpqznwwyy7hyJwBVm\u0026branch=develop)](https://travis-ci.com/nwtgck/rubyize-python) |\n\nWrite Python in Ruby-like way\n\n## Installation\n\n```bash\npip3 install toml\npip3 install git+https://github.com/nwtgck/rubyize-python\n```\n\n## Usages\n\nHere is an import-magic for adding methods to collection classes such as `list`.\n\n```py\nimport rubyize\n```\n\n```py\n[1, 2, 3].length()\n# =\u003e 3\n\n[1, 2, 3].map(lambda x: x*2)\n# =\u003e [2, 4, 6]\n\n[1, 2, 3].filter(lambda x: x % 2 == 0)\n# =\u003e [2]\n\n[1, 2, 3].inject(lambda s, e: s + e)\n# =\u003e 6\n\n[1, 2, 3].inject(100, lambda s, e: s + e)\n# =\u003e 106\n\n[1, 2, 3].take(2)\n# =\u003e [1, 2]\n\n[1, 2, 3].drop(2)\n# =\u003e [3]\n\n[1, 2, 3, 4, 5, 6].group_by(lambda e: e % 2 == 0)\n# =\u003e {True: [2, 4, 6], False: [1, 3, 5]}\n\n[1, 2, None, 4, None, 6].compact()\n# =\u003e [1, 2, 4, 6]\n\n[1, 2, 3].flat_map(lambda e: [e] * 2)\n# =\u003e [1, 1, 2, 2, 3, 3]\n\n[1, 2, 3, 4, 5].each_cons(3)\n# =\u003e [[1, 2, 3], [2, 3, 4], [3, 4, 5]]\n\n[1, 2, 3, 4, 5].each_slice(2)\n# =\u003e [[1, 2], [3, 4], [5]]\n\n[1, 2, 3, 4, 5].join(',')\n# =\u003e \"1,2,3,4,5\"\n```\n\n## Not only list\n\n```py\nmap(lambda e: e, [1, 2, 3]).map(lambda x: x * 2)\nmap(lambda e: e, [1, 2, 3]).length()\nmap(lambda e: e, [1, 2, 3]).take(2)\n...\n```\n\n## Why Rubyize?\n\nCollection API of Ruby is very rich! Ruby has prepared a lot of methods. So, users can write easily about what they want to do. Users make method chains, which are directly connected to our brain thinking rather than built-in `len(mylist)`, `len(mylist)`  and etc, I think.\n\n## Caution\n\nRubyize can destroy the Python culture. I think that Python is designed for everyone writing in the same way. However, Rubyize allows users to write code in different ways. Readability in terms of the Python culture can be worse. Thus, I think Rubyize should not be used in production. Rubyize should be used in disposable code or etc.\n\n## Forbidden Fruit\n\nThis project is powered by [Forbiddenfruit](https://github.com/clarete/forbiddenfruit).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwtgck%2Frubyize-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwtgck%2Frubyize-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwtgck%2Frubyize-python/lists"}