Metadata-Version: 2.1
Name: atentry
Version: 1.0.0
Summary: Never see `if __name__ == "__main__"` again!
Home-page: https://github.com/Ewpratten/atentry
License: GPLv3
Author: Evan Pratten
Author-email: ewpratten@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Project-URL: Repository, https://github.com/Ewpratten/atentry
Description-Content-Type: text/markdown

# The `@entry` decorator

[![PyPI](https://img.shields.io/pypi/v/atentry)](https://pypi.org/project/atentry/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/atentry)

Tired of the traditional python `if __name__ == '__main__':` pattern? Try `@entry` instead!

`@entry` is designed to be a simple decorator for declaring main functions in python. In the backend, the same module name check is performed, but it keeps your code a little cleaner.

## Usage

**Simple example:**

```python
from atentry import entry

@entry
def main():
    print("Hello, world!")
```

**Using a return value:**

```python
from atentry import entry

@entry
def main() -> int:
    print("Hello, world!")
    return 128 # Program exit code
```

## Installation

Loading this library in your project is as simple as:

```sh
# Using Poetry
poetry add atentry

# Using PiP
python3 -m pip install atentry
```

