Skip to content

Commit

Permalink
feat: add Client SDK for rapyuta.io v2 APIs
Browse files Browse the repository at this point in the history
Resolves AB#35882
  • Loading branch information
guptadev21 authored and ankitrgadiya committed Dec 13, 2024
1 parent 8eefdae commit 9a459ce
Show file tree
Hide file tree
Showing 26 changed files with 4,170 additions and 156 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/pull-request.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/python-compatibility.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: ✅ Quality Checks
on: [ push ]

jobs:
perform-checks:
name: Perform checks
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Lint code
uses: astral-sh/ruff-action@v1
with:
args: "check"

- name: Setup uv
uses: astral-sh/setup-uv@v4

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Run unit tests
run: |
uv sync --all-extras --dev
source .venv/bin/activate
uv run pytest tests/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ wheels/
main_test.py
test_config.json

ignore/
ignore/
.coverage
51 changes: 39 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,54 @@
# Rapyuta IO SDK v2
Rapyuta IO SDK v2 provides a comprehensive set of tools and functionalities to interact with the rapyut.io platform.
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./assets/v2sdk-logo-dark.png">
<img alt="Telemetry Pipeline Logo" src="./assets/v2sdk-logo-light.png">
</picture>
</p>

# rapyuta.io SDK v2

rapyuta.io SDK v2 provides a comprehensive set of tools and functionalities to interact with the rapyuta.io platform.

## Installation

```bash
pip install rapyuta-io-sdk-v2
```

### Quick Start
## Usage

To use the SDK, you need to configure it with your rapyuta.io credentials.

### From a Configuration File

You can create a `Configuration` object from a JSON file.

```python
from rapyuta_io_sdk_v2 import Configuration, Client
from rapyuta_io_sdk_v2.config import Configuration, Client

config = Configuration.from_file("/path/to/config.json")
client = Client(config)
```

config = Configuration(email="[email protected]",
password="password",
organization_guid="organization_guid",
project_guid="project_guid")
### Using `email` and `password`

```python
from rapyuta_io_sdk_v2.config import Configuration, Client

config = Configuration(organization_guid="ORGANIZATION_GUID")
client = Client(config)
client.login()
client.login(email="EMAIL", password="PASSWORD")
```

You are now set to invoke various methods on the `client` object.

# Get current project
project = client.get_project()
For example, this is how you can list projects.

```python
projects = client.list_projects()
print(projects)
```

## Contributing

We welcome contributions! Please read our [contributing guidelines](CONTRIBUTING.md) to get started.
We welcome contributions. Please read our [contribution guidelines](CONTRIBUTING.md) to get started.
Binary file added assets/v2sdk-logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/v2sdk-logo-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ dynamic = ["version"]
description = "Python SDK for rapyuta.io v2 APIs"
dependencies = [
"httpx>=0.27.2",
"mock>=5.1.0",
"munch>=4.0.0",
"pytest-mock>=3.14.0",
"pytest>=8.3.3",
"tenacity>=9.0.0",
]
readme = "README.md"
license = { file = "LICENSE" }
Expand All @@ -30,3 +26,15 @@ allow-direct-references = true

[tool.hatch.build.targets.wheel]
packages = ["rapyuta_io_sdk_v2"]

[dependency-groups]
dev = [
"coverage>=7.6.1",
"mock>=5.1.0",
"pytest-cov>=5.0.0",
"pytest-mock>=3.14.0",
"pytest>=8.3.3",
"anyio>=4.5.2",
"asyncer>=0.0.8",
"typing-extensions>=4.12.2",
]
3 changes: 2 additions & 1 deletion rapyuta_io_sdk_v2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ruff: noqa
from rapyuta_io_sdk_v2.config import Configuration
from rapyuta_io_sdk_v2.client import Client
from rapyuta_io_sdk_v2.config import Configuration
from rapyuta_io_sdk_v2.utils import walk_pages

__version__ = "0.0.1"
Loading

0 comments on commit 9a459ce

Please sign in to comment.