Skip to content

Commit 346cc48

Browse files
author
Kyle Bridburg
authored
AISDK-6: Add documentation to python SDK (revdotcom#5)
1 parent af8d869 commit 346cc48

14 files changed

+89
-321
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ include HISTORY.rst
22

33
include LICENSE
44

5-
include README.rst
5+
include README.md
66

77
recursive-include tests *
88
recursive-exclude * __pycache__

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Rev.ai Python SDK
2+
3+
[![Build Status](https://img.shields.io/travis/revdotcom/revai-python-sdk.svg?branch=master)](https://travis-ci.org/revdotcom/revai-python-sdk)
4+
5+
## Documentation
6+
7+
See the [API docs](https://www.rev.ai/docs) for more information about the API and
8+
more python examples.
9+
10+
## Installation
11+
12+
You don't need this source code unless you want to modify the package. If you just
13+
want to use the package, just run:
14+
15+
pip install --upgrade rev_ai
16+
17+
Install from source with:
18+
19+
python setup.py install
20+
21+
### Requirements
22+
23+
- Python 2.7+ or Python 3.4+
24+
25+
## Usage
26+
27+
All you need to get started is your Access Token, which can be generated on
28+
your [Settings Page](https://www.rev.ai/settings). Create a client with the
29+
given Access Token:
30+
31+
```python
32+
from rev_ai import apiclient
33+
34+
# create your client
35+
client = apiclient.RevAiAPIClient("ACCESS TOKEN")
36+
```
37+
38+
### Sending a file
39+
40+
Once you've set up your client with your Access Token sending a file is easy!
41+
42+
```python
43+
# you can send a local file
44+
job = client.send_job_local_file("FILE PATH")
45+
46+
# or send a link to the file you want transcribed
47+
job = client.send_job_url("https://url-of-my-file")
48+
```
49+
50+
`job` will contain all the information normally found in a successful response from our
51+
[Submit Job](https://www.rev.ai/docs#operation/SubmitTranscriptionJob) endpoint.
52+
53+
If you want to get fancy, both send job methods take `metadata`, `callback_url`, and a boolean
54+
`skip_diarization` as optional parameters, these are also described in the request body of
55+
the [Submit Job](https://www.rev.ai/docs#operation/SubmitTranscriptionJob) endpoint.
56+
57+
### Checking your file's status
58+
59+
You can check the status of your transcription job using its `id`
60+
61+
```python
62+
job_details = client.get_job_details(job.id)
63+
```
64+
65+
`job_details` will contain all information normally found in a successful response from
66+
our [Get Job](https://www.rev.ai/docs#operation/GetJobById) endpoint
67+
68+
### Getting your transcript
69+
70+
Once your file is transcribed, you can get your transcript in a few different forms:
71+
72+
```python
73+
# as text
74+
transcript_text = client.get_transcript_text(job.id)
75+
76+
# as json
77+
transcript_json = client.get_transcript_json(job.id)
78+
79+
# or as a python object
80+
transcript_object = client.get_transcript_object(job.id)
81+
```
82+
83+
Both the json and object forms contain all the formation outlined in the response
84+
of the [Get Transcript](https://www.rev.ai/docs#operation/GetTranscriptById) endpoint
85+
when using the json response schema. While the text output is a string containing
86+
just the text of your transcript

README.rst

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/conf.py

Lines changed: 0 additions & 163 deletions
This file was deleted.

docs/contributing.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/history.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/index.rst

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/installation.rst

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)