-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c96488b
commit 0c0b65e
Showing
6 changed files
with
85 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
from flask import Flask, jsonify | ||
from random_profile import RandomProfile | ||
|
||
# random_profile==0.2.3 required | ||
rp = RandomProfile() | ||
app = Flask(__name__) | ||
|
||
@app.route('/') | ||
def index(): | ||
return jsonify({'message': 'api is working'}) | ||
|
||
@app.route('/api/v1/random_profile') | ||
def single_profile(): | ||
profile = rp.full_profile() | ||
return jsonify({'profile': profile}) | ||
|
||
@app.route('/api/v1/random_profile/<int:num>') | ||
def multiple_profile(num): | ||
if num > 100: | ||
num = 100 | ||
profile = rp.full_profile(num) | ||
return jsonify({'profile': profile}) | ||
|
||
|
||
if __name__ == '__main__': | ||
app.run(debug=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
random-profile==0.2.3 | ||
flask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import setuptools | ||
from glob import glob | ||
|
||
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
@@ -7,9 +8,9 @@ | |
# Here is the module name. | ||
name="random_profile", | ||
# version of the module | ||
version="0.2.0", | ||
version="0.2.3", | ||
# Name of Author | ||
author="CodePerfectPlus", | ||
author="Deepak Raj", | ||
# your Email address | ||
author_email="[email protected]", | ||
# Small Description about module | ||
|
@@ -18,13 +19,16 @@ | |
# 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 | ||
data_files= [( 'assets', glob('random_profile/assets/*'))], | ||
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=[ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Utilities", | ||
], | ||
entry_points={ | ||
"console_scripts": ["random_profile = random_profile.__main__:main"], | ||
|