Furnidata and SQL Generator

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 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:
I would like to give credits to and his work: 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:

React

Member
Sep 17, 2023
339
189
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 items_base table.
catalog_items_sql.txt - SQL INSERT statements for your catalog_items table. (**Take note that the default cost for the furni added would be 50duckets)

**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)
starting_id = <your items_base starting id>
page_id = <the page_id you want to add the furni to>
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. Always remember to backup your db files before running any generated SQL scripts!

Link to the GitHub Repo:

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
Great to see positive releases when it comes to helping others in the community/making life easier.

I’ll have a proper look when I jump on PC but definitely good going and thanks for sharing!
 

Puffin

Posting Freak
Mar 17, 2018
511
451
Great release :D
Only thing id suggest is to add the cost to your config file instead of it defaulting to 50 duckets
 

Sullivan

New Member
Feb 12, 2018
12
5
You can use the catalogue making tools I made a few years ago. Which I can see this guy starred the exact repo of my catalogue generator from my github roughly around the time he released this project. Not sure if he used my code to create this or not but if he did I think giving some credit to my work if he used my code or was influenced by it; It would be appreciated... As the timing of him adding this post and starring my project on github align impeccably around the same hours, and his code is doing what my code does already in my project.

You must be registered for see images attach

For those who want access to proper catalogue making tools here is my github.
 
Last edited:

gergerger

New Member
Jan 26, 2022
3
6
Great release :D
Only thing id suggest is to add the cost to your config file instead of it defaulting to 50 duckets
Thanks for the feedback, I'll edit the codes when I have time!
Post automatically merged:

You can use the catalogue making tools I made a few years ago. Which I can see this guy starred the exact repo of my catalogue generator from my github roughly around the time he released this project. Not sure if he used my code to create this or not but if he did I think giving some credit to my work if he used my code or was influenced by it; It would be appreciated... As the timing of him adding this post and starring my project on github align impeccably around the same hours, and his code is doing what my code does already in my project.

You must be registered for see images attach

For those who want access to proper catalogue making tools here is my github.
Hi, thanks for reaching out! I can assure you that I didn't use or take anything from your repository. I was actually inspired by another different project altogether and it was written in C# (as you can see my scripts are kinda structured similar to the repository below.) I understand the timing might seem aligned, but if there are any similarities, it's coincidental.
Just to point out: My code actually pulls data from the respective .nitro furnifiles and generate them into furnidata.json and also SQL queries for the database. And also a config.txt file to make it sort of dynamic as I came across the issue of differing cata and item ids myself. That said, I respect the work you've done and appreciate your contributions to the community!

I apologise for this oversight, but credit to benjobas who gave me the inspiration:


P.S. I put this up so people can use the script also, I do not receive any monetary gains or whatsoever. Just to remind again: I coded this for the sandbox I was working on so I could add furnitures easily.
 
Last edited:

Users who are viewing this thread

Top