Skip to content

Commit 0a4df3f

Browse files
authored
Add /data support, fix various bugs discovered in Ruby implementation (#9)
* Add /data support, fix various bugs coming from ruby implementation * More consistency in examples * Regen README * Link README to product pages
1 parent 63b16f0 commit 0a4df3f

File tree

109 files changed

+10578
-144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+10578
-144
lines changed

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
# Mux Python
44

5-
Official Mux API wrapper for python projects 🐍.
5+
Official Mux API wrapper for python projects, supporting both Mux Data and Mux Video.
66

7-
Mux Video is an API-first platform, powered by data and designed by video experts to make beautiful video possible for every development team.
7+
[Mux Video](https://mux.com/video) is an API-first platform, powered by data and designed by video experts to make beautiful video possible for every development team.
8+
9+
[Mux Data](https://mux.com/data) is a platform for monitoring your video streaming performance with just a few lines of code. Get in-depth quality of service analytics on web, mobile, and OTT devices.
810

911
Not familiar with Mux? Check out https://mux.com/ for more information.
1012

@@ -47,15 +49,22 @@ Its up to you to manage your token and secret. In our examples, we read them fro
4749
Below is a quick example of using mux-python to list the Video assets stored in your Mux account.
4850

4951
Be sure to also checkout the [exmples directory](examples/):
50-
* [List Assets, Live Streams, Signing Keys, and Uploads.](examples/list-everything.py)
51-
* [Create an Asset, wait for it to become availiable, and print its playback URL](examples/ingest.py)
52-
* [Create a new Live Stream and retrieve its Stream key.](examples/create-live-stream.py)
52+
* [List Assets, Live Streams, Signing Keys, and Uploads.](examples/video/list-everything.py)
53+
* [Create an Asset, wait for it to become availiable, and print its playback URL](examples/video/ingest.py)
54+
* [Create a new Live Stream and retrieve its Stream key.](examples/video/create-live-stream.py)
5355

5456
There's also example usage of every API call (also used for testing):
55-
* [Assets API](examples/exercise-assets.py)
56-
* [Live Streams API](examples/exercise-live-streams.py)
57-
* [Signing Keys API](examples/exercise-signing-keys.py)
58-
* [Uploads API](examples/exercise-uploads.py)
57+
* [Video](examples/video/)
58+
* [Assets](examples/video/exercise-assets.py)
59+
* [Live Streams](examples/video/exercise-live-streams.py)
60+
* [Signing Keys](examples/video/exercise-signing-keys.py)
61+
* [Uploads](examples/video/exercise-uploads.py)
62+
* [Data](examples/data/)
63+
* [Errors](examples/data/exercise-errors.py)
64+
* [Exports](examples/data/exercise-exports.py)
65+
* [Filters](examples/data/exercise-filters.py)
66+
* [Metrics](examples/data/exercise-metrics.py)
67+
* [Video Views](examples/data/exercise-video-views.py)
5968

6069
```python
6170
import os

docs/AbridgedVideoView.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# AbridgedVideoView
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id** | **str** | | [optional]
7+
**viewer_os_family** | **str** | | [optional]
8+
**viewer_application_name** | **str** | | [optional]
9+
**video_title** | **str** | | [optional]
10+
**total_row_count** | **int** | | [optional]
11+
**player_error_message** | **str** | | [optional]
12+
**player_error_code** | **str** | | [optional]
13+
**error_type_id** | **int** | | [optional]
14+
**country_code** | **str** | | [optional]
15+
**view_start** | **str** | | [optional]
16+
**view_end** | **str** | | [optional]
17+
18+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
19+
20+

docs/AssetsApi.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Method | HTTP request | Description
1616

1717

1818
# **create_asset**
19-
> AssetResponse create_asset(create_asset_request=create_asset_request)
19+
> AssetResponse create_asset(create_asset_request)
2020
2121
Create an asset
2222

@@ -38,11 +38,11 @@ configuration.password = 'YOUR_PASSWORD'
3838

3939
# create an instance of the API class
4040
api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration))
41-
create_asset_request = mux_python.CreateAssetRequest() # CreateAssetRequest | (optional)
41+
create_asset_request = mux_python.CreateAssetRequest() # CreateAssetRequest |
4242

4343
try:
4444
# Create an asset
45-
api_response = api_instance.create_asset(create_asset_request=create_asset_request)
45+
api_response = api_instance.create_asset(create_asset_request)
4646
pprint(api_response)
4747
except ApiException as e:
4848
print("Exception when calling AssetsApi->create_asset: %s\n" % e)
@@ -52,7 +52,7 @@ except ApiException as e:
5252

5353
Name | Type | Description | Notes
5454
------------- | ------------- | ------------- | -------------
55-
**create_asset_request** | [**CreateAssetRequest**](CreateAssetRequest.md)| | [optional]
55+
**create_asset_request** | [**CreateAssetRequest**](CreateAssetRequest.md)| |
5656

5757
### Return type
5858

@@ -70,7 +70,7 @@ Name | Type | Description | Notes
7070
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
7171

7272
# **create_asset_playback_id**
73-
> CreatePlaybackIDResponse create_asset_playback_id(asset_id, create_playback_id_request=create_playback_id_request)
73+
> CreatePlaybackIDResponse create_asset_playback_id(asset_id, create_playback_id_request)
7474
7575
Create a playback ID
7676

@@ -91,11 +91,11 @@ configuration.password = 'YOUR_PASSWORD'
9191
# create an instance of the API class
9292
api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration))
9393
asset_id = 'asset_id_example' # str | The asset ID.
94-
create_playback_id_request = mux_python.CreatePlaybackIDRequest() # CreatePlaybackIDRequest | (optional)
94+
create_playback_id_request = mux_python.CreatePlaybackIDRequest() # CreatePlaybackIDRequest |
9595

9696
try:
9797
# Create a playback ID
98-
api_response = api_instance.create_asset_playback_id(asset_id, create_playback_id_request=create_playback_id_request)
98+
api_response = api_instance.create_asset_playback_id(asset_id, create_playback_id_request)
9999
pprint(api_response)
100100
except ApiException as e:
101101
print("Exception when calling AssetsApi->create_asset_playback_id: %s\n" % e)
@@ -106,7 +106,7 @@ except ApiException as e:
106106
Name | Type | Description | Notes
107107
------------- | ------------- | ------------- | -------------
108108
**asset_id** | **str**| The asset ID. |
109-
**create_playback_id_request** | [**CreatePlaybackIDRequest**](CreatePlaybackIDRequest.md)| | [optional]
109+
**create_playback_id_request** | [**CreatePlaybackIDRequest**](CreatePlaybackIDRequest.md)| |
110110

111111
### Return type
112112

docs/BreakdownValue.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# BreakdownValue
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**views** | **int** | | [optional]
7+
**value** | **float** | | [optional]
8+
**total_watch_time** | **int** | | [optional]
9+
**negative_impact** | **int** | | [optional]
10+
**field** | **str** | | [optional]
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
14+

docs/Error.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Error
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id** | **int** | | [optional]
7+
**percentage** | **float** | | [optional]
8+
**notes** | **str** | | [optional]
9+
**message** | **str** | | [optional]
10+
**last_seen** | **str** | | [optional]
11+
**description** | **str** | | [optional]
12+
**count** | **int** | | [optional]
13+
**code** | **int** | | [optional]
14+
15+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
16+
17+

docs/ErrorsApi.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# mux_python.ErrorsApi
2+
3+
All URIs are relative to *https://api.mux.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**list_errors**](ErrorsApi.md#list_errors) | **GET** /data/v1/errors | List Errors
8+
9+
10+
# **list_errors**
11+
> ListErrorsResponse list_errors(filters=filters, timeframe=timeframe)
12+
13+
List Errors
14+
15+
Returns a list of errors
16+
17+
### Example
18+
19+
* Basic Authentication (accessToken):
20+
```python
21+
from __future__ import print_function
22+
import time
23+
import mux_python
24+
from mux_python.rest import ApiException
25+
from pprint import pprint
26+
configuration = mux_python.Configuration()
27+
# Configure HTTP basic authorization: accessToken
28+
configuration.username = 'YOUR_USERNAME'
29+
configuration.password = 'YOUR_PASSWORD'
30+
31+
# create an instance of the API class
32+
api_instance = mux_python.ErrorsApi(mux_python.ApiClient(configuration))
33+
filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional)
34+
timeframe = ['timeframe_example'] # list[str] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional)
35+
36+
try:
37+
# List Errors
38+
api_response = api_instance.list_errors(filters=filters, timeframe=timeframe)
39+
pprint(api_response)
40+
except ApiException as e:
41+
print("Exception when calling ErrorsApi->list_errors: %s\n" % e)
42+
```
43+
44+
### Parameters
45+
46+
Name | Type | Description | Notes
47+
------------- | ------------- | ------------- | -------------
48+
**filters** | [**list[str]**](str.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional]
49+
**timeframe** | [**list[str]**](str.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. | [optional]
50+
51+
### Return type
52+
53+
[**ListErrorsResponse**](ListErrorsResponse.md)
54+
55+
### Authorization
56+
57+
[accessToken](../README.md#accessToken)
58+
59+
### HTTP request headers
60+
61+
- **Content-Type**: Not defined
62+
- **Accept**: application/json
63+
64+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
65+

docs/ExportsApi.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# mux_python.ExportsApi
2+
3+
All URIs are relative to *https://api.mux.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**list_exports**](ExportsApi.md#list_exports) | **GET** /data/v1/exports | List property video view export links
8+
9+
10+
# **list_exports**
11+
> ListExportsResponse list_exports()
12+
13+
List property video view export links
14+
15+
Lists the available video view exports along with URLs to retrieve them
16+
17+
### Example
18+
19+
* Basic Authentication (accessToken):
20+
```python
21+
from __future__ import print_function
22+
import time
23+
import mux_python
24+
from mux_python.rest import ApiException
25+
from pprint import pprint
26+
configuration = mux_python.Configuration()
27+
# Configure HTTP basic authorization: accessToken
28+
configuration.username = 'YOUR_USERNAME'
29+
configuration.password = 'YOUR_PASSWORD'
30+
31+
# create an instance of the API class
32+
api_instance = mux_python.ExportsApi(mux_python.ApiClient(configuration))
33+
34+
try:
35+
# List property video view export links
36+
api_response = api_instance.list_exports()
37+
pprint(api_response)
38+
except ApiException as e:
39+
print("Exception when calling ExportsApi->list_exports: %s\n" % e)
40+
```
41+
42+
### Parameters
43+
This endpoint does not need any parameter.
44+
45+
### Return type
46+
47+
[**ListExportsResponse**](ListExportsResponse.md)
48+
49+
### Authorization
50+
51+
[accessToken](../README.md#accessToken)
52+
53+
### HTTP request headers
54+
55+
- **Content-Type**: Not defined
56+
- **Accept**: application/json
57+
58+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
59+

docs/FilterValue.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# FilterValue
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**value** | **str** | | [optional]
7+
**total_count** | **int** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

0 commit comments

Comments
 (0)