diff --git a/README.md b/README.md index 9b0fad0..694e25e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ request and response fields, and offers both synchronous and asynchronous client ## Installation and Setup -1. Add this dependency to your project's build file: +1. Add `schematichq` to your project's build file: ```bash pip install schematichq @@ -106,6 +106,17 @@ client.track( This call is non-blocking and there is no response to check. +If you want to record large numbers of the same event at once, or perhaps measure usage in terms of a unit like tokens or memory, you can optionally specify a quantity for your event: + +```python +client.track( + event="some-action", + user={"user_id": "your-user-id"}, + company={"id": "your-company-id"}, + quantity=10, +) +``` + ### Creating and updating companies Although it is faster to create companies and users via identify events, if you need to handle a response, you can use the companies API to upsert companies. Because you use your own identifiers to identify companies, rather than a Schematic company ID, creating and updating companies are both done via the same upsert operation: diff --git a/src/schematic/client.py b/src/schematic/client.py index cc66811..15c82fd 100644 --- a/src/schematic/client.py +++ b/src/schematic/client.py @@ -123,12 +123,14 @@ def track( company: Optional[Dict[str, str]] = None, user: Optional[Dict[str, str]] = None, traits: Optional[Dict[str, Any]] = None, + quantity: Optional[int] = None, ) -> None: self._enqueue_event( "track", EventBodyTrack( company=company, event=event, + quantity=quantity, traits=traits, user=user, ),