Skip to content

Commit

Permalink
Merge pull request #5 from GrbavaCigla/dev
Browse files Browse the repository at this point in the history
Added __main__.py and it's entry
  • Loading branch information
codeperfectplus authored Oct 11, 2022
2 parents 9529626 + b14566d commit 1734314
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 22 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ default is 1
change the num value according to your needs.
'''
# For First Name
# For first name
rp.first_name()

# For First Name
# For full name
rp.full_name()

# For First Name
# For full profile
rp.full_profile()

# For last name
rp.last_name()
```

## Installation
Expand All @@ -42,7 +45,7 @@ conda install random-profile # on anacoda

## Usage

random-profile module is a random profile generator for many usages ex- fake dataset,youtube videos, content creation, personal projects.
random-profile module is a random profile generator for many usages ex- fake dataset, youtube videos, content creation, personal projects.

## Support

Expand Down
43 changes: 43 additions & 0 deletions random_profile/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from .main import RandomProfile
import argparse


def main():
parser = argparse.ArgumentParser()
parser.add_argument("-n", help="Number of random profiles", type=int, default=1)

group = parser.add_mutually_exclusive_group()
group.add_argument(
"-f",
"--fullname",
help="Get full name instead of first name",
action="store_true",
)
group.add_argument(
"-p",
"--profile",
help="Get full profile instead of first name",
action="store_true",
)
group.add_argument(
"-l",
"--lastname",
help="Get last name instead of first name",
action="store_true",
)

args = parser.parse_args()

rp = RandomProfile(args.n)
if args.fullname:
print(*rp.full_name(), sep="\n")
elif args.profile:
print(*rp.full_profile(), sep="\n")
elif args.lastname:
print(*rp.last_name(), sep="\n")
else:
print(*rp.first_name())


if __name__ == "__main__":
main()
31 changes: 13 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
#Here is the module name.
# Here is the module name.
name="random_profile",

#version of the module
# version of the module
version="0.1.0",

#Name of Author
# Name of Author
author="CodePerfectPlus",

#your Email address
# your Email address
author_email="[email protected]",

#Small Description about module
# Small Description about module
description="Generate Random Profile",

long_description=long_description,

#Specifying that we are using markdown file for description
# Specifying that we are using markdown file for description
long_description_content_type="text/markdown",

#Any link to reach this module, if you have any webpage or github profile
# Any link to reach this module, if you have any webpage or github profile
url="https://github.com/codePerfectPlus/Random-Profile-Generator",
packages=setuptools.find_packages(),

#classifiers like program is suitable for python3, just leave as it is.
# classifiers like program is suitable for python3, just leave as it is.
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
entry_points={
"console_scripts": ["random_profile = random_profile.__main__:main"],
},
)

0 comments on commit 1734314

Please sign in to comment.