{"id":13781426,"url":"https://github.com/5j9/num2fawords","last_synced_at":"2025-05-11T14:35:02.769Z","repository":{"id":57447222,"uuid":"11385371","full_name":"5j9/num2fawords","owner":"5j9","description":"Takes a number and converts it to Persian word form","archived":false,"fork":false,"pushed_at":"2019-03-18T12:08:14.000Z","size":80,"stargazers_count":42,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-01T12:04:23.284Z","etag":null,"topics":["converter","farsi","number-conversion","numbers","persian","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/5j9.png","metadata":{"files":{"readme":"README.rst","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":"2013-07-13T08:34:16.000Z","updated_at":"2025-02-19T18:05:44.000Z","dependencies_parsed_at":"2022-09-10T22:02:16.695Z","dependency_job_id":null,"html_url":"https://github.com/5j9/num2fawords","commit_stats":null,"previous_names":["5j9/number2farsiword"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5j9%2Fnum2fawords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5j9%2Fnum2fawords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5j9%2Fnum2fawords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5j9%2Fnum2fawords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5j9","download_url":"https://codeload.github.com/5j9/num2fawords/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253580386,"owners_count":21930933,"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":["converter","farsi","number-conversion","numbers","persian","python"],"created_at":"2024-08-03T18:01:25.896Z","updated_at":"2025-05-11T14:35:02.467Z","avatar_url":"https://github.com/5j9.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":".. image:: https://travis-ci.org/5j9/num2fawords.svg?branch=master\n\t:target: https://travis-ci.org/5j9/num2fawords\n.. image:: https://codecov.io/github/5j9/num2fawords/coverage.svg?branch=master\n\t:target: https://codecov.io/github/5j9/num2fawords\n.. image:: https://ci.appveyor.com/api/projects/status/github/5j9/num2fawords?svg=true\u0026branch=master\n\t:target: https://ci.appveyor.com/project/5j9/num2fawords\n\nnum2fawords\n===========\n\n`num2fawords` is a highly customizable library which provides functions to convert a number (int, float, Decimal, Fraction, or str) into Persian word form.\n\nInstallation\n============\n\n- Python 3.4+ is required\n- ``pip install 'setuptools\u003e=36.2.1'``\n- ``pip install num2fawords``\n\nUsage\n=====\n\n.. code-block:: python\n\n\t\u003e\u003e\u003e from num2fawords import words, ordinal_words\n\t\u003e\u003e\u003e words(1984)\n\t'یک هزار و نهصد و هشتاد و چهار'\n\t\u003e\u003e\u003e ordinal_words(1232)\n\t'یک هزار و دویست و سی و دوم'\n\t\u003e\u003e\u003e ordinal_words(123)\n\t'یکصد و بیست و سوم'\n\t\u003e\u003e\u003e words(1.1e-9)\n\t'یک و یک دهم در ده به توان منفی نه'\n\n\nObviously, `words` is used to convert to word form and `ordinal_words` is for ordinal word from.\n\n`words` also accepts other common standard types:\n\n.. code-block:: python\n\n\t\u003e\u003e\u003e words(19.75)\n\t'نوزده و هفتاد و پنج صدم'\n\t\u003e\u003e\u003e from decimal import Decimal\n\t\u003e\u003e\u003e words(Decimal('1.1'))\n\t'یک و یک دهم'\n\t\u003e\u003e\u003e from fractions import Fraction\n\t\u003e\u003e\u003e words(Fraction(-2, 5))\n\t'منفی دو پنجم'\n\n\nThe default decimal separator is \"و\" but it can be changed to \"ممیز\" (or any other string) as follows:\n\n.. code-block:: python\n\n\t\u003e\u003e\u003e words(19.75, decimal_separator=' ممیز ')\n\t'نوزده ممیز هفتاد و پنج صدم'\n\nSome people prefer, for example, \"صد و هفتاد\" over its other form \"یکصد و هفتاد\". This library uses the second form by default which is also used on official Iranian banknotes. But it can be changed:\n\n.. code-block:: python\n\n\t\u003e\u003e\u003e from num2fawords import HUNDREDS\n\t\u003e\u003e\u003e words(170)\n\t'یکصد و هفتاد'\n\t\u003e\u003e\u003e HUNDREDS[1] = 'صد'\n\t\u003e\u003e\u003e words(170)\n\t'صد و هفتاد'\n\nSome examples for other arguments of `words`:\n\n.. code-block:: python\n\n\t\u003e\u003e\u003e words(7, positive='مثبت ')\n\t'مثبت هفت'\n\t\u003e\u003e\u003e words(-2, negative='منهای ')\n\t'منهای دو'\n\t\u003e\u003e\u003e words('۱/۲')\n\t'یک دوم'\n\t\u003e\u003e\u003e words('1/2', fraction_separator=' تقسیم بر ', ordinal_denominator=False)\n\t'یک تقسیم بر دو'\n\t\u003e\u003e\u003e words(1.1e-9)\n\t'یک و یک دهم در ده به توان منفی نه'\n\t\u003e\u003e\u003e words(1.1e-9, scientific_separator=' ضربدر ده به قوهٔ ')\n\t'یک و یک دهم ضربدر ده به قوهٔ منفی نه'\n\nOf-course the above arguments can be used together.\n\nIf you prefer to change the default argument values once and for all, use the `change_defaults` function:\n\n.. code-block:: python\n\n\t\u003e\u003e\u003e from num2fawords import change_defaults, words\n\t\u003e\u003e\u003e change_defaults(fraction_separator=' بخش بر ', ordinal_denominator=False)\n\t\u003e\u003e\u003e words('۱/۴')\n\t'یک بخش بر چهار'\n\nThat's all. Enjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5j9%2Fnum2fawords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5j9%2Fnum2fawords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5j9%2Fnum2fawords/lists"}