mirror of
https://github.com/kevinveenbirkenbach/baserow-ifto.git
synced 2024-11-01 01:23:10 +01:00
Optimized json output
This commit is contained in:
parent
2cc80b775a
commit
9e77f5b346
@ -1,5 +1,6 @@
|
|||||||
import requests
|
import requests
|
||||||
import argparse
|
import argparse
|
||||||
|
import json
|
||||||
|
|
||||||
def create_headers(api_key):
|
def create_headers(api_key):
|
||||||
"""Create headers for API requests."""
|
"""Create headers for API requests."""
|
||||||
@ -83,7 +84,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
if args.table_id:
|
if args.table_id:
|
||||||
table_data = get_all_rows_from_table(args.base_url, args.api_key, args.table_id, args.verbose)
|
table_data = get_all_rows_from_table(args.base_url, args.api_key, args.table_id, args.verbose)
|
||||||
print(table_data)
|
print(json.dumps(table_data, indent=4))
|
||||||
else:
|
else:
|
||||||
all_data = get_all_data_from_database(args.base_url, args.api_key, args.database_id, args.verbose)
|
all_data = get_all_data_from_database(args.base_url, args.api_key, args.database_id, args.verbose)
|
||||||
print(all_data)
|
print(json.dumps(all_data, indent=4))
|
Loading…
Reference in New Issue
Block a user