Skip to content
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
48 changes: 48 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Docs

on:
push:
branches: [main]

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build-docs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- run: uv sync --frozen --extra docs

- run: uv run sphinx-build -b html docs/ docs/_build/html

- uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/html

deploy:
name: Deploy to GitHub Pages
needs: build-docs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ coverage.xml
.mypy_cache/
.ruff_cache/

# Sphinx documentation
docs/_build/

19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
32 changes: 32 additions & 0 deletions docs/api/client.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Client
======

The main entry point for the SDK. :class:`~etoropy.EToroTrading` wraps REST
endpoints, WebSocket streaming, and instrument resolution behind a single
async interface.

EToroTrading
------------

.. autoclass:: etoropy.EToroTrading
:members:
:show-inheritance:

OrderOptions
------------

.. autoclass:: etoropy.OrderOptions
:members:

InstrumentResolver
------------------

.. autoclass:: etoropy.InstrumentResolver
:members:
:show-inheritance:

InstrumentInfo
--------------

.. autoclass:: etoropy.InstrumentInfo
:members:
6 changes: 6 additions & 0 deletions docs/api/config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Configuration
=============

.. autopydantic_settings:: etoropy.EToroConfig
:members:
:show-inheritance:
55 changes: 55 additions & 0 deletions docs/api/errors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Errors
======

All SDK errors inherit from :class:`~etoropy.EToroError`:

.. code-block:: text

EToroError
+-- EToroApiError # HTTP 4xx/5xx
| +-- EToroRateLimitError # HTTP 429
+-- EToroAuthError # HTTP 401/403 or WS auth failure
+-- EToroValidationError # Invalid input
+-- EToroWebSocketError # WS connection/protocol errors

EToroError
----------

.. autoclass:: etoropy.EToroError
:members:
:show-inheritance:

EToroApiError
-------------

.. autoclass:: etoropy.EToroApiError
:members:
:show-inheritance:

EToroRateLimitError
-------------------

.. autoclass:: etoropy.EToroRateLimitError
:members:
:show-inheritance:

EToroAuthError
--------------

.. autoclass:: etoropy.EToroAuthError
:members:
:show-inheritance:

EToroValidationError
--------------------

.. autoclass:: etoropy.EToroValidationError
:members:
:show-inheritance:

EToroWebSocketError
-------------------

.. autoclass:: etoropy.EToroWebSocketError
:members:
:show-inheritance:
36 changes: 36 additions & 0 deletions docs/api/http.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
HTTP Layer
==========

Low-level HTTP transport with rate limiting and retry logic.

HttpClient
----------

.. autoclass:: etoropy.HttpClient
:members:
:show-inheritance:

RequestOptions
--------------

.. autoclass:: etoropy.RequestOptions
:members:

RateLimiter
-----------

.. autoclass:: etoropy.RateLimiter
:members:
:show-inheritance:

RateLimiterOptions
------------------

.. autoclass:: etoropy.RateLimiterOptions
:members:

RetryOptions
------------

.. autoclass:: etoropy.http.RetryOptions
:members:
13 changes: 13 additions & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
API Reference
=============

.. toctree::
:maxdepth: 2

client
config
models
rest
websocket
http
errors
47 changes: 47 additions & 0 deletions docs/api/models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Models
======

All data models are `Pydantic v2 <https://docs.pydantic.dev/latest/>`_
``BaseModel`` subclasses with full type annotations.

Enums
-----

.. automodule:: etoropy.models.enums
:members:
:show-inheritance:

Common
------

.. automodule:: etoropy.models.common
:members:
:show-inheritance:

Market Data
-----------

.. automodule:: etoropy.models.market_data
:members:
:show-inheritance:

Trading
-------

.. automodule:: etoropy.models.trading
:members:
:show-inheritance:

Feeds & Social
--------------

.. automodule:: etoropy.models.feeds
:members:
:show-inheritance:

WebSocket Messages
------------------

.. automodule:: etoropy.models.websocket
:members:
:show-inheritance:
75 changes: 75 additions & 0 deletions docs/api/rest.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
REST Clients
============

The :class:`~etoropy.RestClient` facade composes nine specialized sub-clients,
one per API domain.

RestClient
----------

.. autoclass:: etoropy.RestClient
:members:
:show-inheritance:

MarketDataClient
----------------

.. autoclass:: etoropy.MarketDataClient
:members:
:show-inheritance:

TradingExecutionClient
----------------------

.. autoclass:: etoropy.TradingExecutionClient
:members:
:show-inheritance:

TradingInfoClient
-----------------

.. autoclass:: etoropy.TradingInfoClient
:members:
:show-inheritance:

WatchlistsClient
----------------

.. autoclass:: etoropy.WatchlistsClient
:members:
:show-inheritance:

FeedsClient
-----------

.. autoclass:: etoropy.FeedsClient
:members:
:show-inheritance:

ReactionsClient
---------------

.. autoclass:: etoropy.ReactionsClient
:members:
:show-inheritance:

DiscoveryClient
---------------

.. autoclass:: etoropy.DiscoveryClient
:members:
:show-inheritance:

UsersInfoClient
---------------

.. autoclass:: etoropy.UsersInfoClient
:members:
:show-inheritance:

PiDataClient
-------------

.. autoclass:: etoropy.PiDataClient
:members:
:show-inheritance:
31 changes: 31 additions & 0 deletions docs/api/websocket.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
WebSocket
=========

Real-time streaming via the eToro WebSocket API.

WsClient
--------

.. autoclass:: etoropy.WsClient
:members:
:show-inheritance:

WsClientOptions
---------------

.. autoclass:: etoropy.WsClientOptions
:members:

Message Parser
--------------

.. automodule:: etoropy.ws.message_parser
:members:
:show-inheritance:

Subscription Tracker
--------------------

.. autoclass:: etoropy.ws.WsSubscriptionTracker
:members:
:show-inheritance:
Loading
Loading