Skip to main content

Cochl Sense API

Project description

cochl-sense-api

Cochl.Sense API allows to detect what is contained inside sound data. Send audio data over the internet to discover what it contains.

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

  • API version: v1.7.7
  • Package version: 1.0.7
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python >= 3.9

Installation & Usage

pip install

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

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import cochl_sense_api

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 cochl_sense_api

Getting Started

Please follow the installation procedure and then run the following:

import time
import cochl_sense_api
from pprint import pprint
from cochl_sense_api.api import audio_session_api
from cochl_sense_api.model.audio_chunk import AudioChunk
from cochl_sense_api.model.create_session import CreateSession
from cochl_sense_api.model.created_session import CreatedSession
from cochl_sense_api.model.generic_error import GenericError
from cochl_sense_api.model.predict_request import PredictRequest
from cochl_sense_api.model.predict_response import PredictResponse
from cochl_sense_api.model.session_refs import SessionRefs
from cochl_sense_api.model.session_result import SessionResult
from cochl_sense_api.model.session_status import SessionStatus
from cochl_sense_api.model.update_session import UpdateSession
# Defining the host is optional and defaults to https://api.cochl.ai/sense/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = cochl_sense_api.Configuration(
    host = "https://api.cochl.ai/sense/api/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: API_Key
configuration.api_key['API_Key'] = 'YOUR_API_KEY'

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


# Enter a context with an instance of the API client
with cochl_sense_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = audio_session_api.AudioSessionApi(api_client)
    create_session = CreateSession(
        type=SessionType("stream"),
        content_type="audio/x-raw; rate=44100; format=s24le",
        tags_sensitivity=TagsSensitivity(
            key=-2,
        ),
        default_sensitivity=DefaultSensitivity(0),
        total_size=1,
        file_name="file_name_example",
        file_length=3.14,
        window_hop="window_hop_example",
    ) # CreateSession | 

    try:
        # Create Session
        api_response = api_instance.create_session(create_session)
        pprint(api_response)
    except cochl_sense_api.ApiException as e:
        print("Exception when calling AudioSessionApi->create_session: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.cochl.ai/sense/api/v1

Class Method HTTP request Description
AudioSessionApi create_session POST /audio_sessions/ Create Session
AudioSessionApi delete_session DELETE /audio_sessions/{session_id} Delete Session
AudioSessionApi get_results GET /audio_sessions/{session_id}/results Get File Result
AudioSessionApi predict POST /audio_sessions/{session_id}/predict Predict
AudioSessionApi read_status GET /audio_sessions/{session_id}/status Read Status
AudioSessionApi update_session PATCH /audio_sessions/{session_id} Update Session
AudioSessionApi upload_chunk PUT /audio_sessions/{session_id}/chunks/{chunk_sequence} Upload Chunk

Documentation For Models

Documentation For Authorization

API_Key

  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header

Author

support@cochl.ai

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in cochl_sense_api.apis and cochl_sense_api.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from cochl_sense_api.api.default_api import DefaultApi
  • from cochl_sense_api.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import cochl_sense_api
from cochl_sense_api.apis import *
from cochl_sense_api.models import *

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

cochl_sense_api-1.7.7.tar.gz (47.2 kB view details)

Uploaded Source

Built Distribution

cochl_sense_api-1.7.7-py3-none-any.whl (88.3 kB view details)

Uploaded Python 3

File details

Details for the file cochl_sense_api-1.7.7.tar.gz.

File metadata

  • Download URL: cochl_sense_api-1.7.7.tar.gz
  • Upload date:
  • Size: 47.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for cochl_sense_api-1.7.7.tar.gz
Algorithm Hash digest
SHA256 db27fce8e8eecd4b56052ab89f7a2a9a34f59575ab6f8cd2cc9fc9a4146d59cc
MD5 7bd484e19a5703bb449feaea0692d7e3
BLAKE2b-256 e6d1c2ae86833cb2c49aad7514e1f49b9fe93709d8a9ffa048f4a4232055a10a

See more details on using hashes here.

Provenance

File details

Details for the file cochl_sense_api-1.7.7-py3-none-any.whl.

File metadata

File hashes

Hashes for cochl_sense_api-1.7.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1fd5ab8376f45eb07fee543740fc0495c8409589aafd9dfc8d0d2d29216b7bd7
MD5 7d9f3296ce264dda23d3b00a5bd7f2bb
BLAKE2b-256 d4f9fcb2b1e91b9a7c46f0a72a6767dd76894699f87609d283dc7cde3e7b3580

See more details on using hashes here.

Provenance

Supported by

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