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
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine check dist/*
twine upload dist/*
29 changes: 29 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov
pip install -e .
- name: Test with pytest
run: |
pytest --cov=dexpaprika_sdk tests/
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include LICENSE
include README.md
include CHANGELOG.md
recursive-include examples *.py
recursive-include docs *.md *.py *.rst
global-exclude __pycache__
global-exclude *.py[cod]
global-exclude *.so
global-exclude .DS_Store
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# DexPaprika Python SDK

[![PyPI version](https://badge.fury.io/py/dexpaprika-sdk.svg)](https://badge.fury.io/py/dexpaprika-sdk)
[![Python Version](https://img.shields.io/pypi/pyversions/dexpaprika-sdk)](https://pypi.org/project/dexpaprika-sdk/)
[![Tests](https://github.com/coinpaprika/dexpaprika-sdk-python/actions/workflows/tests.yml/badge.svg)](https://github.com/coinpaprika/dexpaprika-sdk-python/actions/workflows/tests.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A Python client for the DexPaprika API. This SDK provides easy access to real-time data from decentralized exchanges across multiple blockchain networks.

## Features
Expand Down Expand Up @@ -241,12 +246,47 @@ The SDK provides the following main components:
- `SearchAPI`: Search for tokens, pools, and DEXes
- `UtilsAPI`: Utility endpoints like global statistics

## Publishing

For developers contributing to this package, here's how to publish a new version:

1. Update the version in `dexpaprika_sdk/__init__.py`
2. Update the `CHANGELOG.md`
3. Create a new release in GitHub
4. GitHub Actions will automatically build and publish to PyPI

## Development Setup

```bash
# Clone the repository
git clone https://github.com/coinpaprika/dexpaprika-sdk-python.git
cd dexpaprika-sdk-python

# Create a virtual environment (optional)
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate

# Install dev dependencies
pip install -e ".[dev]"
```

## Running Tests

```bash
# Run tests with pytest
pytest

# Run with coverage
pytest --cov=dexpaprika_sdk tests/
```

## Resources

- [Official Documentation](https://docs.dexpaprika.com) - Comprehensive API reference
- [DexPaprika Website](https://dexpaprika.com) - Main product website
- [CoinPaprika](https://coinpaprika.com) - Related cryptocurrency data platform
- [Discord Community](https://discord.gg/DhJge5TUGM) - Get support and connect with other developers
- [PyPI Package](https://pypi.org/project/dexpaprika-sdk/) - Python package details

## License

Expand Down
95 changes: 0 additions & 95 deletions SUMMARY.md

This file was deleted.

20 changes: 19 additions & 1 deletion dexpaprika_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@
"""

from .client import DexPaprikaClient
# Import models for easier access
from .models import (
Network, Dex, DexesResponse,
Token, Pool, PoolsResponse, TimeIntervalMetrics,
PoolDetails, OHLCVRecord, Transaction, TransactionsResponse,
TokenSummary, TokenDetails,
DexInfo, SearchResult,
Stats
)

__version__ = "0.2.0"
__all__ = ["DexPaprikaClient"]
__all__ = [
"DexPaprikaClient",
# Models
"Network", "Dex", "DexesResponse",
"Token", "Pool", "PoolsResponse", "TimeIntervalMetrics",
"PoolDetails", "OHLCVRecord", "Transaction", "TransactionsResponse",
"TokenSummary", "TokenDetails",
"DexInfo", "SearchResult",
"Stats"
]
6 changes: 3 additions & 3 deletions dexpaprika_sdk/models/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TokenSummary(BaseModel):
"""Summary metrics for a token."""

price_usd: float = Field(..., description="Current price in USD")
fdv: float = Field(..., description="Fully diluted valuation")
fdv: Optional[float] = Field(None, description="Fully diluted valuation (may be None for some chains like Solana)")
liquidity_usd: float = Field(..., description="Total liquidity in USD")
pools: Optional[int] = Field(None, description="Number of pools containing the token")

Expand All @@ -34,7 +34,7 @@ class TokenDetails(BaseModel):
symbol: str = Field(..., description="Token symbol")
chain: str = Field(..., description="Network the token is on")
decimals: int = Field(..., description="Decimal precision of the token")
total_supply: float = Field(..., description="Total supply of the token")
total_supply: Optional[float] = Field(None, description="Total supply of the token (may be None for some chains like Solana)")
description: str = Field("", description="Token description")
website: str = Field("", description="Token website URL")
explorer: str = Field("", description="Token explorer URL")
Expand All @@ -51,7 +51,7 @@ class TokenDetailsLight(BaseModel):
symbol: str = Field(..., description="Token symbol")
chain: str = Field(..., description="Network the token is on")
decimals: int = Field(..., description="Decimal precision of the token")
total_supply: float = Field(..., description="Total supply of the token")
total_supply: Optional[float] = Field(None, description="Total supply of the token (may be None for some chains like Solana)")
description: str = Field("", description="Token description")
website: str = Field("", description="Token website URL")
explorer: str = Field("", description="Token explorer URL")
Expand Down
Loading