{"id":17831164,"url":"https://github.com/dragonxdev/words-to-numbers","last_synced_at":"2025-09-21T12:34:04.346Z","repository":{"id":233625044,"uuid":"787241884","full_name":"DragonXDev/words-to-numbers","owner":"DragonXDev","description":"A difficult challenge to convert a number \u003e 0 to words form without packages or libraries in a single line.","archived":false,"fork":false,"pushed_at":"2024-05-06T17:13:47.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T12:31:47.385Z","etag":null,"topics":["challenge","oneliner","poetry","python3","words-to-numbers"],"latest_commit_sha":null,"homepage":"","language":"Python","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/DragonXDev.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":"2024-04-16T06:46:01.000Z","updated_at":"2024-04-16T07:10:48.000Z","dependencies_parsed_at":"2024-04-17T00:18:35.605Z","dependency_job_id":"042e15ac-7f7a-4118-9d22-dd187367981d","html_url":"https://github.com/DragonXDev/words-to-numbers","commit_stats":null,"previous_names":["dragonxdev/words-to-numbers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DragonXDev/words-to-numbers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DragonXDev%2Fwords-to-numbers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DragonXDev%2Fwords-to-numbers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DragonXDev%2Fwords-to-numbers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DragonXDev%2Fwords-to-numbers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DragonXDev","download_url":"https://codeload.github.com/DragonXDev/words-to-numbers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DragonXDev%2Fwords-to-numbers/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260447686,"owners_count":23010548,"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":["challenge","oneliner","poetry","python3","words-to-numbers"],"created_at":"2024-10-27T19:41:39.947Z","updated_at":"2025-09-21T12:33:59.238Z","avatar_url":"https://github.com/DragonXDev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Words to Numbers\r\n\r\nThe challenge is simple: Convert numbers into their word form, with no tricks like libraries, packages, caching, etc.\r\n\r\nThe \"Words to Numbers\" project is a challenging Python script that converts numbers (greater than 0) into their word form only with a single line of code. Originally aimed to produce this program in under 90 lines in Python, I refined and rewrote it over and over to achieve its final state.\r\n\r\n## Table of Contents\r\n- [Installation](#installation)\r\n- [Usage](#usage)\r\n- [Features](#features)\r\n- [Contributors](#contributors)\r\n- [License](#license)\r\n\r\n## Installation\r\n\r\nTo set up the project environment and run the script, you must have Poetry installed. If you do not have Poetry, you can install it by following the instructions [here](https://python-poetry.org/docs/).\r\n\r\nAfter installing Poetry, clone this repository to your local machine:\r\n\r\n```bash\r\ngit clone https://your-repository-url/words_to_numbers.git\r\ncd words_to_numbers\r\npoetry install    # No dependencies to install\r\n```\r\n## Usage\r\n\r\nTo run the script, use the following command:\r\n\r\n```bash\r\npoetry run python -m words_to_numbers\r\n```\r\n\r\n## Features\r\n\r\n- **Single-Line Conversion**: The core feature of this script is its ability to convert numbers into words in a single line of Python code.\r\n- **Expanding**: Expanding the range of the program's output is simple, just add more elements to the 3 lists each currently created as\r\n```py\r\n[ \"\", \"hundred \", \"thousand \", \"million \", \"billion \", \"trillion \", \"quadrillion \", \"quintillion \", \"hextillion \", \"septillion \"]\r\n```\r\nand increment the number 9 found in 3 different places within the program, all in places with boilerplate:\r\n```py\r\nif (\r\n    0\r\n    if (len(x) - i) == 1\r\n    else (\r\n        (0 if x[i] == \"0\" else 1)\r\n        if (len(x) - i) % 3 == 0\r\n        else (\r\n            (((len(x) - i) - 4) // 3) + 2\r\n            if ((len(x) - i) - 4) % 3 == 0\r\n            and (\r\n                x[i] != \"0\"\r\n                or x[i if (i - 1) \u003c 0 else i - 1] != \"0\"\r\n                or x[i if (i - 2) \u003c 0 else i - 2] != \"0\"\r\n            )\r\n            else 0\r\n        )\r\n    )\r\n) \u003e 9:       # Update the 9 in 3 locations all with this context (expanded version)\r\n```\r\n\r\n## Contributors\r\n\r\nI am the sole contributor for this project.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md)\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragonxdev%2Fwords-to-numbers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdragonxdev%2Fwords-to-numbers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragonxdev%2Fwords-to-numbers/lists"}