Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs #4

Merged
merged 15 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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