Skip to main content

WeGene SDK for Python

Project description

# wegene-python-sdk

Python SDK for [WeGene](https://www.wegene.com)

## Installation

$ pip install wegene

## Usage

#### Set Access Token

To query data from WeGene, one need a valid OAuth2 access token authorized by
the user.


```python
import wegene
wegene.Configuration.o_auth_access_token = '<A Valid Access Token with Proper Scope>'
```

#### Get Basic User Info

Use `wegene.User().get_user()` to get user data

```python
profile_id = ''
try:
user = wegene.User().get_user()
profile_id = user.profiles[0].id
print profile_id
except Exception as e:
print e.response_body
```

#### Get Gene Allele Info

Use `wegene.Allele().get_allele(profile_id, locations)` to get allele data

```python
try:
allele = wegene.Allele().get_allele(profile_id, ['rs182549'])
print allele
except Exception as e:
print e.response_body
```

#### Get Sport Advice

Use `wegene.Sport().get_advice(profileId, sex, age, height, weight, healthTarget)` to get sport advice

```python
try:
advice = wegene.Sport().get_advice(profile_id, 'male', 26, 174, 84, 'slimming')
print advice.total_intake
except Exception as e:
print e.response_body
```

#### Get Health Data

Use `wegene.Health().get_risk(profileId, reportId)` to get health risk info

Use `wegene.Health().get_drug(profileId, reportId)` to get drug response info

Use `wegene.Health().get_carrier(profileId, reportId)` to get disease carrier info

```python
try:
drug = wegene.Health().get_drug(profile_id, 158)
print drug
except Exception as e:
print e.response_body
```

## Documentation
- [Full WeGene API Document](https://api.wegene.com/docs/)


## Credits
- [Eddie Wu](https://xraywu.github.io)

## Thanks
- The SDK is modified on top of the code auto-generated using [APIMATIC](https://apimatic.io). Huge thanks to the team as this is a real life saver!!

## License

(The MIT License)

Copyright (c) 2016 Eddie Wu

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wegene-0.0.2.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wegene-0.0.2-py2.py3-none-any.whl (25.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file wegene-0.0.2.tar.gz.

File metadata

  • Download URL: wegene-0.0.2.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for wegene-0.0.2.tar.gz
Algorithm Hash digest
SHA256 53ed89e858edfdaca87285aa8946b6d42daca955041b8b1148d13ea4a86fc0bb
MD5 3fa98e85f1f08c7cfcbe23f6eb49bdec
BLAKE2b-256 ea2e2d2943077f580612992d07061b66501a4f51d3d50175de531006e5f926da

See more details on using hashes here.

File details

Details for the file wegene-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for wegene-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 811f1cd2a91aad70d09f43b78886a5a6a04539bb35bcb453faa6f3d8abb6db3c
MD5 96471bd228e6c819649a36806a2df46f
BLAKE2b-256 b6c55242a76704a37e8f8afaf519ce305116c7ea46d08d681177e58ff22cb56f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page