gergerger
New Member
- Jan 26, 2022
- 3
- 6
Hi, recently I made a python script to generate furnidata and SQL for adding furnitures to your hotel. I kinda made it for the sandbox I'm working on, and since it's handy for me, I'd like to share it here for everyone else to use if they ever need it. There might be some hotels out there without the "Adding furniture" feature in their Housekeeping, so this would come in handy.
Furnidata.json & SQL Generator
The python script automates the process of generating the following:
furnidata.txt - furnidata.json entries for all the new items that you are adding.
items_base_sql.txt - SQL INSERT statements for your
catalog_items_sql.txt - SQL INSERT statements for your
**The output folder for these .txt files will be automatically created for you.
Things you should know:
1. You will need Python 3.x installed in order to run this script.
2. I understand that the catalog_ids and item_ids may differ, so I have coded the script in a way where you can set them respectively. You can edit these values in the config.txt.
nitro_path = <the path to the .nitro furni files> (e.g. C:\Users\ger\Desktop\furnidata generator\furni)
page_id = <the page_id you want to add the furni to>
starting_id = <your items_base starting id>
starting_cata_id = <your catalog_items starting id>
The "starting_id" and "starting_cata_id" would have auto-increment so you do not have to change it the next time you use this script. It will store the latest ids in the config.txt. So you can safely rerun the script with new .nitro files.
The "page_id" is static and will not change so you would have to change it if you're adding furniture to different catalogue pages.
3. You will be able to configure the costs of your furnitures for the
cost_credits = Credit cost of your furniture.
cost_points = Point cost of your furniture.
points_type = Points type for furniture. (0 = duckets, 5 = diamonds OR your own currency point value if applicable.)
4. Always remember to backup your db files before running any generated SQL scripts!
Link to my GitHub Repo:
I would like to give credits to
.
P.S. I apologise if I didn't explain this clearly as it is my first DevBest post xD
Images below for your reference if you are unclear:
Furnidata.json & SQL Generator
The python script automates the process of generating the following:
furnidata.txt - furnidata.json entries for all the new items that you are adding.
items_base_sql.txt - SQL INSERT statements for your
items_base
table.catalog_items_sql.txt - SQL INSERT statements for your
catalog_items
table. **The output folder for these .txt files will be automatically created for you.
Things you should know:
1. You will need Python 3.x installed in order to run this script.
2. I understand that the catalog_ids and item_ids may differ, so I have coded the script in a way where you can set them respectively. You can edit these values in the config.txt.
nitro_path = <the path to the .nitro furni files> (e.g. C:\Users\ger\Desktop\furnidata generator\furni)
page_id = <the page_id you want to add the furni to>
starting_id = <your items_base starting id>
starting_cata_id = <your catalog_items starting id>
The "starting_id" and "starting_cata_id" would have auto-increment so you do not have to change it the next time you use this script. It will store the latest ids in the config.txt. So you can safely rerun the script with new .nitro files.
The "page_id" is static and will not change so you would have to change it if you're adding furniture to different catalogue pages.
3. You will be able to configure the costs of your furnitures for the
catalog_items
table. **I added this, thanks to Puffin's suggestion.cost_credits = Credit cost of your furniture.
cost_points = Point cost of your furniture.
points_type = Points type for furniture. (0 = duckets, 5 = diamonds OR your own currency point value if applicable.)
4. Always remember to backup your db files before running any generated SQL scripts!
Link to my GitHub Repo:
You must be registered for see links
I would like to give credits to
You must be registered for see links
and his work:
You must be registered for see links
for inspiring me into this 
P.S. I apologise if I didn't explain this clearly as it is my first DevBest post xD
Images below for your reference if you are unclear:
You must be registered for see images attach
You must be registered for see images attach
You must be registered for see images attach
You must be registered for see images attach
Last edited: