Skip to main content

This package contains a simple sample of a Python package prototype. It is part of the educational repositories to learn how to write stardard code and common uses of the TDD.

See the documentation and how to do it on readthedocs. And see the development of this code step by step

Installation

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

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

Or you can install by python3-pip:

$ pip3 install simple_sample

Usage

Read the unit tests in tests/test_my_class.py file to use it. This is a best practice. You can read also the documentation by command line,

$ 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

$ cd python-prototype

Development

See readthedocs / howtomake for environment setup, testing, pre-commit hooks, conventional commits, versioning and packaging.

See readthedocs / refactoring 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 for details. This file is updated by Makefile command:

$ make changelog

See the 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

License

This package is released under the MIT license. See LICENSE for details.

Metadata

Release files for simple-sample 1.5.3

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

Source distribution (sdist)

Source distribution for simple-sample 1.5.3
File Size Uploaded
simple_sample-1.5.3.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-sample 1.5.3
File Interpreter ABI Platform
simple_sample-1.5.3-py3-none-any.whl Python 3 none any Details

Total release size: 20.2 kB

Release files / simple_sample-1.5.3.tar.gz

Download URL simple_sample-1.5.3.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
223b6fa6e8e25d8d22d168b24edce4e0980d110b2289edb0ce2bd2e0282c91a1
BLAKE2b-256 checksum
How to use checksums
e719c333241473957bced716d7cdce1de7c3a5c438331c22c5a8b4ee0aa094d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / simple_sample-1.5.3-py3-none-any.whl

Download URL simple_sample-1.5.3-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58bccfd6b512e094cae085ee274ab8c887aa3b07fe47df6390c895c1d5dd4429
BLAKE2b-256 checksum
How to use checksums
b7e0be9b56bed02c18769760356477c3049d049a4b020f7ee20abfccf111df9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

1.5.3 This release

2 release files

0.0.4

2 release files

0.0.1

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