{"id":31033308,"url":"https://github.com/isisneutronmuon/p4pillon","last_synced_at":"2025-09-14T01:44:00.532Z","repository":{"id":308393458,"uuid":"1020816301","full_name":"ISISNeutronMuon/p4pillon","owner":"ISISNeutronMuon","description":"Extensions and additional functionality for the p4p library","archived":false,"fork":false,"pushed_at":"2025-09-06T16:51:26.000Z","size":491,"stargazers_count":2,"open_issues_count":12,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-06T18:23:05.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ISISNeutronMuon.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-16T12:43:17.000Z","updated_at":"2025-09-06T16:03:44.000Z","dependencies_parsed_at":"2025-08-05T18:36:43.634Z","dependency_job_id":"e3a1cf89-8ba2-4bc8-8deb-36a6b23cc470","html_url":"https://github.com/ISISNeutronMuon/p4pillon","commit_stats":null,"previous_names":["isisneutronmuon/p4p_ext","isisneutronmuon/p4pillon"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ISISNeutronMuon/p4pillon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISISNeutronMuon%2Fp4pillon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISISNeutronMuon%2Fp4pillon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISISNeutronMuon%2Fp4pillon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISISNeutronMuon%2Fp4pillon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ISISNeutronMuon","download_url":"https://codeload.github.com/ISISNeutronMuon/p4pillon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISISNeutronMuon%2Fp4pillon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275051516,"owners_count":25396977,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-09-14T01:43:59.317Z","updated_at":"2025-09-14T01:44:00.522Z","avatar_url":"https://github.com/ISISNeutronMuon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# p4pillon\nExtensions to the [p4p](https://epics-base.github.io/p4p/) [Server API](https://epics-base.github.io/p4p/server.html), to aid in creation and managment of pvAccess servers.  \n\n[![p4pillon](https://github.com/ISISNeutronMuon/p4pillon/actions/workflows/build.yaml/badge.svg)](https://github.com/ISISNeutronMuon/p4pillon/actions/workflows/build.yaml)\n\n## Installation\np4pillon may be installed via \n```console\n$ pip install p4pillon\n```\n\n### Python Version\nRequires Python 3.10 or later. These extensions make extensive use of [typing](https://docs.python.org/3/library/typing.html) and other recent Python features.\n\n## Documentation\nDocumentation intended for developers using the library is available [here](https://isisneutronmuon.github.io/p4pillon/).  \n\n### Extensions\nA brief overview of the components of the library.\n\n#### NT Logic\n\u003e [!CAUTION]\n\u003e This is not an alternative to the Process Database implemented in a traditional EPICS IOC. Although the Normative Type logic is implemented, it does not implement locking. This means that in the case of multiple simultaneous updates it is possible for a PV to become inconsistent. At this time we suggest that the NT Logic code be used for rapid prototyping and systems where consistency/reliability are not critical.\n\nThe `SharedNT` class, derived from p4p's `SharedPV` class, automatically implements the logic of Normative Types (at this time NTScalars and NTScalarArrays) using handlers. It is possible, with the `CompositeHandler` class to override this behaviour, including diabling or replacing Normative Type logic.\n \n#### CompositeHandler and Rules\np4p only allows a single `Handler` class to be associated with a `SharedPV`. To make it easier to combine or share handlers from multiple sources a `CompositeHandler` class is provided. The supplied `CompositeHandler` is derived from the p4p `Handler`. It also derives from an OrderedDict to store componenent `Handler`s (also standard p4p `Handler`s). The `CompositeHandler` calls component handlers in the specified order, and allows the component `Handler`s to be accessed through the OrderedDict interface.\n\n\u003e [!NOTE]\n\u003e `CompositeHandler` is designed to work with the `Handler` class, and is **not** designed to work with the `Handler` decorators.\n\n`Rule`s are component `Handler`s used with the `CompositeHandler` used to implement the NT Logic discussed above. The `Rule` class is derived from the `Handler` class but implements a commonly encountered flow from `put()` (for identification and authorisation), to `put()` (for operations that require comparison between the current state of the PV and its possible future state), and `open()` (for operations that only need consider the possible future state of the PV).\n\n#### PVRecipe and Server\n`PVRecipe` is a factory method used to simplify creation of `SharedNT` objects, i.e. PVs that implement Normative Type logic. It may be used in conjunction with the p4pillon `Server` class to simplify management of event loops and PV lifecycle.\n\n#### \nThe `config_reader` parses a YAML file in order to construct `SharedNT` PVs which are managed by the p4pillon `Server`. This is the simplest way to create and configure \n\n## Testing\nInstall the extra dependencies required for testing using `pip install .[test]` or similar.\n\nTo run tests invoke [pytest](https://docs.pytest.org/en/latest/):\n\n```console\n$ python -m pytest tests\n```\nor to run all tests and output a coverage report:\n```\n$ uv run --extra=test python -m coverage run --source=. -m pytest -x tests\n$ uv run --extra=test python -m coverage report\n```\n\n### Linting and Formatting\nThis repository's CI/CD pipeling (using GitHub Actions) checks that source code meets PEP 8, and other more stringent, coding standards. This uses the [ruff](https://docs.astral.sh/ruff/) linter and code formatter. It is included in the `.[test] dependencies (see above) and may be manually invoked:\n\n```console\n$ ruff check --fix\n$ ruff format\n```\n\n## Releases\nThe release process requires use of the `.[dist]` dependencies, which may be installed with `pip install .[dist]`. A build may then be triggered with `python -m build`. Alternatively, use:\n\n```console\n$ uv run --extra=dist python -m build\n```\n\nPublication to either PyPi or TestPyPI is performed automatically via CI/CD (i.e. GitHub Actions) and is driven by tags. Any commit intended for package publication must be tagged with a unique tag, and the semantic version must be greater than any existing tag. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisisneutronmuon%2Fp4pillon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisisneutronmuon%2Fp4pillon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisisneutronmuon%2Fp4pillon/lists"}