Documentation
Our WebsiteOur Github
  • 👋Welcome to Infinitode Documentation
  • AI Documentation
  • API Documentation
    • Basic Math API Documentation (#Experimental)
    • BMI Calculator API Documentation
    • Character Counter API Documentation
    • Chemical Equation Balancer API Documentation
    • Color Generator API Documentation
    • Date Difference Calculator API Documentation
    • Dungen API Documentation
    • Dungen Dev API Documentation
    • Factorial Calculator API Documentation
    • Fantasy Name Generator API Documentation
    • Fibonacci Sequence Generator API Documentation
    • GCD Calculator API Documentation
    • Hash API Documentation
    • Helix PSA API Documentation
    • LCM Calculator API Documentation
    • Leap Year Checker API Documentation
    • Lorem API Documentation
    • Molar Mass Calculator API Documentation (#Experimental)
    • MycoNom API Documentation
    • Name Generator API Documentation
    • Palindrome Checker API Documentation
    • Password Generator API Documentation
    • Password Strength Detector API Documentation
    • Periodic Table API Documentation
    • Prime Number Checker API Documentation
    • Quadratic Equation Solver API Documentation
    • Random Facts Generator API Documentation
    • Random Quotes Generator API Documentation
    • Roman Numeral Converter API Documentation
    • Simple Interest Calculator API Documentation
    • Slugify API Documentation
    • Text Case Converter API Documentation
    • Unit Converter API Documentation
    • Username Generator API Documentation
    • UUID Generator API Documentation
    • Vowel Counter API Documentation
  • Package Documentation
    • BlurJS Package Documentation
      • BlurJS Usage Examples
      • BlurJS Reference Documentation
    • CodeSafe Package Documentation
      • CodeSafe Reference
        • CodeSafe Functions
    • DeepDefend Package Documentation
      • DeepDefend Reference
        • Attacks Functions
        • Defenses Functions
    • DupliPy Package Documentation
      • DupliPy Reference
        • Formatting Functions
        • Replication Functions
        • Similarity Functions
        • Text Analysis Functions
    • FuncProfiler Package Documentation
      • FuncProfiler Reference
        • FuncProfiler Functions
    • Hued Package Documentation
      • Hued Reference
        • Analysis Functions
        • Colors Functions
        • Conversions Functions
        • Palettes Functions
    • LocalSiteMap Package Documentation
      • LocalSiteMap Reference
        • LocalSiteMap Functions
    • PyAutoPlot Package Documentation
      • PyAutoPlot Reference
        • PyAutoPlot Functions
    • PyWebScrapr Package Documentation
      • PyWebScrapr Reference
        • PyWebScrapr Functions
    • ValX Package Documentation
      • ValX Reference
        • ValX Functions
Powered by GitBook
On this page
  • Changelog
  • Installation
  • Example Usage
  • Function Profiling
  • Line-by-Line Profiling

Was this helpful?

  1. Package Documentation

FuncProfiler Package Documentation

Package documentation for FuncProfiler, a Python library for identifying bottlenecks in code. It includes function profiling, data exports, logging, and line-by-line profiling for more control.

Changelog

  • 1.0.2 (Latest): Created 2 new export formats: xml, md for both function profiling and line-by-line profiling.

  • 1.0.1: Updated PYPI project description.

  • 1.0.0: Initial release.

Installation

You can install FuncProfiler using PyPi, please make sure that you are using Python 3.6 or later before installing FuncProfiler:

pip install funcprofiler

Example Usage

Function Profiling

from funcprofiler import function_profile

# Exporting as `html` with logging enabled
@function_profile(export_format="html", shared_log=True)
def some_function():
    return "Hello World."

# Call the function
message = some_function()

Line-by-Line Profiling

from funcprofiler import line_by_line_profile

# Logging enabled without exports
@line_by_line_profile(shared_log=True)
def some_complicated_function(n):
    total = 0
    for i in range(n):
        for j in range(i):
            total += (i * j) ** 0.5  # Square root calculation
    return total

# Call the function
total = some_complicated_function(1000)

FuncProfiler can be added to any function using the callable format: @funcprofiler_function_name(expected_arguments).

PreviousText Analysis FunctionsNextFuncProfiler Reference

Last updated 2 months ago

Was this helpful?