bookalimo 0.1.1__tar.gz → 0.1.2__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.
- {bookalimo-0.1.1/src/bookalimo.egg-info → bookalimo-0.1.2}/PKG-INFO +1 -12
- {bookalimo-0.1.1 → bookalimo-0.1.2}/README.md +0 -11
- {bookalimo-0.1.1 → bookalimo-0.1.2}/pyproject.toml +1 -1
- {bookalimo-0.1.1 → bookalimo-0.1.2}/src/bookalimo/_client.py +1 -9
- {bookalimo-0.1.1 → bookalimo-0.1.2}/src/bookalimo/wrapper.py +4 -3
- {bookalimo-0.1.1 → bookalimo-0.1.2/src/bookalimo.egg-info}/PKG-INFO +1 -12
- {bookalimo-0.1.1 → bookalimo-0.1.2}/LICENSE +0 -0
- {bookalimo-0.1.1 → bookalimo-0.1.2}/setup.cfg +0 -0
- {bookalimo-0.1.1 → bookalimo-0.1.2}/src/bookalimo/__init__.py +0 -0
- {bookalimo-0.1.1 → bookalimo-0.1.2}/src/bookalimo/models.py +0 -0
- {bookalimo-0.1.1 → bookalimo-0.1.2}/src/bookalimo/py.typed +0 -0
- {bookalimo-0.1.1 → bookalimo-0.1.2}/src/bookalimo.egg-info/SOURCES.txt +0 -0
- {bookalimo-0.1.1 → bookalimo-0.1.2}/src/bookalimo.egg-info/dependency_links.txt +0 -0
- {bookalimo-0.1.1 → bookalimo-0.1.2}/src/bookalimo.egg-info/requires.txt +0 -0
- {bookalimo-0.1.1 → bookalimo-0.1.2}/src/bookalimo.egg-info/top_level.txt +0 -0
- {bookalimo-0.1.1 → bookalimo-0.1.2}/tests/test_client.py +0 -0
- {bookalimo-0.1.1 → bookalimo-0.1.2}/tests/test_models.py +0 -0
- {bookalimo-0.1.1 → bookalimo-0.1.2}/tests/test_wrapper.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bookalimo
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
4
4
|
Summary: Python wrapper for the Book-A-Limo API
|
5
5
|
Author-email: Jonathan Oren <jonathan@bookalimo.com>
|
6
6
|
Maintainer-email: Jonathan Oren <jonathan@bookalimo.com>
|
@@ -127,16 +127,6 @@ if __name__ == "__main__":
|
|
127
127
|
asyncio.run(main())
|
128
128
|
```
|
129
129
|
|
130
|
-
### Using the Sandbox
|
131
|
-
|
132
|
-
```python
|
133
|
-
async with AsyncClient() as http_client:
|
134
|
-
async with BookALimo(
|
135
|
-
credentials, http_client=http_client, sandbox=True
|
136
|
-
) as client:
|
137
|
-
...
|
138
|
-
```
|
139
|
-
|
140
130
|
## Authentication
|
141
131
|
|
142
132
|
```python
|
@@ -320,7 +310,6 @@ mkdocs serve
|
|
320
310
|
|
321
311
|
* Never log raw passwords or credit card numbers.
|
322
312
|
* Store credentials securely (e.g., environment variables, secrets managers).
|
323
|
-
* Use sandbox for testing.
|
324
313
|
|
325
314
|
## License
|
326
315
|
|
@@ -69,16 +69,6 @@ if __name__ == "__main__":
|
|
69
69
|
asyncio.run(main())
|
70
70
|
```
|
71
71
|
|
72
|
-
### Using the Sandbox
|
73
|
-
|
74
|
-
```python
|
75
|
-
async with AsyncClient() as http_client:
|
76
|
-
async with BookALimo(
|
77
|
-
credentials, http_client=http_client, sandbox=True
|
78
|
-
) as client:
|
79
|
-
...
|
80
|
-
```
|
81
|
-
|
82
72
|
## Authentication
|
83
73
|
|
84
74
|
```python
|
@@ -262,7 +252,6 @@ mkdocs serve
|
|
262
252
|
|
263
253
|
* Never log raw passwords or credit card numbers.
|
264
254
|
* Store credentials securely (e.g., environment variables, secrets managers).
|
265
|
-
* Use sandbox for testing.
|
266
255
|
|
267
256
|
## License
|
268
257
|
|
@@ -63,9 +63,7 @@ class BookALimoClient:
|
|
63
63
|
credentials: Credentials,
|
64
64
|
user_agent: str = "bookalimo-python",
|
65
65
|
version: Optional[str] = None,
|
66
|
-
sandbox: bool = False,
|
67
66
|
base_url: str = "https://api.bookalimo.com",
|
68
|
-
base_url_sandbox: str = "https://sandbox.bookalimo.com",
|
69
67
|
http_timeout: float = 5.0,
|
70
68
|
):
|
71
69
|
"""Initialize the client with an HTTP client."""
|
@@ -76,9 +74,7 @@ class BookALimoClient:
|
|
76
74
|
"content-type": "application/json",
|
77
75
|
"user-agent": f"{user_agent}/{version}",
|
78
76
|
}
|
79
|
-
self.sandbox = sandbox
|
80
77
|
self.base_url = base_url
|
81
|
-
self.base_url_sandbox = base_url_sandbox
|
82
78
|
self.http_timeout = http_timeout
|
83
79
|
|
84
80
|
def _convert_model_to_api_dict(self, data: dict[str, Any]) -> dict[str, Any]:
|
@@ -175,10 +171,6 @@ class BookALimoClient:
|
|
175
171
|
result.append(char.lower())
|
176
172
|
return "".join(result)
|
177
173
|
|
178
|
-
def get_base_url(self) -> str:
|
179
|
-
"""Get the base URL for the API."""
|
180
|
-
return self.base_url_sandbox if self.sandbox else self.base_url
|
181
|
-
|
182
174
|
async def _make_request(
|
183
175
|
self,
|
184
176
|
endpoint: str,
|
@@ -201,7 +193,7 @@ class BookALimoClient:
|
|
201
193
|
Raises:
|
202
194
|
BookALimoError: On API errors or HTTP errors
|
203
195
|
"""
|
204
|
-
url = f"{self.
|
196
|
+
url = f"{self.base_url}{endpoint}"
|
205
197
|
|
206
198
|
# Convert model data to API format
|
207
199
|
api_data = self._convert_model_to_api_dict(data.model_dump())
|
@@ -44,7 +44,8 @@ class BookALimo:
|
|
44
44
|
self,
|
45
45
|
credentials: Credentials,
|
46
46
|
http_client: Optional[AsyncClient] = None,
|
47
|
-
|
47
|
+
base_url: str = "https://api.bookalimo.com",
|
48
|
+
http_timeout: float = 5.0,
|
48
49
|
**kwargs: Any,
|
49
50
|
):
|
50
51
|
"""
|
@@ -52,7 +53,6 @@ class BookALimo:
|
|
52
53
|
|
53
54
|
Args:
|
54
55
|
credentials: User ID and password hash for authentication.
|
55
|
-
sandbox: Set to True to use the sandbox environment.
|
56
56
|
http_client: Optional custom httpx.AsyncClient instance.
|
57
57
|
**kwargs: Additional options passed to the BookALimoClient.
|
58
58
|
"""
|
@@ -60,8 +60,9 @@ class BookALimo:
|
|
60
60
|
self.http_client = http_client or AsyncClient()
|
61
61
|
self.client = BookALimoClient(
|
62
62
|
credentials=credentials,
|
63
|
-
sandbox=sandbox,
|
64
63
|
client=self.http_client,
|
64
|
+
base_url=base_url,
|
65
|
+
http_timeout=http_timeout,
|
65
66
|
**kwargs,
|
66
67
|
)
|
67
68
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bookalimo
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
4
4
|
Summary: Python wrapper for the Book-A-Limo API
|
5
5
|
Author-email: Jonathan Oren <jonathan@bookalimo.com>
|
6
6
|
Maintainer-email: Jonathan Oren <jonathan@bookalimo.com>
|
@@ -127,16 +127,6 @@ if __name__ == "__main__":
|
|
127
127
|
asyncio.run(main())
|
128
128
|
```
|
129
129
|
|
130
|
-
### Using the Sandbox
|
131
|
-
|
132
|
-
```python
|
133
|
-
async with AsyncClient() as http_client:
|
134
|
-
async with BookALimo(
|
135
|
-
credentials, http_client=http_client, sandbox=True
|
136
|
-
) as client:
|
137
|
-
...
|
138
|
-
```
|
139
|
-
|
140
130
|
## Authentication
|
141
131
|
|
142
132
|
```python
|
@@ -320,7 +310,6 @@ mkdocs serve
|
|
320
310
|
|
321
311
|
* Never log raw passwords or credit card numbers.
|
322
312
|
* Store credentials securely (e.g., environment variables, secrets managers).
|
323
|
-
* Use sandbox for testing.
|
324
313
|
|
325
314
|
## License
|
326
315
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|