Installation
============

Requirements
------------

* Python 3.9 or higher
* pip (Python package installer)

Installing from PyPI
--------------------

The easiest way to install SSMD is using pip:

.. code-block:: bash

   pip install ssmd

This will install the latest stable release from PyPI.

Installing from Source
----------------------

If you want to install from source or contribute to development:

1. Clone the repository:

.. code-block:: bash

   git clone https://github.com/holgern/ssmd.git
   cd ssmd

2. Install in development mode:

.. code-block:: bash

   pip install -e .

This will install SSMD in editable mode, so any changes you make to the source
code will be immediately reflected.

Development Installation
------------------------

For development with all testing and documentation tools:

.. code-block:: bash

   # Clone and enter directory
   git clone https://github.com/holgern/ssmd.git
   cd ssmd

   # Install with development dependencies
   pip install -e ".[dev]"

   # Install pre-commit hooks
   pre-commit install

This installs additional dependencies for:

* Testing (pytest, pytest-cov)
* Type checking (mypy)
* Linting and formatting (ruff)
* Documentation building (Sphinx)

Verifying Installation
----------------------

To verify that SSMD is installed correctly:

.. code-block:: python

   import ssmd

   # Check version
   print(ssmd.__version__)

   # Quick test
   result = ssmd.to_ssml("Hello *world*!")
   print(result)
   # Should output: <speak>Hello <emphasis>world</emphasis>!</speak>

Dependencies
------------

SSMD has minimal runtime dependencies:

* ``phrasplit`` - sentence detection and splitting
* ``pyyaml`` - YAML front matter parsing

Optional dependencies for development:

* **Testing**: pytest, pytest-cov
* **Type checking**: mypy
* **Linting**: ruff
* **Documentation**: Sphinx, sphinx-rtd-theme
* **Build**: setuptools-scm, build

Upgrading
---------

To upgrade to the latest version:

.. code-block:: bash

   pip install --upgrade ssmd

Uninstalling
------------

To remove SSMD from your system:

.. code-block:: bash

   pip uninstall ssmd
