pygeonlp-webapi, A json-rpc webapi server for pygeonlp
pygeonlp-webapi is a WSGI module to use pygeonlp features as a JSON-RPC web service.
How To Use
The server for development using Flask can be run with the following command.
$ python -m pygeonlp_webapi.app
or
$ FLASK_APP="pygeonlp_webapi.app" flask run --port=5000
If you prefer gunicorn, you can run the following command.
$ gunicorn pygeonlp_webapi.app:app --bind=127.0.0.1:5000
Then, post a JSON-RPC message to the server.
$ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "geonlp.parse", "params":{"sentence":"NIIは千代田区にあります。"}, "id":"1"}' http://localhost:5000/api
More detailed Japanese documentation of the software including API is
available under /doc directory.
You can also find the latest online documentation at
Web Service section in GeoNLP Documentation.
Pre-requirements
pygeonlp-webapi requires pygeonlp and
flask-jsonrpc.
Install
The pygeonlp-webapi package can be installed with the pip command.
It is recommended that you upgrade pip and setuptools to
the latest versions before running it.
$ pip install --upgrade pip setuptools
$ pip install pygeonlp-webapi
The database needs to be prepared the first time.
Prepare the database
Execute the command to register the basic place name word analysis dictionaries
(*.json, *.csv) in this package into the database under the default diretory.
>>> import pygeonlp.api as api
>>> api.setup_basic_database()
Run tests (Optional)
Run the unit tests with pytest command.
Uninstall
Use pip command to uninstall.
$ pip uninstall pygeonlp-webapi
License
Acknowledgements
This software is supported by DIAS (Data Integration and Analysis System) and ROIS-DS CODH (Center for Open Data in the Humanities).
It was also supported by JST (Japan Science and Technology Agency) PRESTO program.
Metadata
Release files for pygeonlp-webapi 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygeonlp_webapi-1.1.1.zip | 12.2 kB | Without provenance | Details for pygeonlp_webapi-1.1.1.zip |
Release files / pygeonlp_webapi-1.1.1.zip
| Download URL | pygeonlp_webapi-1.1.1.zip |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
582ada1afbead5a73881efc619cccb65136f09ba18efbd43c2edd30befc09376
|
|
BLAKE2b-256 checksum How to use checksums |
bca51f04959f4c419acf89c29fc55bb91cd67c7d037b426fa23065d004be8f85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.9
|
Security for pygeonlp-webapi 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.