Neon Proxy for external API Calls
Project description
NeonAI API Proxy
Proxies API calls to consolidate usage to a single point and allow for caching of API data.
Request Format
API requests should be in the form of a dictionary. The service requested should be specified as service
and the
remaining data will be passed to the handle_query
method of the requested service as kwargs.
Example Wolfram|Alpha Request:
{ "service": "wolfram_alpha", "query": "how far away is Rome?", "api": "simple", "units": "metric", "ip": "64.34.186.120" }
Response Format
Responses will be returned as dictionaries. Responses should contain the following:
status_code
- Usually contains the HTTP status code from the requested API,-1
should be used to specify any other errorscontent
- Usually contains the HTTP content (bytes) from the requested API, but may include a string message for errors.encoding
= Usually contains the HTTP content encoding if content is the byte representation of a string, may beNone
Docker Configuration
When running this as a docker container, the XDG_CONFIG_HOME
envvar is set to /config
.
A configuration file at /config/neon/diana.yaml
is required and should look like:
MQ:
port: <MQ Port>
server: <MQ Hostname or IP>
users:
neon_api_connector:
password: <neon_api user's password>
user: neon_api
keys:
api_services:
alpha_vantage:
api_key: <Alpha Vantage Key>
open_weather_map:
api_key: <OWM Key>
wolfram_alpha:
api_key: <Wolfram|Alpha Key>
For example, if your configuration resides in ~/.config
:
export CONFIG_PATH="/home/${USER}/.config"
docker run -v ${CONFIG_PATH}:/config neon_api_proxy
Note: If connecting to a local MQ server, you may need to specify
--network host
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for neon_api_proxy-0.6.1a2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3545fa0e69f431e77389f3f73fb32f45b45c9a0ff7108498a092899db29bd9b4 |
|
MD5 | 7346979baeb1727167ba55d25165f281 |
|
BLAKE2b-256 | b5a3cf4231fe789387e203a9121c868a475c1c73f79a159e1eb369a925771793 |