Skip to content

Deja is an indexed, hierarchical data structure designed for efficient categorization and retrieval of data. It enables structured storage using a dictionary-based mapping, where each entry is assigned a unique index, allowing systematic organization and quick access.

License

Notifications You must be signed in to change notification settings

abde1khaliq/deja

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deja: A Hierarchical Data Structure for Organized Storage

📌 Overview

Deja is an indexed, hierarchical data structure designed for efficient categorization and retrieval of data. It enables structured storage using a dictionary-based mapping, where each entry is assigned a unique index, allowing systematic organization and quick access.

Features

  • Indexed Storage – Organizes data efficiently using unique indexes.
  • Flexible Management – Easily add, update, and remove categories.
  • Error Handling – Prevents duplicate entries and invalid operations.
  • Efficient Deletion – Supports category-based and index-based removal

Usage/Examples

from deja import Deja

# Initialize Deja instance
ds = Deja()

# Add categories with items
ds.add("Fruit", ["Apple", "Banana", "Mango"])
ds.add("Dairy", ["Milk", "Cheese"])
ds.add("Tech", ["Laptop", "Phone"])
ds.add("Movies", ["Inception", "Interstellar"])
ds.display()  # Show current structure

# Find a category
print(ds.find_category("Tech"))

# Rename a category
print(ds.rename_category("Movies", "Films"))
ds.display()  # Verify renaming worked

# Update an item within a category
print(ds.update_item("Fruit", "Banana", "Blueberry"))
ds.display()  # Verify update

# Remove a category by name
ds.removeby_cat("Dairy")
ds.display()  # Verify removal

# Remove an item by index and reindex
ds.removeby_idx(0)  # Remove "Fruit"
ds.display()  # Verify reindexing

❓ Frequently Asked Questions (FAQ)

🔹 What is Deja?

Deja is a hierarchical, index-driven data structure that organizes information efficiently, allowing structured storage and quick retrieval.

🔹 How does Deja store data?

Each entry is mapped to an index, with categories acting as keys containing associated item lists. This allows precise lookups and modifications.

🔹 Can I remove items by category or index?

Yes! Deja supports removal by category name and removal by index, giving flexibility when managing stored data.

🔹 Does Deja prevent duplicate categories?

Yes. If a category already exists, Deja raises an error to maintain structured storage.

🔹 Is Deja suitable for large-scale applications?

Yes! While lightweight, it can be expanded for sorting, searching, serialization, and persistent storage.

❓ Support

If you encounter issues, feel free to open an issue or reach out in discussions.

License

MIT

About

Deja is an indexed, hierarchical data structure designed for efficient categorization and retrieval of data. It enables structured storage using a dictionary-based mapping, where each entry is assigned a unique index, allowing systematic organization and quick access.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages