Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
JHudd435 authored Jul 27, 2022
1 parent 44eaf70 commit 60ec8ac
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = [
"setuptools",
"wheel"
"wheel",
]
build-backend = "setuptools.build_meta"
9 changes: 4 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = nameCreator
version = 0.4.0
version = 0.4.5
author = Justin Huddleston
description = A package to generate names by country
long_description = file: README.md
Expand All @@ -17,15 +17,14 @@ package_dir =
= src
packages = find:
python_requires = >=3.6
install_requires = unidecode,click
install_requires =
click
unidecode

[options.package_data]
* = *.txt

[options.packages.find]
where = src

[options.entry_points]
console_scripts =
nameCreator-CLI = nameCreator-CLI:main

2 changes: 1 addition & 1 deletion src/nameCreator/F/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"""

__version__ = "0.4.0"
__version__ = "0.4.5"
__author__ = 'Justin Huddleston'
2 changes: 1 addition & 1 deletion src/nameCreator/L/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"""

__version__ = "0.4.0"
__version__ = "0.4.5"
__author__ = 'Justin Huddleston'
2 changes: 1 addition & 1 deletion src/nameCreator/M/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"""

__version__ = "0.4.0"
__version__ = "0.4.5"
__author__ = 'Justin Huddleston'
2 changes: 1 addition & 1 deletion src/nameCreator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__version__ = "0.4.0"
__version__ = "0.4.5"
__author__ = 'Justin Huddleston'

from nameCreator.F import firstF
Expand Down
36 changes: 36 additions & 0 deletions src/nameCreator/nameCreatorCLI/nameCreatorCLI.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import nameCreator
import click


@click.group()
def nameCreatorCLI():
"""A CLI for the nameCreator python package."""


@click.option('-g',
'--gender',
help='Gender of the generated name(s) (M)ale or (F)emale.')
@click.option('-l',
'--language',
help='Language/Nationality of the generated name(s).')
@click.option('-a', '--amount', help='How many names are generated.')
@nameCreatorCLI.command()
def generate(gender: str, language: str, amount=str):
"""Generates names."""
if (gender.lower() == "male" or gender.lower() == "m"):
for i in range(int(amount)):
firstname = nameCreator.firstM.FirstNameMale(language)
lastname = nameCreator.last.LastName(language)
print(firstname + " " + lastname)
elif (gender.lower() == "female" or gender.lower() == "f"):
for i in range(int(amount)):
firstname = nameCreator.firstF.FirstNameFemale(language)
lastname = nameCreator.last.LastName(language)
print(firstname + " " + lastname)
else:
print(gender.lower)
print("Please enter male or female as gender.")


if __name__ == '__main__':
nameCreatorCLI(prog_name='nameCreatorCLI')

0 comments on commit 60ec8ac

Please sign in to comment.