danielutils


Namedanielutils JSON
Version 1.0.46 PyPI version JSON
download
home_pageNone
SummaryA python utils library for things I find useful
upload_time2025-07-08 14:51:02
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8.0
licenseMIT License Copyright (c) 2022 danielnachumdev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Python package](https://github.com/danielnachumdev/danielutils/actions/workflows/python-package.yml/badge.svg)](https://github.com/danielnachumdev/danielutils/actions/workflows/python-package.yml)
[![Pylint](https://github.com/danielnachumdev/danielutils/actions/workflows/pylint.yml/badge.svg)](https://github.com/danielnachumdev/danielutils/actions/workflows/pylint.yml)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![gitleaks](https://github.com/danielnachumdev/danielutils/actions/workflows/gitleaks.yml/badge.svg)](https://github.com/danielnachumdev/danielutils/actions/workflows/gitleaks.yml)
[![CodeQL](https://github.com/danielnachumdev/danielutils/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/danielnachumdev/danielutils/actions/workflows/github-code-scanning/codeql)

# danielutils v1.0.46

A comprehensive Python utilities library designed to enhance your development workflow with powerful tools for type safety, async programming, database operations, and much more.

**Features:**
- 🎯 **Type Safety**: Advanced type checking, validation, and typed collections
- ⚡ **Async Support**: Comprehensive async utilities and worker pools
- 🗄️ **Database Abstractions**: Multi-backend database support (SQLite, Redis, In-Memory)
- 🔄 **Retry Logic**: Configurable retry executors with multiple backoff strategies
- 📊 **Data Structures**: Enhanced collections, graphs, heaps, and algorithms
- 🎨 **Developer Experience**: Progress bars, logging, reflection, and debugging tools
- 🧮 **Academic Tools**: Probability theory and statistical functions

**Tested Python versions**: `3.8.0+`, `3.9.0`, `3.10.13`

> **Note**: This package is actively developed and subject to change. Use at your own risk!

## 🚀 Quick Start

```python
from danielutils import isoftype, validate, tlist
from danielutils.abstractions.db import DatabaseFactory
from danielutils.abstractions.db.database_definitions import TableSchema, TableColumn, ColumnType

# Type-safe list with runtime validation
numbers = tlist[int]([1, 2, 3, 4, 5])

# Function validation
@validate
def greet(name: str, age: int) -> str:
    return f"Hello {name}, you are {age} years old"

# Database operations
db = DatabaseFactory.get_database("memory")  # In-memory database
with db:
    # Create a table
    schema = TableSchema(
        name="users",
        columns=[
            TableColumn(name="id", type=ColumnType.AUTOINCREMENT, primary_key=True),
            TableColumn(name="name", type=ColumnType.TEXT, nullable=False),
            TableColumn(name="age", type=ColumnType.INTEGER)
        ]
    )
    db.create_table(schema)
    
    # Insert data
    user_id = db.insert("users", {"name": "Alice", "age": 30})

# Advanced type checking
if isoftype(numbers, list[int]):
    print("Numbers is a list of integers!")
```

## 📚 Documentation

In the [`./READMES/`](./READMES/) folder you can find detailed documentation for key features:

### Core Features

#### [`isoftype`](./READMES/isoftype.md)
**Advanced Type Checking System**
- Runtime type validation with support for complex types
- Parametrized generics and union types
- Protocol and interface checking
- Enhanced type safety for your applications

#### [`@overload`](./READMES/overload.md)
**Function Overloading Made Easy**
- Manage multiple function signatures
- Type-safe function overloading
- Simplified API design with clear type hints

#### [`@validate`](./READMES/validate.md)
**Runtime Type Validation**
- Protect your functions with automatic argument validation
- Catch type-related errors early
- Enhanced debugging and error messages

#### [`tlist`](./READMES/tlist.md)
**Type-Safe Collections**
- Runtime type validation for lists
- Enhanced list operations with type safety
- Seamless integration with existing code

#### [`Interface`](./READMES/Interface.md)
**Python Interface Implementation**
- Create interface-like behavior using metaclasses
- Abstract class patterns
- Enhanced object-oriented programming

## 🛠️ Major Features

### Database Abstractions (`@/db`)
```python
from danielutils.abstractions.db import DatabaseFactory
from danielutils.abstractions.db.database_definitions import (
    TableSchema, TableColumn, ColumnType, SelectQuery, WhereClause, Condition, Operator
)

# Get different database backends
sqlite_db = DatabaseFactory.get_database("sqlite", db_kwargs={"db_path": "test.db"})
memory_db = DatabaseFactory.get_database("memory")

# Create table schema
schema = TableSchema(
    name="products",
    columns=[
        TableColumn(name="id", type=ColumnType.AUTOINCREMENT, primary_key=True),
        TableColumn(name="name", type=ColumnType.TEXT, nullable=False),
        TableColumn(name="price", type=ColumnType.FLOAT),
        TableColumn(name="category", type=ColumnType.TEXT)
    ]
)

# Use database with context manager
with memory_db:
    memory_db.create_table(schema)
    
    # Insert data
    product_id = memory_db.insert("products", {
        "name": "Laptop",
        "price": 999.99,
        "category": "Electronics"
    })
    
    # Query data
    query = SelectQuery(
        table="products",
        where=WhereClause(
            conditions=[
                Condition(column="category", operator=Operator.EQ, value="Electronics")
            ]
        )
    )
    results = memory_db.get(query)
```

### Async Programming
```python
import asyncio
from danielutils.async_ import AsyncWorkerPool, AsyncLayeredCommand

async def process_item(item: str) -> None:
    """Async function to process items"""
    await asyncio.sleep(0.1)  # Simulate work
    print(f"Processed: {item}")

async def main():
    # Async worker pool
    pool = AsyncWorkerPool("data_processor", num_workers=3, show_pbar=True)
    await pool.start()
    
    # Submit tasks
    items = ["item1", "item2", "item3", "item4", "item5"]
    for item in items:
        await pool.submit(process_item, args=(item,), name=f"process_{item}")
    
    # Wait for completion
    await pool.join()
    
    # Async command execution
    async with AsyncLayeredCommand("echo") as cmd:
        result = await cmd.execute("Hello from async command")
        print(f"Command output: {result}")

# Run the async example
asyncio.run(main())
```

### Retry Executors
```python
from danielutils.retry_executor import RetryExecutor
from danielutils.retry_executor.backoff_strategies import ExponentialBackOffStrategy

def unreliable_function() -> str:
    """Function that might fail"""
    import random
    if random.random() < 0.7:  # 70% chance of failure
        raise ValueError("Random failure")
    return "Success!"

# Create retry executor with exponential backoff
backoff = ExponentialBackOffStrategy(initial=1000)  # 1 second initial delay
executor = RetryExecutor(backoff_strategy=backoff)

# Execute with retry logic
result = executor.execute(unreliable_function, max_retries=3)
if result:
    print(f"Function succeeded: {result}")
else:
    print("Function failed after all retries")
```

### Data Structures
```python
from danielutils.data_structures import Graph, MinHeap, PriorityQueue
from danielutils.better_builtins import tlist, tdict
from typing import Any
from danielutils.data_structures.graph import MultiNode

# Type-safe collections
users = tlist[str](["alice", "bob", "charlie"])
config = tdict[str, Any]({"debug": True, "port": 8080})

# Advanced data structures
graph = Graph()
node_a = MultiNode("A")
node_b = MultiNode("B")
node_a.add_child(node_b)
graph.add_node(node_a)

# Priority queue with custom objects
class Task:
    def __init__(self, name: str, priority: int):
        self.name = name
        self.priority = priority
    
    def __lt__(self, other):
        return self.priority < other.priority

queue = PriorityQueue[Task]()
queue.push(Task("high_priority", 1))
queue.push(Task("low_priority", 3))
queue.push(Task("medium_priority", 2))

# Min heap
heap = MinHeap[int]()
heap.push(5)
heap.push(2)
heap.push(8)
heap.push(1)

print(f"Min value: {heap.peek()}")  # 1
```

### Progress Tracking
```python
from danielutils.progress_bar import ProgressBarPool, AsciiProgressBar

# Single progress bar
with AsciiProgressBar(range(100), position=0, desc="Processing") as pbar:
    for i in pbar:
        # Do some work
        import time
        time.sleep(0.01)

# Multiple progress bars
with ProgressBarPool(AsciiProgressBar, num_of_bars=2) as pool:
    # Configure individual bars
    pool[0].update(50)  # Update first bar
    pool[1].update(25)  # Update second bar
    
    # Write messages
    pool.write("Processing complete!")
```

### Reflection & Debugging
```python
from danielutils.reflection import FunctionInfo, ClassInfo
from danielutils.reflection.interpreter import is_debugging

def example_function(name: str, age: int = 25) -> str:
    """Example function for reflection"""
    return f"Hello {name}, age {age}"

# Function introspection
info = FunctionInfo(example_function, type)
print(f"Function name: {info.name}")
print(f"Parameters: {info.arguments}")
print(f"Return type: {info.return_type}")

# Class introspection
class ExampleClass:
    def __init__(self, value: int):
        self.value = value
    
    def get_value(self) -> int:
        return self.value

class_info = ClassInfo(ExampleClass)
print(f"Class methods: {[f.name for f in class_info.instance_methods]}")

# Runtime debugging detection
if is_debugging():
    print("Running in debug mode")
```

## 🎓 Academic & Research Tools

### Probability Theory
```python
from danielutils.university.probability import Distribution
from danielutils.university.probability.funcs import expected_value
from danielutils.university.probability.operator import Operator

# Create probability distributions
bernoulli = Distribution.Discrete.Ber(p=0.5)  # Bernoulli with p=0.5
binomial = Distribution.Discrete.Bin(n=10, p=0.3)  # Binomial with n=10, p=0.3

# Calculate probabilities
prob_1 = bernoulli.evaluate(1, Operator.EQ)  # P(X=1)
prob_0 = bernoulli.evaluate(0, Operator.EQ)  # P(X=0)

# Calculate expected values
expected_bernoulli = expected_value(bernoulli)
expected_binomial = expected_value(binomial)

print(f"Bernoulli P(X=1): {prob_1}")
print(f"Bernoulli E[X]: {expected_bernoulli}")
```

## 🔧 Installation

```bash
pip install danielutils
```

## 📈 Project Status

This library has evolved significantly since its initial release in September 2022:

- **2022**: Basic utilities and foundational features (v0.5.x - v0.7.x)
- **2023**: Major development with typed builtins and code quality (v0.8.x - v0.9.x)
- **2024**: Mature library with async support and advanced features (v0.9.x - v1.0.x)
- **2025**: Production-ready with database abstractions and enterprise features (v1.0.x+)

## 🤝 Contributing

Feel free to use, contribute, and improve this code! The project welcomes:

- Bug reports and feature requests
- Code contributions and improvements
- Documentation enhancements
- Test coverage improvements

## 📄 License

This project is licensed under the terms specified in the [LICENSE](./LICENSE) file.

---

**Built with ❤️ for the Python community**

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "danielutils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8.0",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "danielnachumdev <danielnachumdev@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/aa/7f/f8075000bb276b2442ad820dd9830b0a65dc1e231b12693733ed22c0b588/danielutils-1.0.46.tar.gz",
    "platform": null,
    "description": "[![Python package](https://github.com/danielnachumdev/danielutils/actions/workflows/python-package.yml/badge.svg)](https://github.com/danielnachumdev/danielutils/actions/workflows/python-package.yml)\r\n[![Pylint](https://github.com/danielnachumdev/danielutils/actions/workflows/pylint.yml/badge.svg)](https://github.com/danielnachumdev/danielutils/actions/workflows/pylint.yml)\r\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\r\n[![gitleaks](https://github.com/danielnachumdev/danielutils/actions/workflows/gitleaks.yml/badge.svg)](https://github.com/danielnachumdev/danielutils/actions/workflows/gitleaks.yml)\r\n[![CodeQL](https://github.com/danielnachumdev/danielutils/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/danielnachumdev/danielutils/actions/workflows/github-code-scanning/codeql)\r\n\r\n# danielutils v1.0.46\r\n\r\nA comprehensive Python utilities library designed to enhance your development workflow with powerful tools for type safety, async programming, database operations, and much more.\r\n\r\n**Features:**\r\n- \ud83c\udfaf **Type Safety**: Advanced type checking, validation, and typed collections\r\n- \u26a1 **Async Support**: Comprehensive async utilities and worker pools\r\n- \ud83d\uddc4\ufe0f **Database Abstractions**: Multi-backend database support (SQLite, Redis, In-Memory)\r\n- \ud83d\udd04 **Retry Logic**: Configurable retry executors with multiple backoff strategies\r\n- \ud83d\udcca **Data Structures**: Enhanced collections, graphs, heaps, and algorithms\r\n- \ud83c\udfa8 **Developer Experience**: Progress bars, logging, reflection, and debugging tools\r\n- \ud83e\uddee **Academic Tools**: Probability theory and statistical functions\r\n\r\n**Tested Python versions**: `3.8.0+`, `3.9.0`, `3.10.13`\r\n\r\n> **Note**: This package is actively developed and subject to change. Use at your own risk!\r\n\r\n## \ud83d\ude80 Quick Start\r\n\r\n```python\r\nfrom danielutils import isoftype, validate, tlist\r\nfrom danielutils.abstractions.db import DatabaseFactory\r\nfrom danielutils.abstractions.db.database_definitions import TableSchema, TableColumn, ColumnType\r\n\r\n# Type-safe list with runtime validation\r\nnumbers = tlist[int]([1, 2, 3, 4, 5])\r\n\r\n# Function validation\r\n@validate\r\ndef greet(name: str, age: int) -> str:\r\n    return f\"Hello {name}, you are {age} years old\"\r\n\r\n# Database operations\r\ndb = DatabaseFactory.get_database(\"memory\")  # In-memory database\r\nwith db:\r\n    # Create a table\r\n    schema = TableSchema(\r\n        name=\"users\",\r\n        columns=[\r\n            TableColumn(name=\"id\", type=ColumnType.AUTOINCREMENT, primary_key=True),\r\n            TableColumn(name=\"name\", type=ColumnType.TEXT, nullable=False),\r\n            TableColumn(name=\"age\", type=ColumnType.INTEGER)\r\n        ]\r\n    )\r\n    db.create_table(schema)\r\n    \r\n    # Insert data\r\n    user_id = db.insert(\"users\", {\"name\": \"Alice\", \"age\": 30})\r\n\r\n# Advanced type checking\r\nif isoftype(numbers, list[int]):\r\n    print(\"Numbers is a list of integers!\")\r\n```\r\n\r\n## \ud83d\udcda Documentation\r\n\r\nIn the [`./READMES/`](./READMES/) folder you can find detailed documentation for key features:\r\n\r\n### Core Features\r\n\r\n#### [`isoftype`](./READMES/isoftype.md)\r\n**Advanced Type Checking System**\r\n- Runtime type validation with support for complex types\r\n- Parametrized generics and union types\r\n- Protocol and interface checking\r\n- Enhanced type safety for your applications\r\n\r\n#### [`@overload`](./READMES/overload.md)\r\n**Function Overloading Made Easy**\r\n- Manage multiple function signatures\r\n- Type-safe function overloading\r\n- Simplified API design with clear type hints\r\n\r\n#### [`@validate`](./READMES/validate.md)\r\n**Runtime Type Validation**\r\n- Protect your functions with automatic argument validation\r\n- Catch type-related errors early\r\n- Enhanced debugging and error messages\r\n\r\n#### [`tlist`](./READMES/tlist.md)\r\n**Type-Safe Collections**\r\n- Runtime type validation for lists\r\n- Enhanced list operations with type safety\r\n- Seamless integration with existing code\r\n\r\n#### [`Interface`](./READMES/Interface.md)\r\n**Python Interface Implementation**\r\n- Create interface-like behavior using metaclasses\r\n- Abstract class patterns\r\n- Enhanced object-oriented programming\r\n\r\n## \ud83d\udee0\ufe0f Major Features\r\n\r\n### Database Abstractions (`@/db`)\r\n```python\r\nfrom danielutils.abstractions.db import DatabaseFactory\r\nfrom danielutils.abstractions.db.database_definitions import (\r\n    TableSchema, TableColumn, ColumnType, SelectQuery, WhereClause, Condition, Operator\r\n)\r\n\r\n# Get different database backends\r\nsqlite_db = DatabaseFactory.get_database(\"sqlite\", db_kwargs={\"db_path\": \"test.db\"})\r\nmemory_db = DatabaseFactory.get_database(\"memory\")\r\n\r\n# Create table schema\r\nschema = TableSchema(\r\n    name=\"products\",\r\n    columns=[\r\n        TableColumn(name=\"id\", type=ColumnType.AUTOINCREMENT, primary_key=True),\r\n        TableColumn(name=\"name\", type=ColumnType.TEXT, nullable=False),\r\n        TableColumn(name=\"price\", type=ColumnType.FLOAT),\r\n        TableColumn(name=\"category\", type=ColumnType.TEXT)\r\n    ]\r\n)\r\n\r\n# Use database with context manager\r\nwith memory_db:\r\n    memory_db.create_table(schema)\r\n    \r\n    # Insert data\r\n    product_id = memory_db.insert(\"products\", {\r\n        \"name\": \"Laptop\",\r\n        \"price\": 999.99,\r\n        \"category\": \"Electronics\"\r\n    })\r\n    \r\n    # Query data\r\n    query = SelectQuery(\r\n        table=\"products\",\r\n        where=WhereClause(\r\n            conditions=[\r\n                Condition(column=\"category\", operator=Operator.EQ, value=\"Electronics\")\r\n            ]\r\n        )\r\n    )\r\n    results = memory_db.get(query)\r\n```\r\n\r\n### Async Programming\r\n```python\r\nimport asyncio\r\nfrom danielutils.async_ import AsyncWorkerPool, AsyncLayeredCommand\r\n\r\nasync def process_item(item: str) -> None:\r\n    \"\"\"Async function to process items\"\"\"\r\n    await asyncio.sleep(0.1)  # Simulate work\r\n    print(f\"Processed: {item}\")\r\n\r\nasync def main():\r\n    # Async worker pool\r\n    pool = AsyncWorkerPool(\"data_processor\", num_workers=3, show_pbar=True)\r\n    await pool.start()\r\n    \r\n    # Submit tasks\r\n    items = [\"item1\", \"item2\", \"item3\", \"item4\", \"item5\"]\r\n    for item in items:\r\n        await pool.submit(process_item, args=(item,), name=f\"process_{item}\")\r\n    \r\n    # Wait for completion\r\n    await pool.join()\r\n    \r\n    # Async command execution\r\n    async with AsyncLayeredCommand(\"echo\") as cmd:\r\n        result = await cmd.execute(\"Hello from async command\")\r\n        print(f\"Command output: {result}\")\r\n\r\n# Run the async example\r\nasyncio.run(main())\r\n```\r\n\r\n### Retry Executors\r\n```python\r\nfrom danielutils.retry_executor import RetryExecutor\r\nfrom danielutils.retry_executor.backoff_strategies import ExponentialBackOffStrategy\r\n\r\ndef unreliable_function() -> str:\r\n    \"\"\"Function that might fail\"\"\"\r\n    import random\r\n    if random.random() < 0.7:  # 70% chance of failure\r\n        raise ValueError(\"Random failure\")\r\n    return \"Success!\"\r\n\r\n# Create retry executor with exponential backoff\r\nbackoff = ExponentialBackOffStrategy(initial=1000)  # 1 second initial delay\r\nexecutor = RetryExecutor(backoff_strategy=backoff)\r\n\r\n# Execute with retry logic\r\nresult = executor.execute(unreliable_function, max_retries=3)\r\nif result:\r\n    print(f\"Function succeeded: {result}\")\r\nelse:\r\n    print(\"Function failed after all retries\")\r\n```\r\n\r\n### Data Structures\r\n```python\r\nfrom danielutils.data_structures import Graph, MinHeap, PriorityQueue\r\nfrom danielutils.better_builtins import tlist, tdict\r\nfrom typing import Any\r\nfrom danielutils.data_structures.graph import MultiNode\r\n\r\n# Type-safe collections\r\nusers = tlist[str]([\"alice\", \"bob\", \"charlie\"])\r\nconfig = tdict[str, Any]({\"debug\": True, \"port\": 8080})\r\n\r\n# Advanced data structures\r\ngraph = Graph()\r\nnode_a = MultiNode(\"A\")\r\nnode_b = MultiNode(\"B\")\r\nnode_a.add_child(node_b)\r\ngraph.add_node(node_a)\r\n\r\n# Priority queue with custom objects\r\nclass Task:\r\n    def __init__(self, name: str, priority: int):\r\n        self.name = name\r\n        self.priority = priority\r\n    \r\n    def __lt__(self, other):\r\n        return self.priority < other.priority\r\n\r\nqueue = PriorityQueue[Task]()\r\nqueue.push(Task(\"high_priority\", 1))\r\nqueue.push(Task(\"low_priority\", 3))\r\nqueue.push(Task(\"medium_priority\", 2))\r\n\r\n# Min heap\r\nheap = MinHeap[int]()\r\nheap.push(5)\r\nheap.push(2)\r\nheap.push(8)\r\nheap.push(1)\r\n\r\nprint(f\"Min value: {heap.peek()}\")  # 1\r\n```\r\n\r\n### Progress Tracking\r\n```python\r\nfrom danielutils.progress_bar import ProgressBarPool, AsciiProgressBar\r\n\r\n# Single progress bar\r\nwith AsciiProgressBar(range(100), position=0, desc=\"Processing\") as pbar:\r\n    for i in pbar:\r\n        # Do some work\r\n        import time\r\n        time.sleep(0.01)\r\n\r\n# Multiple progress bars\r\nwith ProgressBarPool(AsciiProgressBar, num_of_bars=2) as pool:\r\n    # Configure individual bars\r\n    pool[0].update(50)  # Update first bar\r\n    pool[1].update(25)  # Update second bar\r\n    \r\n    # Write messages\r\n    pool.write(\"Processing complete!\")\r\n```\r\n\r\n### Reflection & Debugging\r\n```python\r\nfrom danielutils.reflection import FunctionInfo, ClassInfo\r\nfrom danielutils.reflection.interpreter import is_debugging\r\n\r\ndef example_function(name: str, age: int = 25) -> str:\r\n    \"\"\"Example function for reflection\"\"\"\r\n    return f\"Hello {name}, age {age}\"\r\n\r\n# Function introspection\r\ninfo = FunctionInfo(example_function, type)\r\nprint(f\"Function name: {info.name}\")\r\nprint(f\"Parameters: {info.arguments}\")\r\nprint(f\"Return type: {info.return_type}\")\r\n\r\n# Class introspection\r\nclass ExampleClass:\r\n    def __init__(self, value: int):\r\n        self.value = value\r\n    \r\n    def get_value(self) -> int:\r\n        return self.value\r\n\r\nclass_info = ClassInfo(ExampleClass)\r\nprint(f\"Class methods: {[f.name for f in class_info.instance_methods]}\")\r\n\r\n# Runtime debugging detection\r\nif is_debugging():\r\n    print(\"Running in debug mode\")\r\n```\r\n\r\n## \ud83c\udf93 Academic & Research Tools\r\n\r\n### Probability Theory\r\n```python\r\nfrom danielutils.university.probability import Distribution\r\nfrom danielutils.university.probability.funcs import expected_value\r\nfrom danielutils.university.probability.operator import Operator\r\n\r\n# Create probability distributions\r\nbernoulli = Distribution.Discrete.Ber(p=0.5)  # Bernoulli with p=0.5\r\nbinomial = Distribution.Discrete.Bin(n=10, p=0.3)  # Binomial with n=10, p=0.3\r\n\r\n# Calculate probabilities\r\nprob_1 = bernoulli.evaluate(1, Operator.EQ)  # P(X=1)\r\nprob_0 = bernoulli.evaluate(0, Operator.EQ)  # P(X=0)\r\n\r\n# Calculate expected values\r\nexpected_bernoulli = expected_value(bernoulli)\r\nexpected_binomial = expected_value(binomial)\r\n\r\nprint(f\"Bernoulli P(X=1): {prob_1}\")\r\nprint(f\"Bernoulli E[X]: {expected_bernoulli}\")\r\n```\r\n\r\n## \ud83d\udd27 Installation\r\n\r\n```bash\r\npip install danielutils\r\n```\r\n\r\n## \ud83d\udcc8 Project Status\r\n\r\nThis library has evolved significantly since its initial release in September 2022:\r\n\r\n- **2022**: Basic utilities and foundational features (v0.5.x - v0.7.x)\r\n- **2023**: Major development with typed builtins and code quality (v0.8.x - v0.9.x)\r\n- **2024**: Mature library with async support and advanced features (v0.9.x - v1.0.x)\r\n- **2025**: Production-ready with database abstractions and enterprise features (v1.0.x+)\r\n\r\n## \ud83e\udd1d Contributing\r\n\r\nFeel free to use, contribute, and improve this code! The project welcomes:\r\n\r\n- Bug reports and feature requests\r\n- Code contributions and improvements\r\n- Documentation enhancements\r\n- Test coverage improvements\r\n\r\n## \ud83d\udcc4 License\r\n\r\nThis project is licensed under the terms specified in the [LICENSE](./LICENSE) file.\r\n\r\n---\r\n\r\n**Built with \u2764\ufe0f for the Python community**\r\n",
    "bugtrack_url": null,
    "license": "MIT License\r\n        \r\n        Copyright (c) 2022 danielnachumdev\r\n        \r\n        Permission is hereby granted, free of charge, to any person obtaining a copy\r\n        of this software and associated documentation files (the \"Software\"), to deal\r\n        in the Software without restriction, including without limitation the rights\r\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n        copies of the Software, and to permit persons to whom the Software is\r\n        furnished to do so, subject to the following conditions:\r\n        \r\n        The above copyright notice and this permission notice shall be included in all\r\n        copies or substantial portions of the Software.\r\n        \r\n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n        SOFTWARE.",
    "summary": "A python utils library for things I find useful",
    "version": "1.0.46",
    "project_urls": {
        "Bug Tracker": "https://github.com/danielnachumdev/danielutils/issues",
        "Homepage": "https://github.com/danielnachumdev/danielutils"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "aa7ff8075000bb276b2442ad820dd9830b0a65dc1e231b12693733ed22c0b588",
                "md5": "5a3c24539dc235085a4cf7f3273fd283",
                "sha256": "98aa105beff3f052e98bc3a55bfa269e78aca2ae40739c20ad2aabe88e0c70af"
            },
            "downloads": -1,
            "filename": "danielutils-1.0.46.tar.gz",
            "has_sig": false,
            "md5_digest": "5a3c24539dc235085a4cf7f3273fd283",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.0",
            "size": 137076,
            "upload_time": "2025-07-08T14:51:02",
            "upload_time_iso_8601": "2025-07-08T14:51:02.059816Z",
            "url": "https://files.pythonhosted.org/packages/aa/7f/f8075000bb276b2442ad820dd9830b0a65dc1e231b12693733ed22c0b588/danielutils-1.0.46.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-08 14:51:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "danielnachumdev",
    "github_project": "danielutils",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "danielutils"
}
        
Elapsed time: 1.58747s