{"id":13486451,"url":"https://github.com/smarie/python-pyfields","last_synced_at":"2025-03-15T11:32:10.754Z","repository":{"id":62580316,"uuid":"210546131","full_name":"smarie/python-pyfields","owner":"smarie","description":"Define fields in python classes. Easily.","archived":false,"fork":false,"pushed_at":"2023-11-06T16:38:21.000Z","size":5049,"stargazers_count":45,"open_issues_count":20,"forks_count":10,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-27T00:48:14.206Z","etag":null,"topics":["attr","attribute","boilerplate","class","descriptor","field","member","mix-in","mixin","object","oop","type-check","validation"],"latest_commit_sha":null,"homepage":"https://smarie.github.io/python-pyfields","language":"Python","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/smarie.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}},"created_at":"2019-09-24T08:02:52.000Z","updated_at":"2024-01-14T00:00:25.000Z","dependencies_parsed_at":"2024-01-16T09:00:56.090Z","dependency_job_id":"c7f1c9d3-c616-42ba-8f88-5e9c5c6d8f8f","html_url":"https://github.com/smarie/python-pyfields","commit_stats":{"total_commits":223,"total_committers":2,"mean_commits":111.5,"dds":0.008968609865470878,"last_synced_commit":"c08cfb316baaa9719485bf830cf832039b2d2526"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarie%2Fpython-pyfields","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarie%2Fpython-pyfields/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarie%2Fpython-pyfields/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarie%2Fpython-pyfields/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smarie","download_url":"https://codeload.github.com/smarie/python-pyfields/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243724976,"owners_count":20337656,"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":["attr","attribute","boilerplate","class","descriptor","field","member","mix-in","mixin","object","oop","type-check","validation"],"created_at":"2024-07-31T18:00:46.256Z","updated_at":"2025-03-15T11:32:10.208Z","avatar_url":"https://github.com/smarie.png","language":"Python","readme":"# python-pyfields\n\n*Define fields in python classes. Easily.*\n\n[![Python versions](https://img.shields.io/pypi/pyversions/pyfields.svg)](https://pypi.python.org/pypi/pyfields/) [![Build Status](https://github.com/smarie/python-pyfields/actions/workflows/base.yml/badge.svg)](https://github.com/smarie/python-pyfields/actions/workflows/base.yml) [![Tests Status](https://smarie.github.io/python-pyfields/reports/junit/junit-badge.svg?dummy=8484744)](https://smarie.github.io/python-pyfields/reports/junit/report.html) [![Coverage Status](https://smarie.github.io/python-pyfields/reports/coverage/coverage-badge.svg?dummy=8484744)](https://smarie.github.io/python-pyfields/reports/coverage/index.html) [![codecov](https://codecov.io/gh/smarie/python-pyfields/branch/main/graph/badge.svg)](https://codecov.io/gh/smarie/python-pyfields) [![Flake8 Status](https://smarie.github.io/python-pyfields/reports/flake8/flake8-badge.svg?dummy=8484744)](https://smarie.github.io/python-pyfields/reports/flake8/index.html)\n\n[![Documentation](https://img.shields.io/badge/doc-latest-blue.svg)](https://smarie.github.io/python-pyfields/) [![PyPI](https://img.shields.io/pypi/v/pyfields.svg)](https://pypi.python.org/pypi/pyfields/) [![Downloads](https://pepy.tech/badge/pyfields)](https://pepy.tech/project/pyfields) [![Downloads per week](https://pepy.tech/badge/pyfields/week)](https://pepy.tech/project/pyfields) [![GitHub stars](https://img.shields.io/github/stars/smarie/python-pyfields.svg)](https://github.com/smarie/python-pyfields/stargazers)\n\n**This is the readme for developers.** The documentation for users is available here: [https://smarie.github.io/python-pyfields/](https://smarie.github.io/python-pyfields/)\n\n## Want to contribute ?\n\nContributions are welcome ! Simply fork this project on github, commit your contributions, and create pull requests.\n\nHere is a non-exhaustive list of interesting open topics: [https://github.com/smarie/python-pyfields/issues](https://github.com/smarie/python-pyfields/issues)\n\n## `nox` setup\n\nThis project uses `nox` to define all lifecycle tasks. In order to be able to run those tasks, you should create python 3.7 environment and install the requirements:\n\n```bash\n\u003e\u003e\u003e conda create -n noxenv python=\"3.7\"\n\u003e\u003e\u003e activate noxenv\n(noxenv) \u003e\u003e\u003e pip install -r noxfile-requirements.txt\n```\n\nYou should then be able to list all available tasks using:\n\n```\n\u003e\u003e\u003e nox --list\nSessions defined in \u003cpath\u003e\\noxfile.py:\n\n* tests-2.7 -\u003e Run the test suite, including test reports generation and coverage reports.\n* tests-3.5 -\u003e Run the test suite, including test reports generation and coverage reports.\n* tests-3.6 -\u003e Run the test suite, including test reports generation and coverage reports.\n* tests-3.8 -\u003e Run the test suite, including test reports generation and coverage reports.\n* tests-3.7 -\u003e Run the test suite, including test reports generation and coverage reports.\n- docs-3.7 -\u003e Generates the doc and serves it on a local http server. Pass '-- build' to build statically instead.\n- publish-3.7 -\u003e Deploy the docs+reports on github pages. Note: this rebuilds the docs\n- release-3.7 -\u003e Create a release on github corresponding to the latest tag\n```\n\n## Running the tests and generating the reports\n\nThis project uses `pytest` so running `pytest` at the root folder will execute all tests on current environment. However it is a bit cumbersome to manage all requirements by hand ; it is easier to use `nox` to run `pytest` on all supported python environments with the correct package requirements:\n\n```bash\nnox\n```\n\nTests and coverage reports are automatically generated under `./docs/reports` for one of the sessions (`tests-3.7`). \n\nIf you wish to execute tests on a specific environment, use explicit session names, e.g. `nox -s tests-3.6`.\n\n\n## Editing the documentation\n\nThis project uses `mkdocs` to generate its documentation page. Therefore building a local copy of the doc page may be done using `mkdocs build -f docs/mkdocs.yml`. However once again things are easier with `nox`. You can easily build and serve locally a version of the documentation site using:\n\n```bash\n\u003e\u003e\u003e nox -s docs\nnox \u003e Running session docs-3.7\nnox \u003e Creating conda env in .nox\\docs-3-7 with python=3.7\nnox \u003e [docs] Installing requirements with pip: ['mkdocs-material', 'mkdocs', 'pymdown-extensions', 'pygments']\nnox \u003e python -m pip install mkdocs-material mkdocs pymdown-extensions pygments\nnox \u003e mkdocs serve -f ./docs/mkdocs.yml\nINFO    -  Building documentation...\nINFO    -  Cleaning site directory\nINFO    -  The following pages exist in the docs directory, but are not included in the \"nav\" configuration:\n  - long_description.md\nINFO    -  Documentation built in 1.07 seconds\nINFO    -  Serving on http://127.0.0.1:8000\nINFO    -  Start watching changes\n...\n```\n\nWhile this is running, you can edit the files under `./docs/` and browse the automatically refreshed documentation at the local [http://127.0.0.1:8000](http://127.0.0.1:8000) page.\n\nOnce you are done, simply hit `\u003cCTRL+C\u003e` to stop the session.\n\nPublishing the documentation (including tests and coverage reports) is done automatically by [the continuous integration engine](https://github.com/smarie/python-pyfields/actions), using the `nox -s publish` session, this is not needed for local development.\n\n## Packaging\n\nThis project uses `setuptools_scm` to synchronise the version number. Therefore the following command should be used for development snapshots as well as official releases: `python setup.py sdist bdist_wheel`. However this is not generally needed since [the continuous integration engine](https://github.com/smarie/python-pyfields/actions) does it automatically for us on git tags. For reference, this is done in the `nox -s release` session.\n\n### Merging pull requests with edits - memo\n\nAx explained in github ('get commandline instructions'):\n\n```bash\ngit checkout -b \u003cgit_name\u003e-\u003cfeature_branch\u003e master\ngit pull https://github.com/\u003cgit_name\u003e/python-pyfields.git \u003cfeature_branch\u003e --no-commit --ff-only\n```\n\nif the second step does not work, do a normal auto-merge (do not use **rebase**!):\n\n```bash\ngit pull https://github.com/\u003cgit_name\u003e/python-pyfields.git \u003cfeature_branch\u003e --no-commit\n```\n\nFinally review the changes, possibly perform some modifications, and commit.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarie%2Fpython-pyfields","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmarie%2Fpython-pyfields","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarie%2Fpython-pyfields/lists"}