Python

August 3rd, 2024suno

가사

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)

추천

Исчезающий (Fading Away)
Исчезающий (Fading Away)

witch house, sad, sovietwave, powerful, airy female singer,

Es ist nicht mehr wie früher
Es ist nicht mehr wie früher

pop nostalgisch akustisch

Tota
Tota

Child, lo-fi

পল্টিবাজ
পল্টিবাজ

experimental hip hop,rap, hip hop,power metal

الشلحة
الشلحة

الشعبي مغربية

Rok v roki
Rok v roki

folk melodious acoustic

🌟 Colorful Symphony 🌟
🌟 Colorful Symphony 🌟

Mezzo voice, C major, 100 BPM, 3/4 time, folk waltz, acoustic traditional guitar, rich, warm with flutes, mellow syncope

Neon Nights
Neon Nights

electro-pop, Upbeat, Lofi-infused Anime Trap with Hard-hitting Bass, Energetic and Aggressive

Shattered Echoes
Shattered Echoes

post-punk progressive rock depressive black metal gothic rock

Star
Star

beat, rap, hip hop, bass, upbeat, male voice

花火の祭り(ヒュードン)
花火の祭り(ヒュードン)

funky shamisen vocaloid duet miku voice taiko drums

In the Shadows of Night City
In the Shadows of Night City

cyberpunk, bass, beats, rap, horror

Hi-Speed
Hi-Speed

rock aggressive electric

Embrace My Love
Embrace My Love

Female singer Ballad song K-POP emo  Slow song 

आकाश भाई
आकाश भाई

beat, synth, edm

Heartbeat Spectrum
Heartbeat Spectrum

instrumental,instrumental,rock,melodic,indie pop,pop,bittersweet,uplifting,sentimental,energetic,pop rock,synthpop,optimistic

hunting with you
hunting with you

country, acoustic, 90s