Skip to content

Commit

Permalink
Merge pull request #192 from dvonthenen/more-cd-fixes
Browse files Browse the repository at this point in the history
CD Release Fixes & SetupTools
  • Loading branch information
davidvonthenen authored Nov 29, 2023
2 parents 45969eb + 6f9f446 commit 80b878d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 85 deletions.
120 changes: 57 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Official Python SDK for [Deepgram](https://www.deepgram.com/). Power your apps w
* [Examples](#examples)
* [Testing](#testing)
* [Configuration](#configuration)
* [Custom API Endpoint] [#custom-api-endpoint]
* [Custom API Endpoint] [#custom-api-endpoint]
* [Transcription](#transcription)
* [Remote Files](#remote-files)
* [Local Files](#local-files)
Expand Down Expand Up @@ -74,37 +74,37 @@ To quickly get started with examples for prerecorded and streaming, run the file

Run the following command to install `pytest` and `pytest-cov` as dev dependencies.

```
```sh
pip install -r requirements.txt
```

## Run All Tests

## Setup

```
```sh
pip install pytest
pip install pytest-cov
```

## Run All Tests

```
```sh
pytest --api-key <key> tests/
```

## Test Coverage Report

```
```sh
pytest --cov=deepgram --api-key <key> tests/
```

# Configuration

To setup the configuration of the Deepgram Client, do the following:

- Import the Deepgram client
- Create a Deepgram Client instance and pass in credentials to the constructor.
* Import the Deepgram client
* Create a Deepgram Client instance and pass in credentials to the constructor.

```python
from deepgram import Deepgram
Expand All @@ -117,7 +117,7 @@ deepgram = Deepgram(DEEPGRAM_API_KEY)

In order to point the SDK at a different API environment (e.g., for on-prem deployments), you can pass in an object setting the `api_url` when initializing the Deepgram client.

```py
```python
dg_client = Deepgram({
"api_key": DEEPGRAM_API_KEY,
"api_url": "http://localhost:8080/v1/listen"
Expand Down Expand Up @@ -277,7 +277,7 @@ project = await deepgram.projects.get(PROJECT_ID)

### Get a Project Response

```
```ts
{
project_id: String,
name: String,
Expand All @@ -294,7 +294,6 @@ Updates a project based on a provided project object.
| --------- | ------ | ------------------------------------------------------------------------------- |
| project | Object | Object representing a project. Must contain `project_id` and `name` properties. |


### Update a Project Example Request

```python
Expand All @@ -303,9 +302,9 @@ updateResponse = await deepgram.projects.update(project)

### Update a Project Response

```
```ts
{
message: String;
message: String;
}
```

Expand All @@ -331,16 +330,16 @@ response = await deepgram.keys.list(PROJECT_ID)

### List Keys Response

```
```ts
{
api_keys: [
{
api_key_id: string,
comment: string,
created: string,
scopes: Array<string>,
},
];
api_keys: [
{
api_key_id: string,
comment: string,
created: string,
scopes: Array<string>,
},
];
}
```

Expand All @@ -364,7 +363,7 @@ response = await deepgram.keys.create(PROJECT_ID, COMMENT_FOR_KEY, SCOPES)

### Create API Key Response

```
```ts
{
api_key_id: string,
key: string,
Expand Down Expand Up @@ -417,7 +416,7 @@ response = await deepgram.members.list_members(PROJECT_ID)

### Get Members Response

```
```ts
{
members: [
{
Expand Down Expand Up @@ -450,9 +449,9 @@ response = await deepgram.members.remove_member(PROJECT_ID, MEMBER_ID)

### Remove Member Response

```
```ts
{
message: string;
message: string;
}
```

Expand All @@ -479,7 +478,7 @@ response = await deepgram.scopes.get_scope(PROJECT_ID, MEMBER_ID)

### Get Member Scopes Response

```
```ts
{
scopes: string[]
}
Expand All @@ -505,9 +504,9 @@ response = await deepgram.scopes.update_scope(PROJECT_ID, MEMBER_ID, 'member')

### Update Scope Response

```
```ts
{
message: string;
message: string;
}
```

Expand All @@ -533,14 +532,14 @@ response = await deepgram.invitations.list_invitations(PROJECT_ID)

### List Invites Response

```
```ts
{
members: [
{
email: string,
scope: string,
},
];
members: [
{
email: string,
scope: string,
},
];
}
```

Expand All @@ -566,9 +565,9 @@ response = await deepgram.invitations.send_invitation(PROJECT_ID, {

### Send Invite Response

```
```ts
{
message: string;
message: string;
}
```

Expand All @@ -594,9 +593,9 @@ response = await deepgram.invitations.remove_invitation(

### Delete Invite Response

```
```ts
{
message: string;
message: string;
}
```

Expand All @@ -618,9 +617,9 @@ response = await deepgram.invitations.leave_project(PROJECT_ID)

### Leave Project Response

```
```ts
{
message: string;
message: string;
}
```

Expand Down Expand Up @@ -672,7 +671,7 @@ response = await deepgram.usage.list_requests(PROJECT_ID, {

### Get All Requests Response

```
```ts
{
page: Number,
limit: Number,
Expand Down Expand Up @@ -741,7 +740,7 @@ response = await deepgram.usage.get_request(PROJECT_ID, REQUEST_ID)

### Get Request Response

```
```ts
{
request_id: String;
created: String;
Expand Down Expand Up @@ -798,7 +797,7 @@ Retrieves aggregated usage data for a project based on the provided options.

#### Get Usage Options

```python
```ts
{
// The time to retrieve requests made since
// Example: "2020-01-01T00:00:00+00:00"
Expand Down Expand Up @@ -854,7 +853,7 @@ response = await deepgram.usage.get_usage(PROJECT_ID, {

### Get Usage Response

```
```ts
{
start: String,
end: String,
Expand Down Expand Up @@ -886,7 +885,7 @@ Retrieves features used by the provided project_id based on the provided options

#### Get Fields Options

```typescript
```ts
{
// The time to retrieve requests made since
// Example: "2020-01-01T00:00:00+00:00"
Expand All @@ -908,7 +907,7 @@ response = await deepgram.usage.get_fields(PROJECT_ID, {

#### Get Fields Response

```
```ts
{
tags: String[],
models: String[],
Expand All @@ -922,7 +921,6 @@ response = await deepgram.usage.get_fields(PROJECT_ID, {

The `deepgram.billing` object provides access to the balances endpoints of the Deepgram API. Each request is project based and will require a `project_id`.


## Get All Balances

You can retrieve all balances on a given project using the `billing.list_balance` function.
Expand All @@ -941,7 +939,7 @@ response = await deepgram.billing.list_balance(PROJECT_ID)

### Get All Balances Response

```
```ts
{
balances: [
{
Expand Down Expand Up @@ -973,14 +971,14 @@ const response = deepgram.billing.get_balance(PROJECT_ID, BALANCE_ID)

### Get Balance Response

```
```ts
{
balance: {
balance_id: string;
amount: number;
units: string;
purchase: string;
}
balance: {
balance_id: string;
amount: number;
units: string;
purchase: string;
}
}
```

Expand All @@ -997,10 +995,6 @@ To make sure our community is safe for all, be sure to review and agree to our
We love to hear from you so if you have questions, comments or find a bug in the
project, let us know! You can either:

- [Open an issue in this repository](https://github.com/deepgram/deepgram-python-sdk/issues/new)
- [Join the Deepgram Github Discussions Community](https://github.com/orgs/deepgram/discussions)
- [Join the Deepgram Discord Community](https://discord.gg/xWRaCDBtW4)

[license]: LICENSE.txt


* [Open an issue in this repository](https://github.com/deepgram/deepgram-python-sdk/issues/new)
* [Join the Deepgram Github Discussions Community](https://github.com/orgs/deepgram/discussions)
* [Join the Deepgram Discord Community](https://discord.gg/xWRaCDBtW4)
2 changes: 1 addition & 1 deletion deepgram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: MIT

# version
__version__ = "3.0.0"
__version__ = "0.0.0"

# entry point for the deepgram python sdk
from .client import DeepgramClient, DeepgramApiKeyError
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "deepgram-sdk"
dynamic = ["version", "readme", "license", "description", "authors", "keywords", "classifiers", "dependencies"]
dynamic = ["version", "description", "readme", "license", "authors", "keywords", "classifiers", "dependencies"]

[tool.setuptools.dynamic]
version = {attr = "deepgram.__version__"}
readme = {file = "README.md"}
Loading

0 comments on commit 80b878d

Please sign in to comment.