Skip to main content

Smart Babylon Library. A deterministic infinite library generator. Generate unique, deterministic books and pages based on coordinate systems without storing any data.

Project description

Smart Babylon Library v1.0.0

A deterministic infinite library generator inspired by Borges' "The Library of Babel". Generate unique, deterministic books and pages based on coordinate systems without storing any data.


🚧 Project Status: Research & Development

IMPORTANT DISCLAIMER: This project is currently in active research and development phase. It is provided as-is for academic and experimental purposes only. No guarantees of stability, security, or fitness for any particular purpose are provided. Users assume all risks associated with usage.


PyPI Downloads GitHub top language GitHub release (latest by date) GitHub GitHub Repo stars GitHub watchers GitHub forks PyPI - Downloads PyPI PyPI - Format


🚀 Version Information

Current Version: 1.0.0 (New Architecture)

This release represents a complete architectural rewrite with significant improvements:

  • Modular OOP Design - Clean separation of concerns
  • Enhanced Configuration - Flexible LibraryConfig system
  • JSON Serialization - Full object serialization support
  • Type Safety - Improved type hints and validation
  • Research Integration - Implements concepts from published papers

Legacy Version: 0.6.5 (Deprecated)

⚠️ Version 0.6.5 and earlier are no longer supported. The previous monolithic architecture has been replaced by the new modular system. Users of older versions should migrate to 1.0.0+.

Key breaking changes:

  • New import paths and class names
  • Different configuration system
  • Updated coordinate structure
  • Enhanced API with better object model

📚 Related Research Publications

This library implements concepts from our published research:

Features

  • Deterministic Generation: Same coordinates always produce the same content
  • Infinite Library: Virtually unlimited books and pages through coordinate system
  • Zero Storage: Content generated on-demand, nothing stored
  • Configurable: Customize book lengths, page sizes, and character sets
  • JSON Support: Full serialization to JSON format
  • Unicode Support: Cyrillic, Latin, digits, and punctuation

Installation

pip install smart-babylon-library

Quick Start

from smart_babylon_library import SmartBabylonLibrary

# Create library instance
library = SmartBabylonLibrary()

# Get a book by coordinates
book = library.get_book(floor=1, room=3, cabinet=2, shelf=5, book_number=42)

print(f"Book: {book}")
print(f"Title: {book.title}")
print(f"Pages: {book.max_pages}")

# Access specific page
page = book.get_page(0)
print(f"Page content: {page.content}")

Coordinate System

Each item is located using 6-dimensional coordinates:

  • floor: Library floor
  • room: Room number
  • cabinet: Cabinet number
  • shelf: Shelf number
  • book: Book number
  • page: Page number

Configuration

Customize library generation:

from smart_babylon_library import SmartBabylonLibrary, LibraryConfig

# Custom configuration
config = LibraryConfig(
    title_length_range=(10, 100),      # Title length range
    content_length_range=(500, 2000),  # Page content length range  
    pages_per_book_range=(5, 50)       # Pages per book range
)

library = SmartBabylonLibrary(config)

API Reference

SmartBabylonLibrary

Main library class:

  • get_book(floor, room, cabinet, shelf, book_number) - Get book by coordinates
  • get_book_from_dict(coordinates_dict) - Get book from dictionary
  • get_book_json(coordinates_dict) - Get book as JSON string
  • get_page(floor, room, cabinet, shelf, book_number, page) - Get page by coordinates
  • get_page_from_dict(coordinates_dict) - Get page from dictionary
  • get_page_json(coordinates_dict) - Get page as JSON string

LibraryBook

Book class with properties:

  • title - Book title (generated)
  • max_pages - Total pages in book
  • coordinates - Book coordinates
  • get_page(page_number) - Get specific page
  • to_dict() - Convert to dictionary
  • to_json() - Convert to JSON

LibraryPage

Page class with properties:

  • content - Page content (generated)
  • page_number - Page number
  • coordinates - Page coordinates
  • to_dict() - Convert to dictionary
  • to_json() - Convert to JSON

Examples

Basic Usage

from smart_babylon_library import SmartBabylonLibrary

library = SmartBabylonLibrary()
book = library.get_book(1, 2, 3, 4, 5)

# Access book properties
print(f"Title: {book.title}")
print(f"Total pages: {book.max_pages}")

# Read pages
for page_num in range(min(3, book.max_pages)):
    page = book.get_page(page_num)
    print(f"Page {page_num}: {page.content[:50]}...")

JSON Serialization

# Get book as JSON
book_json = library.get_book_json({
    'floor': 1, 'room': 1, 'cabinet': 1, 
    'shelf': 1, 'book': 1, 'page': 0
})

# Get page as JSON  
page_json = library.get_page_json({
    'floor': 1, 'room': 1, 'cabinet': 1,
    'shelf': 1, 'book': 1, 'page': 42
})

Custom Configuration

from smart_babylon_library import SmartBabylonLibrary, LibraryConfig

# For short documents
short_config = LibraryConfig(
    title_length_range=(5, 50),
    content_length_range=(100, 500),
    pages_per_book_range=(1, 10)
)

# For long novels  
novel_config = LibraryConfig(
    title_length_range=(10, 100),
    content_length_range=(1000, 5000), 
    pages_per_book_range=(50, 200)
)

short_library = SmartBabylonLibrary(short_config)
novel_library = SmartBabylonLibrary(novel_config)

Character Sets

Library supports multiple character sets:

  • Cyrillic alphabet (upper and lower case)
  • Latin alphabet (upper and lower case)
  • Digits (0-9)
  • Punctuation and symbols

Deterministic Behavior

Content generation is deterministic based on coordinates:

# Same coordinates = same content
book1 = library.get_book(1, 1, 1, 1, 1)
book2 = library.get_book(1, 1, 1, 1, 1)

assert book1.title == book2.title
assert book1.get_page(0).content == book2.get_page(0).content

⚠️ Important Legal Notice

NO WARRANTY: This software is provided for academic and research purposes only. The authors make no warranties, express or implied, regarding the software's functionality, security, or fitness for any purpose. Users assume all responsibility and risk for use.

RESEARCH STATUS: This implementation is part of ongoing research into deterministic systems and pointer-based architectures. It should not be used in production environments or for any critical applications.

License

BSD 3-Clause License

GitHub

https://github.com/smartlegionlab/smart-babylon-library

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smart_babylon_library-1.0.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smart_babylon_library-1.0.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file smart_babylon_library-1.0.0.tar.gz.

File metadata

  • Download URL: smart_babylon_library-1.0.0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for smart_babylon_library-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9db39c019766c87bc40d0e35ad9db5f795048edad5e7941f2f02b2499c1be0ac
MD5 09493cc36fd77e2aeb414716017c2f61
BLAKE2b-256 d0506cfcd6cdc202aaf45272d3c61906b7b0e7bf3fa828278d406f3fdac1d77a

See more details on using hashes here.

File details

Details for the file smart_babylon_library-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for smart_babylon_library-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63357ff6fed5de3d5fa009762611eecb01e5dd7eb12912e92c51b60bd15ff3fa
MD5 b72dd473415b327dea7cfeb72b0f07f9
BLAKE2b-256 990b5ba60dd694165604e65d310a3353ddb5f472abc431285cfd67387e5e72ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page