Subir archivos a ''

main
José María Ávila 2 years ago
parent d5352ca053
commit 6923285bfc

@ -1,42 +1,42 @@
# WOD API - Words Of Domain API # WOD API - Words Of Domain API
WOD API is a quick and simple API to get words of a domain name. WOD API is a quick and simple API to get words of a domain name.
## Key features ## Key features
* Purely Python * Purely Python
* It's an API with only 1 endpoint * It's an API with only 1 endpoint
* Needs flask library * Needs flask library
* Needs wordsegment library * Needs wordsegment library
## Requirements ## Requirements
WOD API requires **flask** and **wordsegment** Python libraries: WOD API requires **flask** and **wordsegment** Python libraries:
* pip install flask * pip install flask
* pip install wordsegment * pip install wordsegment
## Usage ## Usage
- Run: python .\wodapi.py - Run: python .\wodapi.py
- Then, a server is deploy on http://127.0.0.1:5000 - 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 - Use GET in endpoing domain: http://127.0.0.1:5000/domain/hereyourdomainname
## Documentation ## Documentation
This is the README file This is the README file
## Authors ## Authors
* Bichi - José Mª Ávila * Bichi - José Mª Ávila
* Antonio Villamarin * Antonio Villamarin
## License ## License
This is a NIDOMA development This is a NIDOMA development
## Links ## Links
- https://grantjenks.com/docs/wordsegment/ - https://grantjenks.com/docs/wordsegment/
- https://pypi.org/project/wordsegment/ - https://pypi.org/project/wordsegment/
- https://blog.stoplight.io/python-rest-api - https://blog.stoplight.io/python-rest-api

@ -0,0 +1,13 @@
import wordsegment
from wordsegment import load, segment
from flask import Flask, json, request
load()
api = Flask(__name__)
@api.route('/domain/<string:name>', methods=['GET'])
def get_words(name: str):
return json.dumps(segment(name))
if __name__ == '__main__':
api.run()
Loading…
Cancel
Save