Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.
/ upgraded-engine Public archive

Flask CLI application that serializes table data into XML using

Notifications You must be signed in to change notification settings

steekam/upgraded-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XML Assignment

A simple Flask "CLI" application that serializes data from the database

Project Setup

Install depencies

pip install

The application comes with several flask CLI helper commands to help setup the project for the demo.

  • flask migrate : Creates a db.sqlite database file and creates a student table.
  • flask seed-students <COUNT> : Seeds student records.
  • flask refresh : Drops all tables and creates the schema again.
  • flask export-students : Exports student records to student.xml file.
  • flask deserialize : Deserialize data in student.xml file into Student objects.

Demo

  • Install dependencies
  • Copy .env.example to .env
  • Migrate schema
flask migrate
  • Seed 10 student records
flask seed-students 10
  • Export xml data
flask export-students

Sample XML output

<?xml version="1.0" ?>
<students>
	<student>
		<id>1</id>
		<student_number>26</student_number>
		<first_name>Mariah</first_name>
		<last_name>Kelly</last_name>
		<email>[email protected]</email>
	</student>
	<student>
		<id>2</id>
		<student_number>94</student_number>
		<first_name>Donna</first_name>
		<last_name>Nash</last_name>
		<email>[email protected]</email>
	</student>
	<student>
		<id>3</id>
		<student_number>58</student_number>
		<first_name>Brittany</first_name>
		<last_name>Ramirez</last_name>
		<email>[email protected]</email>
	</student>
</students>

About

Flask CLI application that serializes table data into XML using

Topics

Resources

Stars

Watchers

Forks