Skip to content

Mosquito-Alert/mosquito-alert-python-sdk

Repository files navigation

mosquito-alert

Introducing API v1 for Mosquito Alert platform, a project desgined to facilitate citizen science initiatives and enable collaboration among scientists, public health officials, and environmental managers in the investigation and control of disease-carrying mosquitoes.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v1
  • Package version: 1.0.0
  • Generator version: 7.10.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/Mosquito-Alert/mosquito-alert-python-sdk.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/Mosquito-Alert/mosquito-alert-python-sdk.git)

Then import the package:

import mosquito_alert

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import mosquito_alert

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import mosquito_alert
from mosquito_alert.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.mosquitoalert.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = mosquito_alert.Configuration(
    host = "https://api.mosquitoalert.com/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'

# Configure Bearer authorization (JWT): jwtAuth
configuration = mosquito_alert.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with mosquito_alert.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mosquito_alert.BitesApi(api_client)
    bite_request = mosquito_alert.BiteRequest() # BiteRequest | 

    try:
        api_response = api_instance.bites_create(bite_request)
        print("The response of BitesApi->bites_create:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling BitesApi->bites_create: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.mosquitoalert.com/v1

Class Method HTTP request Description
BitesApi bites_create POST /bites/
BitesApi bites_destroy DELETE /bites/{uuid}/
BitesApi bites_list GET /bites/
BitesApi bites_retrieve GET /bites/{uuid}/
BreedingSitesApi breeding_sites_create POST /breeding-sites/
BreedingSitesApi breeding_sites_destroy DELETE /breeding-sites/{uuid}/
BreedingSitesApi breeding_sites_list GET /breeding-sites/
BreedingSitesApi breeding_sites_retrieve GET /breeding-sites/{uuid}/
CampaignsApi campaigns_list GET /campaigns/
CampaignsApi campaigns_retrieve GET /campaigns/{id}/
CountriesApi countries_retrieve GET /countries/{id}/
FixesApi fixes_create POST /fixes/
NotificationsApi notifications_create POST /notifications/
NotificationsApi notifications_list GET /notifications/
NotificationsApi notifications_partial_update PATCH /notifications/{id}/
NotificationsApi notifications_retrieve GET /notifications/{id}/
NotificationsApi notifications_update PUT /notifications/{id}/
ObservationsApi observations_create POST /observations/
ObservationsApi observations_destroy DELETE /observations/{uuid}/
ObservationsApi observations_list GET /observations/
ObservationsApi observations_prediction_create POST /observations/{uuid}/prediction/
ObservationsApi observations_prediction_destroy DELETE /observations/{uuid}/prediction/
ObservationsApi observations_prediction_retrieve GET /observations/{uuid}/prediction/
ObservationsApi observations_retrieve GET /observations/{uuid}/
PartnersApi partners_list GET /partners/
PartnersApi partners_retrieve GET /partners/{id}/
PhotosApi photos_prediction_create POST /photos/{uuid}/prediction/
PhotosApi photos_prediction_destroy DELETE /photos/{uuid}/prediction/
PhotosApi photos_prediction_retrieve GET /photos/{uuid}/prediction/
PhotosApi photos_retrieve GET /photos/{uuid}/
TokenApi token_create POST /token/
TokenApi token_refresh_create POST /token/refresh/
UsersApi users_create POST /users/
UsersApi users_partial_update PATCH /users/{uuid}/
UsersApi users_retrieve GET /users/{uuid}/
UsersApi users_update PUT /users/{uuid}/

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

cookieAuth

  • Type: API key
  • API key parameter name: sessionid
  • Location:

jwtAuth

  • Type: Bearer authentication (JWT)

tokenAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

[email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published