Metadata-Version: 2.4
Name: mylibrary-edison
Version: 0.0.5
Summary: A complete professional Python library project ready for PyPI
Author-email: Abhinav Bajpai <abhinav@example.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/abhinavbajpai/mylibrary
Project-URL: Bug Tracker, https://github.com/abhinavbajpai/mylibrary/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# mylibrary-edison

[![PyPI version](https://img.shields.io/pypi/v/mylibrary-edison.svg)](https://pypi.org/project/mylibrary-edison/)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/mylibrary-edison.svg)](https://pypi.org/project/mylibrary-edison/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A clean, modern, and production-ready Python library boilerplate, packaged with the latest PEP standards using `pyproject.toml` and ready to be published to PyPI.

---

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Project Structure](#project-structure)
- [Developer Guide](#developer-guide)
  - [Local Development Setup](#local-development-setup)
  - [Testing](#testing)
  - [Building the Package](#building-the-package)
  - [Publishing to PyPI](#publishing-to-pypi)
- [GitHub Actions CI/CD](#github-actions-cicd)
- [License](#license)

---

## Features

- **Modern Packaging:** Configured using standard `pyproject.toml` with `setuptools`.
- **Clean Structure:** Exposes a clear public interface at the package level.
- **Production Ready:** Includes setup scripts, test structure, and automated publishing workflows.
- **Beginner Friendly:** Well-documented codebase with simple CLI recipes.

---

## Installation

Install the library directly from PyPI using `pip`:

```bash
pip install mylibrary-edison
```

---

## Usage

Once installed, you can import and use the library in your Python projects:

```python
from mylibrary import answer

# Call the placeholder function
answer()
```

---

## Project Structure

Here is an overview of the directory structure and what each file does:

```text
mylibrary/
├── .github/
│   └── workflows/
│       └── publish.yml       # GitHub Actions workflow for automatic publishing to PyPI on release tags.
├── mylibrary/                # Main package directory.
│   ├── __init__.py           # Package entrypoint, handles public exports.
│   └── core.py               # Core logic and helper functions.
├── tests/                    # Unit and integration test suite.
│   ├── __init__.py
│   └── test_core.py          # Tests targeting core functionality.
├── .gitignore                # Patterns for Git to ignore.
├── LICENSE                   # MIT License text.
├── pyproject.toml            # Modern project metadata and build configuration.
└── README.md                 # Project documentation (this file).
```

---

## Developer Guide

### Local Development Setup

To work on the library locally, it is recommended to create a virtual environment and perform an **editable install**. This allows you to test your changes in real-time.

1. **Create and activate a virtual environment:**
   ```bash
   python3 -m venv venv
   source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
   ```

2. **Install the package in editable mode with development dependencies:**
   ```bash
   pip install --editable .[dev]
   ```
   *(Note: If you add test dependencies, you can specify them in `pyproject.toml` under optional-dependencies. For now, you can also just run `pip install pytest build twine`.)*

### Testing

This project uses `pytest` for testing.

1. **Install testing tools:**
   ```bash
   pip install pytest
   ```

2. **Run the test suite:**
   ```bash
   pytest
   ```

### Building the Package

To package the project into source distributions and wheels for PyPI:

1. **Install the `build` tool:**
   ```bash
   pip install --upgrade build
   ```

2. **Build the distributions:**
   ```bash
   python -m build
   ```
   This will generate a source archive `.tar.gz` and a built wheel `.whl` inside the `dist/` directory.

### Publishing to PyPI

Once the package is built, you can upload it to PyPI using `twine`.

1. **Install Twine:**
   ```bash
   pip install --upgrade twine
   ```

2. **Validate the built package:**
   ```bash
   python -m twine check dist/*
   ```

3. **Upload to TestPyPI (Recommended first step to verify):**
   ```bash
   python -m twine upload --repository testpypi dist/*
   ```

4. **Upload to PyPI (Production):**
   ```bash
   python -m twine upload dist/*
   ```

---

## GitHub Actions CI/CD

An automated release workflow is configured in `.github/workflows/publish.yml`. When you push a Git tag matching `v*` (e.g. `v0.0.1`), the workflow will automatically:
1. Set up the Python environment.
2. Build the package distribution.
3. Securely publish it to PyPI using PyPI's Trusted Publishing mechanism (OIDC).

---

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
