Skip to main content

Python library for Microsoft Teams webhooks

Project description

Py Lib Template

A Python library template with modern packaging setup for PyPI publishing.

Create your own libraries in the lib folder, using the py_lib_template example, you can create your own library by changing the name of the folder and update the folder name in the pyproject.toml file. Follow the steps below for more details

Installation

pip install py-lib-template

Usage

Basic Addition

from lib import add

# Add two numbers
result = add(1, 2)
print(result)  # 3

# Works with floats too
result = add(1.5, 2.5)
print(result)  # 4.0

Adding Multiple Numbers

from lib import add_many

# Add multiple numbers
result = add_many(1, 2, 3, 4, 5)
print(result.value)     # 15
print(result.operands)  # [1, 2, 3, 4, 5]

Development

Setup

# Create virtual environment
python -m venv venv

# Activate (Windows)
venv\Scripts\activate

# Activate (Unix/Mac)
source venv/bin/activate

# Install in development mode
pip install
pip install build
pip install twine

Pre-Build

  • In pyproject.toml. Update the version and name of the library that you wish to publish.

Build

# Build the package
python build_lib.py

# Or manually
python -m build --outdir pypi_publish

Test

pytest

Lint & Format

# Format code
black lib tests

# Lint
ruff lib tests

# Type check
mypy lib

Publish

# Build first
python build_lib.py

# Publish to PyPI (requires credentials)
cd pypi_publish
python -m twine upload *

Project Structure

lib/
├── py_lib_template/                    # Library source code
│   ├── __init__.py        # Package entry point
│   └── math_utils.py      # Example module
├── pypi_publish/          # Build artifacts (wheel, sdist)
├── tests/                 # Test files
├── pyproject.toml         # Package configuration
└── README.md

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rajang_pywebhook-0.1.3.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rajang_pywebhook-0.1.3-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file rajang_pywebhook-0.1.3.tar.gz.

File metadata

  • Download URL: rajang_pywebhook-0.1.3.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for rajang_pywebhook-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c4704df1a04b7306aa8566ed9ead5c42da20f72d2e3b7815b9e2d4d0677aea45
MD5 4ca3ca9c5729f7f89738dda6e3872eb9
BLAKE2b-256 5b3b968ec1cf80929ce2eb64cfe5f64c3a033d7dddc8710e7d6eae3571b10380

See more details on using hashes here.

File details

Details for the file rajang_pywebhook-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for rajang_pywebhook-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 46d37e7f23acacbb6efd63d7a6b4fc553d033df1266f6d0790a61fd16e77571a
MD5 faa001fb4593c32366f0860ace03282e
BLAKE2b-256 d09d96de21bdcaa18898c1cf6579ab3a5730a1b294766b08827b855d0249dc2d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page