{"id":28715519,"url":"https://github.com/funcbox-i3/funcbox","last_synced_at":"2025-06-15T02:10:18.895Z","repository":{"id":281455167,"uuid":"944669550","full_name":"funcBox-i3/funcBox","owner":"funcBox-i3","description":"FuncBox is a Python package that provides a set of useful utility functions for common mathematical and string operations.","archived":false,"fork":false,"pushed_at":"2025-03-13T19:14:13.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-22T07:55:47.531Z","etag":null,"topics":["pypi-package","python-3","utility-library"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/funcbox/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funcBox-i3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-07T18:57:07.000Z","updated_at":"2025-05-22T06:38:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"79b5761b-d7f3-4130-ad0d-f9f3deecc0b5","html_url":"https://github.com/funcBox-i3/funcBox","commit_stats":null,"previous_names":["adityaprasad502/funcbox","funcbox-i3/funcbox"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/funcBox-i3/funcBox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funcBox-i3%2FfuncBox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funcBox-i3%2FfuncBox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funcBox-i3%2FfuncBox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funcBox-i3%2FfuncBox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funcBox-i3","download_url":"https://codeload.github.com/funcBox-i3/funcBox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funcBox-i3%2FfuncBox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259910742,"owners_count":22930713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pypi-package","python-3","utility-library"],"created_at":"2025-06-15T02:10:18.264Z","updated_at":"2025-06-15T02:10:18.883Z","avatar_url":"https://github.com/funcBox-i3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FuncBox\n\nFuncBox is a streamlined Python utility library designed to provide essential utilities.\n\n## Installation\n\nTo install FuncBox, use pip:\n\n```bash\npip install -U funcbox\n```\n\n## Usage\n\nImport FuncBox into your Python project to access its functions:\n\n```python\nfrom funcbox import *\n```\n\n## Available Functions\n\n### `is_prime(n: int) -\u003e bool`\nEfficiently check if a number is prime. Only checking potential divisors of form 6k±1 up to sqrt(n)\n\n*   **Parameters**:\n    *   `n`: The number to check for primality\n*   **Returns**:\n    *   `bool`: True if the number is prime, False otherwise\n*   **Examples**:\n    ```python\n    print(is_prime(7))  # Output: True\n    print(is_prime(10))  # Output: False\n    ```\n\n### `fibonacci(n: int, type=\"int\") -\u003e Union[int, List[int]]`\nCalculate Fibonacci numbers efficiently.\n\n*   **Parameters**:\n    *   `n`: The index of Fibonacci number to calculate (0-indexed) or count of numbers for list\n    *   `type`: Output format - 'int' for single value or 'list' for sequence. Defaults to \"int\".\n*   **Returns**:\n    *   `Union[int, List[int]]`: Either the nth Fibonacci number or a list of n Fibonacci numbers\n*   **Raises**:\n    *   `ValueError`: If n is negative or type is not 'int' or 'list'\n*   **Examples**:\n    ```python\n    print(fibonacci(0))  # Output: 0\n    print(fibonacci(5))  # Output: 5\n    print(fibonacci(5, \"list\"))  # Output: [0, 1, 1, 2, 3]\n    ```\n\n### `get_factors(num: int) -\u003e List[int]`\nGet all factors of a number, excluding the number itself.\n\n*   **Parameters**:\n    *   `num`: The number to find factors for.\n*   **Returns**:\n    *   `List[int]`: A sorted list of all factors of the number (excluding the number itself).\n*   **Examples**:\n    ```python\n    print(get_factors(12))  # Output: [1, 2, 3, 4, 6]\n    print(get_factors(7))   # Output: [1]\n    ```\n\n### `dijkstra(graph: dict, start_node: Any, end_node: Any = None) -\u003e dict`\nCompute Dijkstra's shortest path algorithm to find the shortest paths from a start node to all other nodes in a graph,\nor to a specific end node if specified.\n\n*   **Parameters**:\n    *   `graph`: A graph represented as an adjacency list, where keys are nodes and values are dictionaries mapping neighbors to edge weights.\n    *   `start_node`: The node to start the pathfinding from.\n    *   `end_node`: (Optional) If specified, the algorithm will terminate early once the shortest path to this node is found. Defaults to None.\n*   **Returns**:\n    *   `dict`: A dictionary containing two dictionaries:\n        *   `'distances'`: Shortest distances from the start node to each node.\n        *   `'paths'`: Shortest paths from the start node to each node.\n        Nodes not reachable from the start node will have a distance of infinity and path as None.\n*   **Examples**:\n    ```python\n    graph = {\n        'A': {'B': 4, 'C': 2},\n        'B': {'D': 5, 'E': 1},\n        'C': {'B': 1, 'E': 3},\n        'D': {'F': 2},\n        'E': {'D': 1, 'F': 4},\n        'F': {}\n    }\n    result = dijkstra(graph, 'A')\n    print(result['distances'])  # Output distances from A to all nodes\n    print(result['paths'])      # Output paths from A to all nodes\n    \n    # Using end_node parameter\n    result = dijkstra(graph, 'A', 'F')\n    print(result['distances'])  # Output distances for nodes processed\n    print(result['paths'])      # Output paths for nodes processed\n    ```\n\n## Disclaimer\n\nFuncBox provides utility functions for general use. The developer is not responsible for any issues caused by improper use or abuse of the library.\n\n## Contributing\n\nContributions are welcome! Feel free to fork the repository and submit a pull request with your improvements.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuncbox-i3%2Ffuncbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuncbox-i3%2Ffuncbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuncbox-i3%2Ffuncbox/lists"}