Skip to content

Commit

Permalink
Added chinese and chinese romanized, preparing for release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JHudd435 committed Feb 21, 2023
1 parent 20c2e83 commit c757a05
Show file tree
Hide file tree
Showing 21 changed files with 7,027 additions and 9 deletions.
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ include src/nameCreator/F/names/japanese.txt
include src/nameCreator/M/names/japanese.txt
include src/nameCreator/L/names/japanese.txt

include src/nameCreator/F/names/chineseR.txt
include src/nameCreator/M/names/chineseR.txt
include src/nameCreator/L/names/chineseR.txt

include src/nameCreator/F/names/chinese.txt
include src/nameCreator/M/names/chinese.txt
include src/nameCreator/L/names/chinese.txt
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
A python name generator for Windows.

This is a python package for name generation. It can generate names from different countries, and can generate both male and female names.
Nationalities: "american", "russian", "spanish", "italian", "german", "french", "swedish", "finnish", "japaneser" (japanese romanized), and "japanese". Will be adding Chinese by release 1.0.0. Also will split spanish into mexican, latino, and spanish.
Ethnicities: "american", "russian", "spanish", "italian", "german", "french", "swedish", "finnish", "japaneser" (japanese romanized), "japanese", "chineser" (chinese romanized), and "chinese".

## Installation

Expand All @@ -24,7 +24,7 @@ Clone the repository and cd into the nameCreator directory, then:
pip install build
python -m build
cd dist
pip install nameCreator-0.9.0-py3-none-any.whl
pip install nameCreator-1.0.0-py3-none-any.whl
```

## Usage (Only applies when built from source, read the release's corresponding README for that version's usage)
Expand Down
8 changes: 5 additions & 3 deletions nameCreatorCLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ def nameCreatorCLI():
help="Does not print the names. Useless if you are not using output.")
@nameCreatorCLI.command()
def generate(gender: str, ethnicity: str, amount=str, output=str, noprint=str):
"""Generates names. Supported ethnicities are American, Russian, Spanish, Italian, German, French, Finnish, Swedish, Romanized Japanese, and Japanese."""
"""Generates names. Supported ethnicities are American, Russian, Spanish, Italian, German, French, Finnish, Swedish, Romanized Japanese, Japanese, Romanized Chinese, and Chinese."""
if (gender.lower() == "male" or gender.lower() == "m"):
for i in range(int(amount)):
if (ethnicity == "japanese" or ethnicity == "japaneseR"):
if (ethnicity == "japanese" or ethnicity == "japaneseR"
or ethnicity == "chinese" or ethnicity == "chineseR"):
firstname = nameCreator.LastName(ethnicity)
lastname = nameCreator.FirstNameMale(ethnicity)
else:
Expand All @@ -44,7 +45,8 @@ def generate(gender: str, ethnicity: str, amount=str, output=str, noprint=str):
f.write(firstname + " " + lastname + "\n")
elif (gender.lower() == "female" or gender.lower() == "f"):
for i in range(int(amount)):
if (ethnicity == "japanese" or ethnicity == "japaneseR"):
if (ethnicity == "japanese" or ethnicity == "japaneseR"
or ethnicity == "chinese" or ethnicity == "chineseR"):
lastname = nameCreator.FirstNameFemale(ethnicity)
firstname = nameCreator.LastName(ethnicity)
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = nameCreator
version = 0.9.0
version = 1.0.0
author = Justin Huddleston
description = A package to generate names by country
long_description = file: README.md
Expand Down
117 changes: 117 additions & 0 deletions src/nameCreator.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
Metadata-Version: 2.1
Name: nameCreator
Version: 1.0.0
Summary: A package to generate names by country
Home-page: https://github.com/JHudd435/nameCreator
Author: Justin Huddleston
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# nameCreator
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/JHudd435/nameCreator?style=for-the-badge)](https://github.com/JHudd435/nameCreator/releases/)
[![GitHub forks](https://img.shields.io/github/forks/JHudd435/nameCreator?style=for-the-badge)](https://github.com/JHudd435/nameCreator/network/members)
[![GitHub license](https://img.shields.io/github/license/JHudd435/nameCreator?style=for-the-badge)](https://github.com/JHudd435/nameCreator/blob/main/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/JHudd435/nameCreator?style=for-the-badge)](https://github.com/JHudd435/nameCreator/issues)

A python name generator for Windows.

This is a python package for name generation. It can generate names from different countries, and can generate both male and female names.
Ethnicities: "american", "russian", "spanish", "italian", "german", "french", "swedish", "finnish", "japaneser" (japanese romanized), "japanese", "chineser" (chinese romanized), and "chinese".

## Installation

### From pypi
Install from pypi with `pip`:
```shell
pip install nameCreator
```

### Build from source
Clone the repository and cd into the nameCreator directory, then:

```shell
pip install build
python -m build
cd dist
pip install nameCreator-1.0.0-py3-none-any.whl
```

## Usage (Only applies when built from source, read the release's corresponding README for that version's usage)

### In python file
```python
firstNameMale = nameCreator.FirstNameMale('nationality')

print(firstNameMale)

lastName = nameCreator.LastName('nationality')

print(lastName)

firstNameFemale = nameCreator.FirstNameFemale('nationality')

print(firstNameFemale)

lastName = nameCreator.LastName('nationality')

print(lastName)
```

### In command line

Displays help message:

```shell
nameCreatorCLI generate --help
```

Generates 10 male finnish names:

```shell
nameCreatorCLI generate -a 10 -e finnish -g m
```

Generates 10 italian female names, sends to a text file and does not print the output to the terminal:

```shell
nameCreatorCLI generate -a 10 -e italian -g f -o italianNames.txt -n
```

Arguments:

Specifies the amount of names to generate:

```shell
-a --amount
```

Specifies the ethnicity:

```shell
-e --ethnicity
```

Specifies the gender of the generated names:

```shell
-g --gender
```

Specifies the output path (like `C:/Users/You/test.txt` or `test.txt` to put in the current path):

```shell
-o --output
```

Specifies whether or not to print the output to the terminal (useless if there is no output path specified):

```shell
-n --noprint
```

## SOURCES:
https://github.com/ironarachne/namegen
54 changes: 54 additions & 0 deletions src/nameCreator.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
LICENSE
MANIFEST.in
README.md
nameCreatorCLI.py
pyproject.toml
setup.cfg
src/nameCreator/__init__.py
src/nameCreator.egg-info/PKG-INFO
src/nameCreator.egg-info/SOURCES.txt
src/nameCreator.egg-info/dependency_links.txt
src/nameCreator.egg-info/requires.txt
src/nameCreator.egg-info/top_level.txt
src/nameCreator/F/__init__.py
src/nameCreator/F/firstF.py
src/nameCreator/F/names/american.txt
src/nameCreator/F/names/chinese.txt
src/nameCreator/F/names/chineseR.txt
src/nameCreator/F/names/finnish.txt
src/nameCreator/F/names/french.txt
src/nameCreator/F/names/german.txt
src/nameCreator/F/names/italian.txt
src/nameCreator/F/names/japanese.txt
src/nameCreator/F/names/japaneseR.txt
src/nameCreator/F/names/russian.txt
src/nameCreator/F/names/spanish.txt
src/nameCreator/F/names/swedish.txt
src/nameCreator/L/__init__.py
src/nameCreator/L/last.py
src/nameCreator/L/names/american.txt
src/nameCreator/L/names/chinese.txt
src/nameCreator/L/names/chineseR.txt
src/nameCreator/L/names/finnish.txt
src/nameCreator/L/names/french.txt
src/nameCreator/L/names/german.txt
src/nameCreator/L/names/italian.txt
src/nameCreator/L/names/japanese.txt
src/nameCreator/L/names/japaneseR.txt
src/nameCreator/L/names/russian.txt
src/nameCreator/L/names/spanish.txt
src/nameCreator/L/names/swedish.txt
src/nameCreator/M/__init__.py
src/nameCreator/M/firstM.py
src/nameCreator/M/names/american.txt
src/nameCreator/M/names/chinese.txt
src/nameCreator/M/names/chineseR.txt
src/nameCreator/M/names/finnish.txt
src/nameCreator/M/names/french.txt
src/nameCreator/M/names/german.txt
src/nameCreator/M/names/italian.txt
src/nameCreator/M/names/japanese.txt
src/nameCreator/M/names/japaneseR.txt
src/nameCreator/M/names/russian.txt
src/nameCreator/M/names/spanish.txt
src/nameCreator/M/names/swedish.txt
1 change: 1 addition & 0 deletions src/nameCreator.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions src/nameCreator.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
click
1 change: 1 addition & 0 deletions src/nameCreator.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nameCreator
2 changes: 1 addition & 1 deletion src/nameCreator/F/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"""

__version__ = "0.9.0"
__version__ = "1.0.0"
__author__ = 'Justin Huddleston'
16 changes: 16 additions & 0 deletions src/nameCreator/F/firstF.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
FirstFinnishFemale = []
FirstJapaneseRFemale = []
FirstJapaneseFemale = []
FirstChineseRFemale = []
FirstChineseFemale = []


def Line(obj):
Expand Down Expand Up @@ -72,6 +74,16 @@ def Line(obj):
for line in mytxt:
FirstJapaneseFemale.append(Line(line))

# chineseR (romanized Chinese)
with open(curDir + "\\names\\chineseR.txt", encoding="utf-8") as mytxt:
for line in mytxt:
FirstChineseRFemale.append(Line(line))

# chinese
with open(curDir + "\\names\\chinese.txt", encoding="utf-8") as mytxt:
for line in mytxt:
FirstChineseFemale.append(Line(line))


# defs
def FirstNameFemale(nationality):
Expand All @@ -95,3 +107,7 @@ def FirstNameFemale(nationality):
return random.choice(FirstJapaneseRFemale)
if (nationality.lower() == "japanese"):
return random.choice(FirstJapaneseFemale)
if (nationality.lower() == "chineser"):
return random.choice(FirstChineseRFemale)
if (nationality.lower() == "chinese"):
return random.choice(FirstChineseFemale)
Loading

0 comments on commit c757a05

Please sign in to comment.