I recently discovered this awesome Python Baserow API client library and I wanted to share it here. You can use it to easily query your tables via the REST API.
from baserow.client import BaserowClient
client = BaserowClient('https://baserow.io', jwt='...')
for db in client.list_all_applications():
print(db, [t.name for t in db.tables])
for table in client.list_database_tables(13):
print(table)
is_john_smith = Column('field_281').equal('John Smith')
page = client.list_database_table_rows(45, filter=[is_john_smith])
print(page.results)
client.create_database_table_row(45, {
'field_281': 'Alice Doe',
'field_293': 'alice@doe.org',
})
Could create an api server in python with this library, that’s amazing. Then I use axios or express in native react and so I have a version of baserow mobile; D
mvc
from baserow.client import BaserowClient
client = BaserowClient('https://baserow.io', jwt='...')
def listAllApplications():
for db in client.list_all_applications():
print(db, [t.name for t in db.tables])
def listDatabaseTables(idUser): #id=>13
for table in client.list_database_tables(idUser):
print(table)
def pageResults(field, equalName, rowId):#field 'field_281'|equal => John Smith|rowId: 45
is_john_smith = Column(field).equal(equalName)
page = client.list_database_table_rows(rowId, filter=[is_john_smith])
print(page.results)
def createDatabaseTableRow(idUser, field): # id=> 45
client.create_database_table_row(idUser, {
'field_281': field, # field_281: 'Alice Doe'
})
# my api server restfull localhost inspire in github-api
# https://api.baserow.com/<jwt-token>/listAll
# https://api.baserow.com/<jwt-token>/listAllApplications
# https://api.baserow.com/<jwt-token>/listDatabaseTables
# https://api.baserow.com/<jwt-token>/pageResults
# https://api.baserow.com/<jwt-token>/createDatabaseTableRow
// my api server restfull client in react native/vuejs-native
var listAll = "https://api.baserow.com/<jwt-token>/listAll" // return json(method get)
var listAllApplications = "https://api.baserow.com/<jwt-token>/listAllApplications" // return json(method get)
var listDatabaseTables = "https://api.baserow.com/<jwt-token>/listDatabaseTables/idUser" // return json(method get)
var pageResults = "https://api.baserow.com/<jwt-token>/pageResults/field/equalName/rowId" // return json(method get)
var createDatabaseTableRow = "https://api.baserow.com/<jwt-token>/createDatabaseTableNow/idUser/field" // return json(method post)
That is something that you can do @anon7289648, but my first question would be why you would want to have a proxy between Baserow and your mobile version of Baserow? Would it not be more efficient to have your mobile version connect directly to the Baserow API?
To facilitate the support, the adoption of baserow, I thought of doing something like an sdk - software development kit. I think this library could make this implementation easy.
use cases
The json format is present in many programming languages, as well as the template engine html called mustache.
And if we had a python library that generates the api code in various programming languages, would that make things easier?
In the baserow api part, there are 3 options: python, javascript and it has the curl option.
idea
create baserow api(desktop, mobile or web?) = “create react app”