Skip to main content

A Python library for generating random Persian (Farsi) names.

Project description

persian-names

PyPI GitHub

A Python library for generating random Persian (Farsi) names.

This package generates frequently logical names (a mix of popular Persian and Arabic names with common Persian family name suffixes).

Note: persian-names generates 90,000,000 unique full names (As Iran population in 2024) in less than 3 minutes.

Installation

Install from PyPI with pip by typing in your favorite terminal:

pip install persian-names

Usage

Let's take a look at what an example test case would look like using persian-names.

Generate Persian Full Names in Farsi:

from persian_names import fullname_fa

fullname_fa('male')   # or fullname_fa('m')
fullname_fa('female') # or fullname_fa('f')
fullname_fa('random') # or fullname_fa('r')

Example:

from persian_names import fullname_fa

print(fullname_fa('m')) # اشکان محمدرضائیان
print(fullname_fa('f')) # مهسا امیری تهرانی
print(fullname_fa('r')) # بیتا خسروی راد

Generate Persian Full Names in English:

from persian_names import fullname_en

fullname_en('male')   # or fullname_en('m')
fullname_en('female') # or fullname_en('f')
fullname_en('random') # or fullname_en('r')

Example:

from persian_names import fullname_en

print(fullname_en('m')) # Arsalan Mohammadi
print(fullname_en('f')) # Sara Alipour
print(fullname_en('r')) # Danial Ferdosi Khorasani

Generate First Names and Last Names in Farsi:

from persian_names import *

# First Name
firstname_fa('male')   # or firstname_fa('m')
firstname_fa('female') # or firstname_fa('f')
firstname_fa('random') # or firstname_fa('r')

# Last Name
lastname_fa()

Example:

from persian_names import *

print(firstname_fa('m')) # آرمان
print(firstname_fa('f')) # ساحل
print(firstname_fa('r')) # علیرضا
print(lastname_fa())     # شیخ اسماعیلی

Generate First Names and Last Names in English:

from persian_names import *

# First Name
firstname_en('male')   # or firstname_en('m')
firstname_en('female') # or firstname_en('f')
firstname_en('random') # or firstname_en('r')

# Last Name
lastname_en()

Example:

from persian_names import *

print(firstname_en('m')) # Mehrad
print(firstname_en('f')) # Darya
print(firstname_en('r')) # Baran
print(lastname_en())     # Bakhtiarizadeh

Issues

Feel free to submit issues and enhancement requests.

Contributing

Feel free to contribute names database with your kindly pull requests.

License

persian-names is available under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

persian_names-1.5.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

persian_names-1.5.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file persian_names-1.5.0.tar.gz.

File metadata

  • Download URL: persian_names-1.5.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for persian_names-1.5.0.tar.gz
Algorithm Hash digest
SHA256 a1fd8416fb883db9be52264703a30f2756c4a2f387a965b40c857e4ec9c848ae
MD5 9206bd662353d299c6b1e43ef660faf0
BLAKE2b-256 55207d7a206e116dd30fd958753b426371f004bf409b9a9ba3bc0138787de321

See more details on using hashes here.

Provenance

File details

Details for the file persian_names-1.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for persian_names-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b95a31843b1294ff6921afaf6ae2bedfb1cb9bcfd6a86594528ce70ee93b3e8
MD5 14f586194e82cd92996b51947c7373aa
BLAKE2b-256 721113daa6fb45311aff089e11789db2ab39b902932066d8500d0b19a21e34e8

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page