Skip to content

Commit

Permalink
Add docs (#4)
Browse files Browse the repository at this point in the history
* Update readme

* generate docs

* github pages

* Fix tests

* fix typo

* Fix

* Fix lint

* impove naming

* Cleanup ci job

* switch to main branch

* docs title

* Default server address and token

* Add docstrings

* Switch to main

* Update jellyfish/_room_api.py

Co-authored-by: Jakub Pisarek <99591440+sgfn@users.noreply.github.com>

---------

Co-authored-by: Jakub Pisarek <99591440+sgfn@users.noreply.github.com>
  • Loading branch information
roznawsk and sgfn authored Sep 18, 2023
1 parent ebe6b1d commit af70bf3
Show file tree
Hide file tree
Showing 14 changed files with 430 additions and 27 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:
executor: python/default
steps:
- checkout
- python/install-packages:
pkg-manager: pip
- run:
name: Install python dependencies
command: pip install -r dev-requirements.txt
- run:
name: Lint
command: ./pylint.sh
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: docs

on:
push:
branches:
- main

jobs:
# Build the documentation and upload the static HTML files as an artifact.
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- run: pip install -r dev-requirements.txt
- run: ./pdoc.sh
- uses: actions/upload-pages-artifact@v2
with:
path: doc

# Deploy the artifact to GitHub pages.
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v2
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ instance/
# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
# pdoc documentation
/doc

# PyBuilder
.pybuilder/
Expand Down
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,45 @@

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/jellyfish-dev/python-server-sdk/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/jellyfish-dev/python-server-sdk/tree/main)

Python server SDK for [Jellyfish](https://github.com/jellyfish-dev/jellyfish).
Python server SDK for the [Jellyfish](https://github.com/jellyfish-dev/jellyfish) media server.

Read the docs [here](https://jellyfish-dev.github.io/python-server-sdk/jellyfish.html)

## Installation
TODO

You can install the latest version of the package from github:
```
pip install git+https://github.com/jellyfish-dev/python-server-sdk
```

## Usage

First create a `RoomApi` instance, providing the jellyfish server address and api token

```python
from jellyfish import RoomApi

room_api = RoomApi(server_address='localhost:5002', server_api_token='development')
```

You can use it to interact with Jellyfish managing rooms, peers and components

```python
# Create a room
jellyfish_address, room = room_api.create_room()
# 'localhost:5002', Room(components=[], id='f7cc2eac-f699-4609-ac8f-92f1ad6bea0c', peers=[])

# Add peer to the room
from jellyfish import PeerOptionsWebRTC

peer_token, peer_webrtc = room_api.add_peer(room.id, peer_type='webrtc', options=PeerOptionsWebRTC())
# 'AgDYfrCSigFiAA', Peer(id='2869fb5', status=<PeerStatus.DISCONNECTED: 'disconnected'>, type='webrtc')

# Add component to the room
component_hls = room_api.add_component(room.id, component_type='hls')
# Component(id='4c028a86', metadata=ComponentMetadata(playable=False), type='hls')
```

## Copyright and License

Copyright 2023, [Software Mansion](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=jellyfish)
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt → dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ python_dateutil==2.8.2
setuptools==67.6.1
typing_extensions==4.7.1
urllib3==2.0.4
pylint==2.17.5
pylint==2.17.5
pdoc==14.1.0
Loading

0 comments on commit af70bf3

Please sign in to comment.