Skip to content

Commit 939c632

Browse files
committed
add demo material
1 parent bedc4f1 commit 939c632

39 files changed

+3975
-1
lines changed

exposures_api/.gitignore

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
.hypothesis/
47+
venv/
48+
.python-version
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
57+
# Sphinx documentation
58+
docs/_build/
59+
60+
# PyBuilder
61+
target/
62+
63+
#Ipython Notebook
64+
.ipynb_checkpoints

exposures_api/.swagger-codegen-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Swagger Codegen Ignore
2+
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.2.3-SNAPSHOT

exposures_api/.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ref: https://docs.travis-ci.com/user/languages/python
2+
language: python
3+
python:
4+
- "2.7"
5+
- "3.2"
6+
- "3.3"
7+
- "3.4"
8+
- "3.5"
9+
#- "3.5-dev" # 3.5 development branch
10+
#- "nightly" # points to the latest development branch e.g. 3.6-dev
11+
# command to install dependencies
12+
install: "pip install -r requirements.txt"
13+
# command to run tests
14+
script: nosetests

exposures_api/README.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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+

exposures_api/docs/Coordinate.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Coordinate
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**latitude** | **str** | | [optional]
7+
**longitude** | **str** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

exposures_api/docs/DateRange.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# DateRange
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**start_date** | **datetime** | | [optional]
7+
**end_date** | **datetime** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

0 commit comments

Comments
 (0)