@@ -12,33 +12,61 @@ If you're a developer who needs direct access to the [Dispatch API](https://gith
1212
1313## 📦 Installation
1414
15+ ### Using pip
16+
1517Install the library via pip:
1618
1719``` bash
1820pip install frequenz-client-dispatch
1921```
2022
21- ## 🛠️ Usage
23+ ### Using Poetry
24+
25+ If you're using Poetry for dependency management:
26+
27+ ``` bash
28+ poetry add frequenz-client-dispatch
29+ ```
30+
31+ ### From Source
2232
23- Here's a quick example to get you started:
33+ To install from source:
34+
35+ ``` bash
36+ git clone https://github.com/frequenz-floss/frequenz-client-dispatch-python.git
37+ cd frequenz-client-dispatch-python
38+ pip install -e .
39+ ```
40+
41+ ## 🚀 Quick Start
42+
43+ Get up and running in minutes with this simple example:
2444
2545``` python
2646from frequenz.client.dispatch import DispatchApiClient
2747import asyncio
2848
29- async def print_dispatches ():
30- # Initialize the client
31- client = DispatchApiClient(key = " your_api_key" , server_url = " grpc://dispatch.url.goes.here.example.com" )
49+ async def main ():
50+ # Initialize the client with your API credentials
51+ client = DispatchApiClient(
52+ key = " your_api_key_here" ,
53+ server_url = " grpc://dispatch.url.goes.here.example.com"
54+ )
3255
33- # List all dispatches for a specific microgrid
56+ # List all dispatches for microgrid ID 1
3457 async for page in client.list(microgrid_id = 1 ):
3558 for dispatch in page:
36- print (dispatch)
59+ print (f " Dispatch ID: { dispatch.id} " )
60+ print (f " Type: { dispatch.type} " )
61+ print (f " Start Time: { dispatch.start_time} " )
62+ print (" ---" )
3763
38- # Run the Example
39- asyncio.run(print_dispatches ())
64+ # Run the example
65+ asyncio.run(main ())
4066```
4167
68+ ## 🛠️ Usage
69+
4270For detailed usage and advanced features, check out the [ client documentation] ( https://frequenz-floss.github.io/frequenz-client-dispatch-python/latest/reference/frequenz/client/dispatch/#frequenz.client.dispatch.ApiDispatchClient ) .
4371
4472## 🌐 Supported Platforms
0 commit comments