diff --git a/README.md b/README.md index f207fd9..b0f8ff3 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,10 @@ pip install dhkdao-airdrop dhkdao-airdrop --help # Run script with api keys set in config.json -dhkdao_airdrop config.json -o output -t type +dhkdao-airdrop config.json -o output -t type # Run script with api keys set in env vars -CRYPTOCOMPARE_APIKEY="cc-apikey" MINTSCAN_APIKEY="ms-apikey" dhkdao_airdrop config.json -o output -t type +CRYPTOCOMPARE_APIKEY="cc-apikey" MINTSCAN_APIKEY="ms-apikey" dhkdao-airdrop config.json -o output -t type ``` Options: diff --git a/pyproject.toml b/pyproject.toml index 6a62180..e86fb4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "pdm.backend" name = "dhkdao-airdrop" version = "0.1.0" authors = [ - { name = "Jimmy Chu", email = "jimmychu0807@gmail.com" }, + { name = "Jimmy Chu", email = "jimmychu0807@gmail.com" }, ] description = "DHK dao airdrop scripts" license = { file = "LICENSE" } @@ -14,27 +14,26 @@ readme = "README.md" requires-python = ">=3.10" keywords = ["DHK", "DHK dao", "airdrop"] dependencies = [ - "pandas>=2.2.3", - "python-dotenv", - "numpy>=2.1.0", - "typer>=0.12.5", - "requests>=2.32.3", + "pandas>=2.2.3", + "python-dotenv", + "numpy>=2.1.0", + "typer>=0.12.5", + "requests>=2.32.3", ] - -[tool.pdm.dev-dependencies] -lint = [ - "flake8", - "black" -] -test = [ - "pytest>=8.3.3", - "python-dotenv>=1.0.1" +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3.10" ] [project.urls] Homepage = "https://github.com/dhkdao/airdrop-scripts" +Documentation = "https://github.com/dhkdao/airdrop-scripts/blob/main/README.md" Issues = "https://github.com/dhkdao/airdrop-scripts/issues" +[project.scripts] +dhkdao-airdrop = "dhkdao_airdrop:cli" + [tool.pdm] distribution = true @@ -43,5 +42,15 @@ test = "pytest" "test:no-capture" = "pytest --capture=no tests" lint = "flake8 src tests" "lint:write" = "black src tests" -exe = "pdm run src/scripts/main.py" +exe = "pdm run src/main.py" all = { composite = ["lint", "test"]} + +[tool.pdm.dev-dependencies] +lint = [ + "flake8", + "black" +] +test = [ + "pytest>=8.3.3", + "python-dotenv>=1.0.1" +] diff --git a/src/.keep b/src/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/src/dhkdao_airdrop/__init__.py b/src/dhkdao_airdrop/__init__.py new file mode 100644 index 0000000..3d218c5 --- /dev/null +++ b/src/dhkdao_airdrop/__init__.py @@ -0,0 +1,5 @@ +from .airdrop import Airdrop +from .cli import cli +from .utils import is_number, round_output, get_config_with_apikey_envs + +__all__ = ["Airdrop", "cli", "is_number", "round_output", "get_config_with_apikey_envs"] diff --git a/src/scripts/airdrop.py b/src/dhkdao_airdrop/airdrop.py similarity index 99% rename from src/scripts/airdrop.py rename to src/dhkdao_airdrop/airdrop.py index 252f7f7..a7730ad 100644 --- a/src/scripts/airdrop.py +++ b/src/dhkdao_airdrop/airdrop.py @@ -8,7 +8,7 @@ from rich import print from typing import Optional -from scripts.utils import is_number +from .utils import is_number class Airdrop: diff --git a/src/scripts/main.py b/src/dhkdao_airdrop/cli.py similarity index 87% rename from src/scripts/main.py rename to src/dhkdao_airdrop/cli.py index 8db961f..4d600d5 100644 --- a/src/scripts/main.py +++ b/src/dhkdao_airdrop/cli.py @@ -3,7 +3,8 @@ from enum import Enum from rich import print -from scripts import Airdrop, round_output, get_config_with_apikey_envs +from .airdrop import Airdrop +from .utils import round_output, get_config_with_apikey_envs class OutputType(str, Enum): @@ -31,7 +32,7 @@ def monthly_alloc( ] = OutputType.table, ): """ - Compute the DHKdao monthly airdrop allocation based on staked value on various blockchains. + Compute the DHK dao monthly airdrop allocation based on staked value on various blockchains. """ config = get_config_with_apikey_envs(config) airdrop = Airdrop(config) @@ -54,5 +55,5 @@ def monthly_alloc( print(result_output, file=fh) -if __name__ == "__main__": +def cli(): app() diff --git a/src/scripts/utils.py b/src/dhkdao_airdrop/utils.py similarity index 100% rename from src/scripts/utils.py rename to src/dhkdao_airdrop/utils.py diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..2d4cb32 --- /dev/null +++ b/src/main.py @@ -0,0 +1,4 @@ +from dhkdao_airdrop import cli + +if __name__ == "__main__": + cli() diff --git a/src/scripts/__init__.py b/src/scripts/__init__.py deleted file mode 100644 index 715e7ff..0000000 --- a/src/scripts/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .airdrop import Airdrop -from .utils import is_number, round_output, get_config_with_apikey_envs - -__all__ = ["Airdrop", "is_number", "round_output", "get_config_with_apikey_envs"] diff --git a/tests/scripts/test_airdrop.py b/tests/dhkdao_airdrop/test_airdrop.py similarity index 97% rename from tests/scripts/test_airdrop.py rename to tests/dhkdao_airdrop/test_airdrop.py index dcce238..5951f63 100644 --- a/tests/scripts/test_airdrop.py +++ b/tests/dhkdao_airdrop/test_airdrop.py @@ -3,7 +3,7 @@ import pytest import typer from dotenv import load_dotenv -from scripts import Airdrop, get_config_with_apikey_envs +from dhkdao_airdrop import Airdrop, get_config_with_apikey_envs load_dotenv()