{"id":13561156,"url":"https://github.com/okp4/template-python","last_synced_at":"2025-04-03T16:32:11.396Z","repository":{"id":38108110,"uuid":"419234364","full_name":"okp4/template-python","owner":"okp4","description":"🖨 Template for Python Projects @okp4.","archived":false,"fork":false,"pushed_at":"2024-03-29T14:20:10.000Z","size":386,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-04T12:40:26.515Z","etag":null,"topics":["poetry","python3","template"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okp4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-20T07:50:51.000Z","updated_at":"2024-06-27T02:18:44.000Z","dependencies_parsed_at":"2023-02-17T20:01:05.820Z","dependency_job_id":"7a290dc8-3c95-4af5-a47a-04640eef8180","html_url":"https://github.com/okp4/template-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":"okp4/template-oss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Ftemplate-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Ftemplate-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Ftemplate-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Ftemplate-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okp4","download_url":"https://codeload.github.com/okp4/template-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247037113,"owners_count":20873098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["poetry","python3","template"],"created_at":"2024-08-01T13:00:53.028Z","updated_at":"2025-04-03T16:32:06.387Z","avatar_url":"https://github.com/okp4.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"# Python Project Template\n\n\u003e Template for Python Projects [@okp4](okp4.com).\n\n[![version](https://img.shields.io/github/v/release/okp4/template-python?style=for-the-badge\u0026logo=github)](https://github.com/okp4/template-python/releases)\n[![lint](https://img.shields.io/github/actions/workflow/status/okp4/template-python/lint.yml?label=lint\u0026style=for-the-badge\u0026logo=github)](https://github.com/okp4/template-python/actions/workflows/lint.yml)\n[![build](https://img.shields.io/github/actions/workflow/status/okp4/template-python/build.yml?label=build\u0026style=for-the-badge\u0026logo=github)](https://github.com/okp4/template-python/actions/workflows/build.yml)\n[![test](https://img.shields.io/github/actions/workflow/status/okp4/template-python/test.yml?label=test\u0026style=for-the-badge\u0026logo=github)](https://github.com/okp4/template-python/actions/workflows/test.yml)\n[![codecov](https://img.shields.io/codecov/c/github/okp4/template-python?style=for-the-badge\u0026token=G5OBC2RQKX\u0026logo=codecov)](https://codecov.io/gh/okp4/template-python)\n[![conventional commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=for-the-badge\u0026logo=conventionalcommits)](https://conventionalcommits.org)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge)](https://github.com/semantic-release/semantic-release)\n[![contributor covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=for-the-badge)](https://github.com/okp4/.github/blob/main/CODE_OF_CONDUCT.md)\n[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg?style=for-the-badge)](https://opensource.org/licenses/BSD-3-Clause)\n\n## Purpose \u0026 Philosophy\n\nThis repository holds the template for building python projects with a consistent set of standards across all okp4 python projects. We are convinced that the quality of the code depends on clear and consistent coding conventions, with an automated enforcement (CI).\n\nThis way, the template promotes:\n\n- the use of [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), [semantic versionning](https://semver.org/) and [semantic releasing](https://github.com/cycjimmy/semantic-release-action) which automates the whole package release workflow including: determining the next version number, generating the release notes, and publishing the artifacts (project tarball, docker images, etc.)\n- a uniform way for managing the project lifecycle (dependencies management, building, testing)\n- KISS principles: simple for developers\n- a consistent coding style\n\n## How to use\n\n\u003e 🚨 do not fork this repository as it is a [template repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)\n\n1. Click on [Use this template](https://github.com/okp4/template-python/generate)\n2. Give a name to your project\n3. Wait until the first run of CI finishes\n4. Clone your new project and happy coding!\n\n## System requirements\n\n### Python\n\nThe repository targets python `3.9` and higher.\n\n### Poetry\n\nThe repository uses [Poetry](https://python-poetry.org) as python packaging and dependency management. Be sure to have it properly installed before.\n\n```sh\ncurl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -\n```\n\n### Docker\n\nYou can follow the link below on how to install and configure **Docker** on your local machine:\n\n- [Docker Install Documentation](https://docs.docker.com/install/)\n\n## What's included\n\nThis template provides the following:\n\n- [poetry](https://python-poetry.org) for dependency management.\n- [flake8](https://flake8.pycqa.org) for linting python code.\n- [mypy](http://mypy-lang.org/) for static type checks.\n- [pytest](https://docs.pytest.org) for unit testing.\n- [click](https://palletsprojects.com/p/click/) to easily setup your project commands\n\nThe project is also configured to enforce code quality by declaring some CI workflows:\n\n- conventional commits\n- lint\n- unit test\n- semantic release\n\n## Everyday activity\n\n### Build\n\nProject is built by [poetry](https://python-poetry.org).\n\n```sh\npoetry install\n```\n\n### Usage\n\n```sh\npoetry run my-app --help\n```\n\nWill give something like\n\n```console\nUsage: my-app [OPTIONS] COMMAND [ARGS]...\n\n  OKP4 python template, program description.\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  main-cmd  Does something interesting...\n  version   Print the application version information\n```\n\nExample:\n\n```sh\npoetry run my-app main-cmd --name Sunshine\n```\n\n### Lint\n\n\u003e ⚠️ Be sure to write code compliant with linters or else you'll be rejected by the CI.\n\n**Code linting** is performed by [flake8](https://flake8.pycqa.org).\n\n```sh\npoetry run flake8 --count --show-source --statistics\n```\n\n**Static type check** is performed by [mypy](http://mypy-lang.org/).\n\n```sh\npoetry run mypy .\n```\n\nTo improve code quality, we use other linters in our workflows, if you don't want to be rejected by the CI,\nplease check these additional linters.\n\n**Markdown linting** is performed by [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli).\n\n```sh\nmarkdownlint \"**/*.md\"\n```\n\n**Docker linting** is performed [hadolint](https://github.com/hadolint/hadolint).\n\n```sh\nhadolint Dockerfile\n```\n\n### Unit Test\n\n\u003e ⚠️ Be sure to write tests that succeed or else you'll be rejected by the CI.\n\nUnit tests are performed by the [pytest](https://docs.pytest.org) testing framework.\n\n```sh\npoetry run pytest -v\n```\n\n### Build \u0026 run docker image (locally)\n\nBuild a local docker image using the following command line:\n\n```sh\ndocker build -t my-app .\n```\n\nOnce built, you can run the container locally with the following command line:\n\n```sh\ndocker run -ti --rm my-app\n```\n\n## You want to get involved? 😍\n\nPlease check out OKP4 health files :\n\n- [Contributing](https://github.com/okp4/.github/blob/main/CONTRIBUTING.md)\n- [Code of conduct](https://github.com/okp4/.github/blob/main/CODE_OF_CONDUCT.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokp4%2Ftemplate-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokp4%2Ftemplate-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokp4%2Ftemplate-python/lists"}