|
| 1 | +# exposures_api |
| 2 | +API for environmental exposure models for NIH Data Translator program |
| 3 | + |
| 4 | +This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: |
| 5 | + |
| 6 | +- API version: 1.0.0 |
| 7 | +- Package version: 1.0.0 |
| 8 | +- Build package: io.swagger.codegen.languages.PythonClientCodegen |
| 9 | +For more information, please visit [http://renci.org](http://renci.org) |
| 10 | + |
| 11 | +## Requirements. |
| 12 | + |
| 13 | +Python 2.7 and 3.4+ |
| 14 | + |
| 15 | +## Installation & Usage |
| 16 | +### pip install |
| 17 | + |
| 18 | +If the python package is hosted on Github, you can install directly from Github |
| 19 | + |
| 20 | +```sh |
| 21 | +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git |
| 22 | +``` |
| 23 | +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) |
| 24 | + |
| 25 | +Then import the package: |
| 26 | +```python |
| 27 | +import exposures_api |
| 28 | +``` |
| 29 | + |
| 30 | +### Setuptools |
| 31 | + |
| 32 | +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). |
| 33 | + |
| 34 | +```sh |
| 35 | +python setup.py install --user |
| 36 | +``` |
| 37 | +(or `sudo python setup.py install` to install the package for all users) |
| 38 | + |
| 39 | +Then import the package: |
| 40 | +```python |
| 41 | +import exposures_api |
| 42 | +``` |
| 43 | + |
| 44 | +## Getting Started |
| 45 | + |
| 46 | +Please follow the [installation procedure](#installation--usage) and then run the following: |
| 47 | + |
| 48 | +```python |
| 49 | +from __future__ import print_function |
| 50 | +import time |
| 51 | +import exposures_api |
| 52 | +from exposures_api.rest import ApiException |
| 53 | +from pprint import pprint |
| 54 | +# create an instance of the API class |
| 55 | +api_instance = exposures_api.DefaultApi() |
| 56 | +exposure_type = 'exposure_type_example' # str | The name of the exposure type (currently limited to pm25, o3, haz_waste, crime, res_den, poverty, ses). |
| 57 | +latitude = '' # str | Search coordinates that match or are like 'latitude' (optional) (default to ) |
| 58 | +longitude = '' # str | Search coordinates that match or are like 'longitude' (optional) (default to ) |
| 59 | +radius = '0' # str | radius in meters to search within for exposure point when a coordinate is provided. Range from 0 to 500 (optional) (default to 0) |
| 60 | +page = '1' # str | Page number. Return up to 100 items per page (optional) (default to 1) |
| 61 | + |
| 62 | +try: |
| 63 | + # Get exposure location(s) as latitude, longitude coordinates |
| 64 | + api_response = api_instance.exposures_exposure_type_coordinates_get(exposure_type, latitude=latitude, longitude=longitude, radius=radius, page=page) |
| 65 | + pprint(api_response) |
| 66 | +except ApiException as e: |
| 67 | + print("Exception when calling DefaultApi->exposures_exposure_type_coordinates_get: %s\n" % e) |
| 68 | + |
| 69 | +``` |
| 70 | + |
| 71 | +## Documentation for API Endpoints |
| 72 | + |
| 73 | +All URIs are relative to *https://exposures.renci.org/v1* |
| 74 | + |
| 75 | +Class | Method | HTTP request | Description |
| 76 | +------------ | ------------- | ------------- | ------------- |
| 77 | +*DefaultApi* | [**exposures_exposure_type_coordinates_get**](docs/DefaultApi.md#exposures_exposure_type_coordinates_get) | **GET** /exposures/{exposure_type}/coordinates | Get exposure location(s) as latitude, longitude coordinates |
| 78 | +*DefaultApi* | [**exposures_exposure_type_dates_get**](docs/DefaultApi.md#exposures_exposure_type_dates_get) | **GET** /exposures/{exposure_type}/dates | Get exposure start date and end date range for exposure type |
| 79 | +*DefaultApi* | [**exposures_exposure_type_scores_get**](docs/DefaultApi.md#exposures_exposure_type_scores_get) | **GET** /exposures/{exposure_type}/scores | Get exposure score for a given environmental factor at exposure location(s) |
| 80 | +*DefaultApi* | [**exposures_exposure_type_values_get**](docs/DefaultApi.md#exposures_exposure_type_values_get) | **GET** /exposures/{exposure_type}/values | Get exposure value for a given environmental factor at exposure location(s) |
| 81 | +*DefaultApi* | [**exposures_get**](docs/DefaultApi.md#exposures_get) | **GET** /exposures | Get list of exposure types |
| 82 | + |
| 83 | + |
| 84 | +## Documentation For Models |
| 85 | + |
| 86 | + - [Coordinate](docs/Coordinate.md) |
| 87 | + - [DateRange](docs/DateRange.md) |
| 88 | + - [Exposure](docs/Exposure.md) |
| 89 | + - [ExposureType](docs/ExposureType.md) |
| 90 | + |
| 91 | + |
| 92 | +## Documentation For Authorization |
| 93 | + |
| 94 | + All endpoints do not require authorization. |
| 95 | + |
| 96 | + |
| 97 | +## Author |
| 98 | + |
| 99 | +stealey@renci.org |
| 100 | + |
0 commit comments