Python

August 3rd, 2024suno

Lyrics

from flask import Flask, request, jsonify from flask_sqlalchemy import SQLAlchemy from flask_cors import CORS app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///functions.db' db = SQLAlchemy(app) CORS(app) class Function(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(100), nullable=False) description = db.Column(db.String(200), nullable=False) language = db.Column(db.String(100), nullable=False) with app.app_context(): db.create_all() @app.route('/api/functions', methods=['GET']) def get_functions(): functions = Function.query.all() results = [ { 'id': func.id, 'name': func.name, 'description': func.description, 'language': func.language } for func in functions ] return jsonify(results) @app.route('/api/functions/search', methods=['GET']) def search_functions(): query = request.args.get('query', '') language = request.args.get('language', '') functions = Function.query.filter( Function.description.ilike(f'%{query}%'), Function.language.ilike(f'%{language}%') ).all() results = [ { 'id': func.id, 'name': func.name, 'description': func.description, 'language': func.language } for func in functions ] return jsonify(results) @app.route('/api/functions', methods=['POST']) def add_function(): data = request.get_json() if 'name' not in data or 'description' not in data or 'language' not in data: return jsonify({'error': 'Bad Request', 'message': 'Missing name or description or language'}), 400 new_function = Function(name=data['name'], description=data['description'], language=data['language']) db.session.add(new_function) db.session.commit() return jsonify({'message': 'Function added'}), 201 @app.route('/api/functions/<int:id>', methods=['DELETE']) def delete_function(id): function = Function.query.get_or_404(id) db.session.delete(function) db.session.commit() return jsonify({'message': 'Function deleted'}) if __name__ == '__main__': app.run(debug=True)

Recommended

Spiral
Spiral

Operatic progressive gothic metal female voice with epic instrumental intro

Hallucinating
Hallucinating

ethereal rhythmic pop

In the Twilight's Embrace
In the Twilight's Embrace

mellow poetic pop

Raiders of Dust
Raiders of Dust

Heavy metal., Power metal, hard rock, rap, scratch, glitch, drum and bass

My Life
My Life

female voice, rock, guitar, piano, ballad

《猗窩座的微笑》_RC01
《猗窩座的微笑》_RC01

Hard rock, Heldentenor

На крыше мира
На крыше мира

psychedelic indie

Synthetic Goodbyes
Synthetic Goodbyes

instrumental,instrumental,instrumental,instrumental,instrumental,electronic,downtempo,synth-pop,chillout,rhythmic,nocturnal,atmospheric,hypnotic,soothing,mellow,melodic,melancholic

不曾错过
不曾错过

Pop, Melancholic Ballad, Reflective, Piano and Guitar, Love and Loss, Haunting female vocals and soulful male vocals

There Is No Way I Can Live Without You
There Is No Way I Can Live Without You

fingerpicked guitar, and a steady tambourine rhythm. deep, heartfelt male vocals., raw instrumentation with organ swells, gospel blues, soulful

Pela luz dos olhos teus
Pela luz dos olhos teus

beat, rap, funk, trap, pop, female singer, female vocals, dramatic, drill, funk brasil, male vocals, aggressive

Spooky Night
Spooky Night

synth eerie pop

teman se indonesia
teman se indonesia

progressive rock

Descent into Echoes
Descent into Echoes

rock,pop rock,pop,electronic,melodic,atmospheric,lush,anxious,folk pop

Brewing Suno Songs
Brewing Suno Songs

Witch Talk, Halloween, Funny, Spoken, Smoky Female Vocals, Dramatic, Witch, Spooky

大仏よ
大仏よ

drone,deep,Overtone,Drone, male voice,Throat Singing,drone,overtones, afrocelt,Native Chanting,atmospheric

The shadows approach
The shadows approach

Slow start, Epic orchestral, Eletronic horror, Electro, Bass, Hard rock, Distorded, industrial, Gregorian chant

Das Erste und das Letzte Licht
Das Erste und das Letzte Licht

rock,metal,elektro,neue deutsche härte,mänlicher gesang