<prompt> Andika programu ya Python inayotumia mfumo wa wavuti wa CherryPy kuunda API rahisi ya REST yenye ncha za kuunda, kusoma, kusasisha, na kufuta rekodi katika hifadhidata ya SQLite.  <response>: Kwanza, unahitaji kusakinisha CherryPy na SQLite3 kwa kutumia bomba:bashibomba kufunga cherrypySasa wacha tuunde API rahisi ya REST na CherryPy na SQLite3. chatukuagiza oskuagiza sqlite3kuagiza jsonkuagiza cherrypyDB_NAME my_database.dbdef setup_database: conn sqlite3.connectDB_NAME c conn.cursor c.tekelezaUNDA JEDWALI IKIWA HAIPO rekodi id INTEGER PRIMARY PRIMARY KEY AUTOINCREMENT, data TEXT conn.commit conn.closedarasa la MyAPI: cherrypy.fichua cherrypy.tools.json_out def indexbinafsi: return message: Karibu kwenye REST API cherrypy.fichua cherrypy.tools.json_out def kuunda binafsi, data: conn sqlite3.connectDB_NAME c conn.cursor c.tekelezaINGIZA rekodi data THAMANI ?, data, conn.commit rekodi_id c.lastrowid conn.close rudisha record_id: record_id cherrypy.fichua cherrypy.tools.json_out def readself, record_idNone: conn sqlite3.connectDB_NAME c conn.cursor ikiwa record_id ni Hakuna: c.executeCHAGUA KUTOKA rekodi result id: safu0, data: safu1 kwa safu mlalo katika c.fetchall kwingine: c.executeCHAGUA KUTOKA rekodi WAPI id?, kitambulisho_cha_rekodi, safu c.fetchone ikiwa safu hakuna: result error: Rekodi haijapatikana kwingine: result id: safu0, data: safu1 conn.close matokeo ya kurudi cherrypy.fichua cherrypy.tools.json_out def update binafsi, rekodi_id, data: conn sqlite3.connectDB_NAME c conn.cursor c.executeSASISHA rekodi SET data? WAPI id?, data, record_id ikiwa c.rowcount 0: result error: Rekodi haijapatikana kwingine: matokeo record_id: record_id conn.commit conn.close matokeo ya kurudi cherrypy.fichua cherrypy.tools.json_out def deletebinafsi, record_id: conn sqlite3.connectDB_NAME c conn.cursor c.executeFUTA KUTOKA rekodi WAPI id?, kitambulisho_cha_rekodi, ikiwa c.rowcount 0: result error: Rekodi haijapatikana kwingine: matokeo deleted_record_id: record_id conn.commit conn.close matokeo ya kurudikama __name__ __main__: setup_database cherrypy.quickstartMyAPI, , configNoneNambari hii inaunda API rahisi ya REST na CherryPy na SQLite3. Mwisho ni:- : Ujumbe wa kukaribisha- create?datayour_data_here: Unda rekodi mpya kwa data uliyopewa- soma: Soma rekodi zote- soma?record_idid_here: Soma rekodi mahususi kwa kitambulisho- update?record_idid_heredatanew_data_here: Sasisha data ya rekodi kwa kitambulisho- delete?record_idid_here: Futa rekodi kwa kitambulisho 