garf-core 0.0.10__tar.gz → 0.0.11__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: garf-core
3
- Version: 0.0.10
3
+ Version: 0.0.11
4
4
  Summary: Abstracts fetching data from API based on provided SQL-like query.
5
5
  Author-email: "Google Inc. (gTech gPS CSE team)" <no-reply@google.com>
6
6
  License: Apache 2.0
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = '0.0.10'
15
+ __version__ = '0.0.11'
@@ -213,13 +213,22 @@ class GarfReport:
213
213
  ) from e
214
214
  return pd.DataFrame(data=self.results, columns=self.column_names)
215
215
 
216
- def to_json(self) -> str:
216
+ def to_jsonl(self) -> str:
217
+ """Converts report to JSON Lines."""
218
+ return self.to_json(output='jsonl')
219
+
220
+ def to_json(self, output: Literal['json', 'jsonl'] = 'json') -> str:
217
221
  """Converts report to JSON.
218
222
 
223
+ Args:
224
+ output: Format of json file (json or jsonl).
225
+
219
226
  Returns:
220
227
  JSON from report results and column_names.
221
228
  """
222
- return json.dumps(self.to_list(row_type='dict'))
229
+ if output == 'json':
230
+ return json.dumps(self.to_list(row_type='dict'))
231
+ return '\n'.join(json.dumps(row) for row in self.to_list(row_type='dict'))
223
232
 
224
233
  def get_value(
225
234
  self, column_index: int = 0, row_index: int = 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: garf-core
3
- Version: 0.0.10
3
+ Version: 0.0.11
4
4
  Summary: Abstracts fetching data from API based on provided SQL-like query.
5
5
  Author-email: "Google Inc. (gTech gPS CSE team)" <no-reply@google.com>
6
6
  License: Apache 2.0
File without changes
File without changes
File without changes