Details
-
Type: Task
-
Status: Closed (View Workflow)
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:
-
Story Points:2
-
Epic Link:
-
Sprint:Spring 2019 Sprint 2, Spring 2019 Sprint 3, Spring 2019 Sprint 4
Description
Write script (python) that reads relevant App information from OBR XML file "repository.xml" and imports data about Apps into App Store database.
Specification:
- Read XML, compare contents to database
- Identify Apps via defining "coordinates" - bundle (App) version and symbolic name
- If an App in XML also exists in database, check that the information contained in the XML matches what is in the database. If there is a difference, update it. Only compare relevant fields.
Note: The database will contain info about Apps that is not in the XML, such as number of downloads, details about the authors, etc. Leave that stuff intact.
- If an App in XML does not exist in the database, create new records for it in the database.
Note that this script can update information about Apps and can also add entirely new Apps to the database.
Implementation: Write this in python. Run/test on EC2. Can assume database is MySQL.
Branch : https://bitbucket.org/svallapu/appstore-charan/branch/IGBF-1568
parseRepositoryXML.py file does the following things:
1. takes input from the user (host address, username, password, and database name)
2. Reads the XML file.
3. Copy content from XML file to string to replace "&" with "&". It is because XML parser gave an exception when parsing ampersand(&).
4. Gets the required content from the XML file using the elementTree parser and stores them in variables.
5. Modify the variables to remove exception in the app store. It creates a row when there is no data. It updates the row when there is data.
6. Connects to Mysql RDS database and stores the data.
Database details:
database : testdjango
table name : apps_app
base64 Parser should be used to decode the details field in the database
Example:
import base64
details = base64.b64decode(details)