Skip to content

JSON data filter and IPN generator is a Python program that filters items from a JSON file based on a user-specified category name and generates a sequence of unique internal reference numbers (IPN) for the filtered items.

License

Notifications You must be signed in to change notification settings

superbeppe98/json-data-filter-and-IPN-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON-data-filter-and-IPN-generator

JSON data filter and IPN Generator is a Python program that filters items from a JSON file based on a user-specified category name and generates a sequence of unique internal reference numbers (IPN) for the filtered items.

Installation

To use JSON data filter and IPN generator, you need to have Python 3 installed on your system. No additional dependencies are required.

Usage

To use JSON data filter and IPN generator, you need to provide a JSON file named "input.json" that contains a list of items to filter and generate IPNs for. The items in the file should have a "Category Name" attribute that specifies their category. Once you have the file ready, you can run the program by navigating to the directory where the program is stored and running the following command:

$ python3 json-data-filter-and-IPN-generator.py

This will prompt you to enter a category name to filter the items by. Once you have entered the category name, the program will filter the items that belong to that category and output the number of extracted items. The filtered items will be stored in a temporary file named "temp.json".

Next, the program will prompt you to enter a desired IPN length, a prefix for the IPNs, and the number of sequential numbers to generate. Based on these inputs, the program will generate a sequence of unique IPNs with the specified prefix and sequential numbers. The generated IPNs will be assigned to the filtered items in the temporary file.

Finally, the program will write the updated JSON content to a new file named "output.json". You can view the output file to see the filtered items with their new IPNs.

Note

The example "input.json" file used in this script is generated by Inventree, an open-source inventory management system. You can learn more about Inventree on its GitHub repository.

About

JSON data filter and IPN generator is a Python program that filters items from a JSON file based on a user-specified category name and generates a sequence of unique internal reference numbers (IPN) for the filtered items.

Topics

Resources

License

Stars

Watchers

Forks

Languages