Skip to main content

The @entry decorator

PyPI PyPI - Python Version

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:

from atentry import entry

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

Using a return value:

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:

# Using Poetry
poetry add atentry

# Using PiP
python3 -m pip install atentry

Metadata

Release files for atentry 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atentry 1.0.0
File Size Uploaded
atentry-1.0.0.tar.gz 14.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atentry 1.0.0
File Interpreter ABI Platform
atentry-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.0 kB

Release files / atentry-1.0.0.tar.gz

Download URL atentry-1.0.0.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
618752421850bd57e6555b62c00b438892de42be66372aaf09012ff11563f4e7
BLAKE2b-256 checksum
How to use checksums
003267d9c944f7f6d4052c39b50a792b2f8c800ccdecaf557d61671eb67db5f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.4 Linux/5.17.4-200.fc35.x86_64

Release files / atentry-1.0.0-py3-none-any.whl

Download URL atentry-1.0.0-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b239616a1229a0fe8e2e636db8ef1a4b6ae3352af92747884f564225b4adb3da
BLAKE2b-256 checksum
How to use checksums
0bc60806f8eb7585fcd235593903998581ed34223fe9c570e3eafd598b4e9ff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.4 Linux/5.17.4-200.fc35.x86_64

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page