Git Product home page Git Product logo

pyreport's Introduction

Python GitHub tag (latest by date) GitHub stars GitHub forks License Documentation

pyreport: Automate Your LaTeX Reports with Python ๐Ÿ“

Create elegant LaTeX reports effortlessly from your code with pyreport. Generate and populate reports with plots, tables, custom environments, commands, and structure, all within your Python environment. Say goodbye to LaTeX headaches and focus on your work while pyreport handles the document creation for you.

  • Automate LaTeX Reporting: Generate LaTeX reports seamlessly during your computations.
  • Dynamic Content: Add plots, tables, variable logs, and custom LaTeX elements effortlessly.
  • Structure Your Report: Define sections, chapters, and more for a well-organized document.
  • Focus on Your Work: Stop worrying about LaTeX intricacies and focus on your data and analysis.

Simplify your report creation process with pyreport. No LaTeX expertise required.

Main Contributors:

Table of Contents

Roadmap

Our development roadmap is structured to follow a bottom-up approach, starting with fundamental features and gradually adding more advanced capabilities.

Basic Functionality

  • Create LaTeX documents with text content.
  • Define sections and chapters for structuring your report.
  • Add custom environments and commands.
  • Add remaining symbols/math-operators
  • Populate your report with plaintext.
  • Automate report generation with the Reporter class.

Data Representation

  • Add more environments for formatting text and data, e.g. center, figure, table, etc.
    • Add support for matplotlib figures and plots, e.g. with an Environment that can take a figure object, save it to a temporary file and then include it in the report.
    • Add support for custom data-viz via TikZ, e.g. Environment that can take various types of data and then creates an appropriate visualization given some settings.
    • Add support for .csv files to automatically create tables.
  • Add environment that automatically displays source code via inspect.getsource() and listings.

Mathematical Expressions

  • Add support for mathematics with math environments like align, equation, etc.
  • Add support for variables that can either be displayed as symbol or the value they hold.
  • Support for variable tracking to see how variables change over time.
    • Add x.watch to automatically log the variable x whenever it changes.
    • Make it possible to specify a list of variables to only log interactions with them, e.g. x.watch([y, z]) only logs interactions of x with y and z.
    • Add temporary logging via x.log() to log the current value of x without watching it.
    • Add temporary variables that are the result of an operation, e.g. x = Variable(x, 0); y = Variable(y, 1); z = x + y such that z is a temporary variable that is not watched and only exists for the duration of the current scope.
  • Builing formulas via python operations, e.g. Variable(alpha, 0.5) + Variable(beta, 0.5) either renders to $\alpha + \beta$ or returns the value 1.0.
  • Add support for function evaluations and Variable assignments via Function(f, lambda x: x**2) and Variable(x, 2) such that f(x) renders to $f(x) = x^2$ and f(x).value returns 4.
  • Add variable logging to see how the variable changes over time (maybe even own Logging environment?).

Advanced Mathematical Concepts

  • Support for vectors, matrices, and non-scalar functions.
  • Handle custom function evaluations and variable assignments.
  • Implement a variable glossary for variable documentation.

Integration and References

  • Add label-referencing support.
  • Implement bibliography and sources, including automatic citation generation via classes like Article, Book, Report, etc.
  • Automatically generate a glossary from provided variables with descriptions.

High-level Convenience

  • Provide a context manager with with Reporter(...) as report for streamlined report creation.
  • Create custom style files to customize the report's appearance.

Getting Started

  1. Clone the repository:

    git clone https://github.com/AlbertEMC2Stein/pyreport.git
  2. Install the required dependencies:

    pip install -r requirements.txt
  3. Install pyreport:

    pip install .

For development mode, use the following command instead:

pip install -e .
  1. Use the provided examples and documentation to start automating your reports with pyreport.

Once installed, you can generate a test report to validate your installation:

python examples/test_default.py

This will generate a test report in the examples directory.

Usage

To start generating reports, follow these basic steps:

  1. Import the necessary modules:

    from pyreport.math import *
    from pyreport.report import *
  2. Create a Reporter instance:

    report = Reporter('Your_Report_Name')
  3. Add content to your report using the available functions and classes.

  4. Save or export your report to the desired format, such as LaTeX or PDF.

Examples

Here's an example of how to create a simple report with pyreport:

from pyreport.math import *
from pyreport.report import *

report = Reporter('My_Report')

# Define a mathematical function
f = Function(f, lambda x: x**2)

# Create a variable and log its changes
x = Variable(x, 0, watch=True)
for i in range(100):
    x = x + i

print(x)  # -> 5050 or x = 5050
print(f(x, eval=True))  # -> 25502500

# Add equations and variable trace to the report
report.add(Equation(f, x, symbols=True))  # f(x) = x^2
report.add(Equation(f, x, symbols=False))  # -> f(x) = 25502500 
report.add(x.create_trace())  # -> 1:   x = 0     2:   x = 1     3: x = 3 ...

Contributing

We welcome contributions! If you'd like to contribute to the development of pyreport, please see our contribution guidelines for more information.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

Feel free to customize and expand the sections as needed. Your README provides a comprehensive overview of your project's capabilities and how to get started with it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.