mirror of
https://github.com/kevinveenbirkenbach/baserow-ifto.git
synced 2024-12-04 15:56:52 +01:00
Ignored file cache
This commit is contained in:
parent
a1ec0b9760
commit
0dbde23304
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
*.json
|
*.json
|
||||||
|
__pycache__
|
Binary file not shown.
@ -40,10 +40,10 @@ class BaserowAPI:
|
|||||||
if self.verbose:
|
if self.verbose:
|
||||||
print(f"[INFO] Fetching all rows from table with ID: {table_id}...")
|
print(f"[INFO] Fetching all rows from table with ID: {table_id}...")
|
||||||
rows = []
|
rows = []
|
||||||
next_url = f"{self.base_url}database/rows/table/{table_id}/"
|
next_url = "database/rows/table/{table_id}/"
|
||||||
|
|
||||||
while next_url:
|
while next_url:
|
||||||
response = requests.get(next_url, headers=self.headers)
|
request_response(next_url)
|
||||||
self.print_verbose_message("Requesting:", next_url)
|
self.print_verbose_message("Requesting:", next_url)
|
||||||
data = self.handle_api_response(response)
|
data = self.handle_api_response(response)
|
||||||
if not data:
|
if not data:
|
||||||
@ -53,9 +53,12 @@ class BaserowAPI:
|
|||||||
|
|
||||||
return rows
|
return rows
|
||||||
|
|
||||||
|
def request_response(self,command):
|
||||||
|
return requests.get(f"{self.base_url}{command}", headers=self.headers)
|
||||||
|
|
||||||
def get_all_tables_from_database(self, database_id):
|
def get_all_tables_from_database(self, database_id):
|
||||||
self.print_verbose_message("[INFO] Fetching all tables from database with ID: {database_id}...")
|
self.print_verbose_message("[INFO] Fetching all tables from database with ID: {database_id}...")
|
||||||
response = requests.get(f"{self.base_url}database/tables/database/{database_id}/", headers=self.headers)
|
response = request_response("database/tables/database/{database_id}/")
|
||||||
return self.handle_api_response(response) or []
|
return self.handle_api_response(response) or []
|
||||||
|
|
||||||
def get_all_data_from_database(self, database_id):
|
def get_all_data_from_database(self, database_id):
|
||||||
|
1
main.py
1
main.py
@ -11,6 +11,7 @@ if __name__ == "__main__":
|
|||||||
parser.add_argument("--table_ids", help="IDs of the Baserow tables you want to fetch data from, separated by commas.", default=None)
|
parser.add_argument("--table_ids", help="IDs of the Baserow tables you want to fetch data from, separated by commas.", default=None)
|
||||||
parser.add_argument("--matrix", action="store_true", help="Merge tables based on references.")
|
parser.add_argument("--matrix", action="store_true", help="Merge tables based on references.")
|
||||||
parser.add_argument("-v", "--verbose", action="store_true", help="Enable verbose mode for debugging.")
|
parser.add_argument("-v", "--verbose", action="store_true", help="Enable verbose mode for debugging.")
|
||||||
|
parser.add_argument("--linked_fields", action="store_true", help="Outputs the linked tables")
|
||||||
parser.add_argument("--quiet", action="store_true", help="Suppress output of json")
|
parser.add_argument("--quiet", action="store_true", help="Suppress output of json")
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
Loading…
Reference in New Issue
Block a user