Metadata-Version: 2.4
Name: atlogger
Version: 0.2.3
Summary: Python decorator to log artifacts with mlflow, wandb
Author: Guilherme Toledo
Author-email: Guilherme Toledo <toledo@guilherme.zip>
License-Expression: CC0-1.0
License-File: LICENSE
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Dist: mlflow ; extra == 'mlflow'
Requires-Dist: wandb ; extra == 'wandb'
Requires-Python: >=3.9
Project-URL: Homepage, https://github.com/drawnator/Atlogger
Project-URL: Documentation, https://github.com/drawnator/Atlogger
Project-URL: Repository, https://github.com/drawnator/Atlogger
Provides-Extra: mlflow
Provides-Extra: wandb
Description-Content-Type: text/markdown

# Atlogger
Python decorator to log artifacts with mlflow, wandb, rerun, tensorboard, etc...

Inspired by many talks with colleagues, frustrating nights and the [python logging documentation](https://docs.python.org/3/howto/logging-cookbook.html) I am attempting to develop a module to streamline the proper logging for model training and comparisons

# How to use
```bash
export WANDB_API_KEY="wandb_key"
```
```python
# main.py
from atlogger import logger, WandbHandler

logger.addHandler(
    WandbHandler(
      project="your_project_name",
      config={"config":True},
      level="DEBUG"
      )
  )
```
```python
# lossFunc.py
from atlogger import log

@log
loss(x1,x2):
  return abs(x1 - x2)

@log("euclidean distance")
calc_distance(x1,x2):
  return sqrt(x1**2 - x2**2)
```
you can also use many other functionalities from pythons logging from the standard library as well as the many handlers we made to integrate seamlessly with diverse logging, profiling and code tracking libraries.

for more information head over to the [documentation](/examples/documentation.md)
# Principles 
Ideally this project will have the following principles:
* Non-intrusive:
  * Snippets used for logging shouldn't be in the middle of the code. Anyone should be able to import code from one project to another without having to go through and delete or change lines throughout the functions.
* Modular:
  * Added visualizations should be easy to add and be defined on their own and reused anywhere needed. enabling the user to use only the packages they already have without being locked behind a stack of dependencies
* Explicit:
  * Logging shall not happen under the hood. you should be able to define and easily recognize when information is being logged but also have sensible defaults as not to loose important information that is constantly ignored (i.e. logging hardware load during ML models training)
* Adaptable:
  * I want to be able to use this tool for logging diverse kinds of code and easily change between them:
    1. Ml training
    2. Compression algorithms
    3. async algorithms
    4. profiling algorithm duration
    5. reinforcement learning / robotics

# Known bugs
* running logger inside jupyter notebook ony works for one cell
* config from file is not logging with proper log levels
* wandb handler might not be filtering by log level

# Current Goals
* Add a basic implementation of mlflow, rerun, profiling 
* Only uses packages you have installed
* Enable choice of what happens if logging fail: break, or ignore
* Continue experiments
* Log artifacts like images or models
* Pass custom logger and custom formatter per call