Fragrance-Index is a Python-based tool for managing and organizing fragrance information. It allows users to process fragrance images, retrieve note information, and store the data in both a local JSON store and as individual Markdown files compatible with Obsidian.
- Recognize fragrances from images
- Retrieve fragrance notes using an API
- Save fragrance information to a local JSON store
- Generate Markdown files for each fragrance, compatible with Obsidian
- Process bulk fragrance lists from a file
- Utilize local caching to reduce API calls
To use the script from the command line:
-
Ensure you have a text file with a list of fragrances, one per line.
-
Run the script with the path to your fragrances file:
python src/fragrance_index/main.py --path path/to/your/fragrances.txtReplace
path/to/your/fragrances.txtwith the actual path to your file. -
The script will process each fragrance in the file:
- If the fragrance is already in the local store, it will use the cached data.
- If not, it will fetch the fragrance notes from the API and save them to the local store.
- For each fragrance, it will create a Markdown file in the
mapped_fragrancesdirectory.
-
After processing, you'll find:
- Updated
fragrance_store.jsonwith any new fragrances - New or updated Markdown files in the
mapped_fragrancesdirectory
- Updated
This method is efficient for processing multiple fragrances at once, especially if you have a large list of fragrances to index.
-
Clone this repository:
git clone https://github.com/ParthSareen/Fragrance-Index.git cd Fragrance-Index -
Install the required dependencies:
pip install -r requirements.lock -
Set up your API keys in a
.envfile:OPENAI_API_KEY=your_openai_api_key
-
To process a single fragrance image:
fragrance_index = FragranceIndex() fragrance = fragrance_index.process_and_save_fragrance("path/to/your/image.jpg")
-
To process a list of fragrances from a file:
fragrance_index = FragranceIndex() fragrance_index.run_bulk_fragrance_saving("path/to/your/fragrance_list.txt")
- Fragrance data is saved in a JSON file named
fragrance_store.json - Individual Markdown files for each fragrance are created in the
mapped_fragrancesdirectory - These Markdown files can be used with Obsidian for linking and graph visualization
-[] structure jsons better -[] mongodb -[] build simple graph connection UI (reactflow?)
