From 6923285bfc0c1a22ccbb51ef1431ac6358ac46ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Mar=C3=ADa=20=C3=81vila?= Date: Wed, 22 Mar 2023 12:04:30 +0000 Subject: [PATCH] Subir archivos a '' --- README.md | 82 +++++++++++++++++++++++++++---------------------------- wodapi.py | 13 +++++++++ 2 files changed, 54 insertions(+), 41 deletions(-) create mode 100644 wodapi.py diff --git a/README.md b/README.md index 2222d38..a13bb6a 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,42 @@ -# WOD API - Words Of Domain API - -WOD API is a quick and simple API to get words of a domain name. - -## Key features - -* Purely Python -* It's an API with only 1 endpoint -* Needs flask library -* Needs wordsegment library - -## Requirements - -WOD API requires **flask** and **wordsegment** Python libraries: - -* pip install flask -* pip install wordsegment - -## Usage - -- Run: python .\wodapi.py -- Then, a server is deploy on http://127.0.0.1:5000 -- Use GET in endpoing domain: http://127.0.0.1:5000/domain/hereyourdomainname - -## Documentation - -This is the README file - -## Authors - - * Bichi - José Mª Ávila - * Antonio Villamarin - -## License - -This is a NIDOMA development - -## Links - -- https://grantjenks.com/docs/wordsegment/ -- https://pypi.org/project/wordsegment/ +# WOD API - Words Of Domain API + +WOD API is a quick and simple API to get words of a domain name. + +## Key features + +* Purely Python +* It's an API with only 1 endpoint +* Needs flask library +* Needs wordsegment library + +## Requirements + +WOD API requires **flask** and **wordsegment** Python libraries: + +* pip install flask +* pip install wordsegment + +## Usage + +- Run: python .\wodapi.py +- Then, a server is deploy on http://127.0.0.1:5000 +- Use GET in endpoing domain: http://127.0.0.1:5000/domain/hereyourdomainname + +## Documentation + +This is the README file + +## Authors + + * Bichi - José Mª Ávila + * Antonio Villamarin + +## License + +This is a NIDOMA development + +## Links + +- https://grantjenks.com/docs/wordsegment/ +- https://pypi.org/project/wordsegment/ - https://blog.stoplight.io/python-rest-api \ No newline at end of file diff --git a/wodapi.py b/wodapi.py new file mode 100644 index 0000000..4bac5a6 --- /dev/null +++ b/wodapi.py @@ -0,0 +1,13 @@ +import wordsegment +from wordsegment import load, segment +from flask import Flask, json, request +load() + +api = Flask(__name__) + +@api.route('/domain/', methods=['GET']) +def get_words(name: str): + return json.dumps(segment(name)) + +if __name__ == '__main__': + api.run() \ No newline at end of file