helius-python 0.0.2__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: helius-python
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: Typed Python client for the Helius API
5
5
  Project-URL: Homepage, https://github.com/markosnarinian/helius-python
6
6
  Project-URL: Issues, https://github.com/markosnarinian/helius-python/issues
@@ -83,8 +83,14 @@ from helius.client import HeliusClient
83
83
  client = HeliusClient(api_key="YOUR_HELIUS_API_KEY")
84
84
  ```
85
85
 
86
- or set it in a `.env` file at the project root and let the client pick it up
87
- automatically:
86
+ or set `HELIUS_API_KEY` as an environment variable:
87
+
88
+ ```bash
89
+ export HELIUS_API_KEY=your_helius_api_key
90
+ ```
91
+
92
+ You can also set it in a `.env` file at the project root and let the client
93
+ pick it up automatically:
88
94
 
89
95
  ```env
90
96
  HELIUS_API_KEY=your_helius_api_key
@@ -93,7 +99,7 @@ HELIUS_API_KEY=your_helius_api_key
93
99
  ```python
94
100
  from helius.client import HeliusClient
95
101
 
96
- client = HeliusClient() # reads HELIUS_API_KEY from .env
102
+ client = HeliusClient() # reads HELIUS_API_KEY from the environment or .env
97
103
  ```
98
104
 
99
105
  ## Usage
@@ -145,7 +151,7 @@ instance is garbage-collected. Prefer `with` or `close()` regardless.
145
151
  | Argument | Default | Notes |
146
152
  | --------- | ------------------------------------ | --------------------------------------------------------------------------------------------- |
147
153
  | `base_url`| `"https://mainnet.helius-rpc.com"` | Override to point at devnet, staging, or a custom Helius endpoint. |
148
- | `api_key` | `None` → falls back to `HELIUS_API_KEY` in a `.env` file | If neither is provided, the constructor raises `ValueError`. |
154
+ | `api_key` | `None` → falls back to `HELIUS_API_KEY` from the environment, then `.env` | If none is provided, the constructor raises `ValueError`. |
149
155
 
150
156
  Per-method RPC parameters (`commitment`, `encoding`, `min_context_slot`, etc.)
151
157
  are left unset by default — the Helius/Solana server defaults apply unless you
@@ -63,8 +63,14 @@ from helius.client import HeliusClient
63
63
  client = HeliusClient(api_key="YOUR_HELIUS_API_KEY")
64
64
  ```
65
65
 
66
- or set it in a `.env` file at the project root and let the client pick it up
67
- automatically:
66
+ or set `HELIUS_API_KEY` as an environment variable:
67
+
68
+ ```bash
69
+ export HELIUS_API_KEY=your_helius_api_key
70
+ ```
71
+
72
+ You can also set it in a `.env` file at the project root and let the client
73
+ pick it up automatically:
68
74
 
69
75
  ```env
70
76
  HELIUS_API_KEY=your_helius_api_key
@@ -73,7 +79,7 @@ HELIUS_API_KEY=your_helius_api_key
73
79
  ```python
74
80
  from helius.client import HeliusClient
75
81
 
76
- client = HeliusClient() # reads HELIUS_API_KEY from .env
82
+ client = HeliusClient() # reads HELIUS_API_KEY from the environment or .env
77
83
  ```
78
84
 
79
85
  ## Usage
@@ -125,7 +131,7 @@ instance is garbage-collected. Prefer `with` or `close()` regardless.
125
131
  | Argument | Default | Notes |
126
132
  | --------- | ------------------------------------ | --------------------------------------------------------------------------------------------- |
127
133
  | `base_url`| `"https://mainnet.helius-rpc.com"` | Override to point at devnet, staging, or a custom Helius endpoint. |
128
- | `api_key` | `None` → falls back to `HELIUS_API_KEY` in a `.env` file | If neither is provided, the constructor raises `ValueError`. |
134
+ | `api_key` | `None` → falls back to `HELIUS_API_KEY` from the environment, then `.env` | If none is provided, the constructor raises `ValueError`. |
129
135
 
130
136
  Per-method RPC parameters (`commitment`, `encoding`, `min_context_slot`, etc.)
131
137
  are left unset by default — the Helius/Solana server defaults apply unless you
@@ -10,7 +10,7 @@ build-backend = "hatchling.build"
10
10
 
11
11
  [project]
12
12
  name = "helius-python"
13
- version = "0.0.2"
13
+ version = "0.0.3"
14
14
  authors = [
15
15
  { name="Markos Narinian", email="manarinian@gmail.com" },
16
16
  ]
@@ -1,3 +1,4 @@
1
+ import os
1
2
  from typing import Annotated, Any, Literal
2
3
 
3
4
  import httpx
@@ -38,7 +39,11 @@ class HeliusClient:
38
39
  api_key: str | None = None,
39
40
  ) -> None:
40
41
  self.base_url = base_url
41
- self.api_key = api_key or dotenv_values().get("HELIUS_API_KEY")
42
+ self.api_key = (
43
+ api_key
44
+ or os.environ.get("HELIUS_API_KEY")
45
+ or dotenv_values().get("HELIUS_API_KEY")
46
+ )
42
47
  if not self.api_key:
43
48
  raise ValueError("No API key provided.")
44
49
  self._client = httpx.Client(
File without changes
File without changes
File without changes
File without changes