marianbasti commited on
Commit
e8da824
1 Parent(s): 02b4e4a

Add usage example

Browse files
Files changed (1) hide show
  1. README.md +17 -0
README.md CHANGED
@@ -26,4 +26,21 @@ El formato del dataset es el siguiente:
26
  "date":"Fecha publicada",
27
  "url":"url relativa"
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  ```
 
26
  "date":"Fecha publicada",
27
  "url":"url relativa"
28
  }
29
+ ```
30
+
31
+ If you want to dynamically query filtered data, without downloading the wholde dataset, you can do so like this:
32
+ ```python
33
+ # In this example, we filter entries by date
34
+ import requests
35
+
36
+ API_TOKEN = "your_api_token_here"
37
+ headers = {"Authorization": f"Bearer {API_TOKEN}"}
38
+ date='2024-03-01'
39
+ API_URL = f"https://datasets-server.huggingface.co/filter?dataset=marianbasti/boletin-oficial-argentina&config=default&split=train&where=date='{date}T00:00:00'"
40
+
41
+ def query():
42
+ response = requests.get(API_URL, headers=headers)
43
+ return response.json()
44
+
45
+ data = query()
46
  ```