Metadata-Version: 2.4
Name: simple-sample
Version: 1.5.3
Summary: A simple sample of a Python package prototype
Author-email: Alessandra Bilardi <alessandra.bilardi@gmail.com>
Project-URL: Homepage, https://simple-sample.readthedocs.io/
Project-URL: Source, https://github.com/bilardi/python-prototype
Project-URL: Bug Reports, https://github.com/bilardi/python-prototype/issues
Project-URL: Funding, https://donate.pypi.org
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.13
Description-Content-Type: text/x-rst
License-File: LICENSE
Dynamic: license-file

Python prototype
================

This package contains a simple sample of a Python package prototype.
It is part of the `educational repositories <https://github.com/pandle/materials>`_ to learn how to write stardard code and common uses of the TDD.

See the documentation and how to do it on `readthedocs <https://simple-sample.readthedocs.io/en/latest/>`_.
And see the development of this code step by step

* with `see-git-steps <https://github.com/bilardi/see-git-steps>`_ on `readthedocs / step by step <https://simple-sample.readthedocs.io/en/latest/stepbystep.html>`_
    * this page is old style: you can learn the concepts about to create before unit test and then the code
    * but now a Python package is handled differently
* you can find the refactoring on `readthedocs / refactoring <https://simple-sample.readthedocs.io/en/latest/refactoring.html>`_

Installation
###############

The package is self-consistent. So you can download the package by github:

.. code-block:: bash

    $ git clone https://github.com/bilardi/python-prototype

Or you can install by python3-pip:

.. code-block:: bash

    $ pip3 install simple_sample

Usage
#####

Read the unit tests in `tests/test_my_class.py <https://github.com/bilardi/python-prototype/blob/master/tests/test_my_class.py>`_ file to use it. This is a best practice.
You can read also the documentation by command line,

.. code-block:: bash

    $ python3
    >>> from simple_sample.my_class import MyClass
    >>> print(MyClass.__doc__)
    >>> help(MyClass)
    >>> quit()

If you want to see the local documentation, that you have downloaded by github, you can use the same steps but before you must to change the directory

.. code-block:: bash

    $ cd python-prototype

Development
###########

See `readthedocs / howtomake <https://simple-sample.readthedocs.io/en/latest/howtomake.html>`_ for environment setup, testing, pre-commit hooks, conventional commits, versioning and packaging.

See `readthedocs / refactoring <https://simple-sample.readthedocs.io/en/latest/refactoring.html>`_ for how this project moved from ``unittest`` / ``setup.py`` to ``pytest`` / ``pyproject.toml``.

Project structure
#################

::

    simple_sample/  # the package source
        __init__.py  # package metadata and version
        my_class.py  # example class: inherits from interface and abstract
        my_class_abstract.py  # abstract class
        my_class_interface.py  # interface class
    tests/  # pytest test files
    docs/source/  # sphinx documentation (published on readthedocs)
    pyproject.toml  # deps, ruff, pyright, bumpversion, git-cliff
    Makefile  # targets for test, build, release
    .pre-commit-config.yaml  # ruff + pytest hooks
    CHANGELOG.md  # generated by git-cliff

Change Log
##########

See `CHANGELOG.md <https://github.com/bilardi/python-prototype/blob/master/CHANGELOG.md>`_ for details.
This file is updated by `Makefile <https://github.com/bilardi/python-prototype/blob/master/Makefile>`_ command:

.. code-block:: bash

    $ make changelog

See the `Versioning management <https://simple-sample.readthedocs.io/en/latest/howtomake.html#versioning-management>`_ section in howtomake for how to bump the version and release: the same page also shows how to install the dependencies first.

Blog post
#########

* Italian: `POST.it.md <https://github.com/bilardi/python-prototype/blob/master/POST.it.md>`_
* English: `POST.en.md <https://github.com/bilardi/python-prototype/blob/master/POST.en.md>`_

License
#######

This package is released under the MIT license.  See `LICENSE <https://github.com/bilardi/python-prototype/blob/master/LICENSE>`_ for details.
