{"id":25895486,"url":"https://github.com/diamondlightsource/aapy","last_synced_at":"2025-03-02T22:31:45.550Z","repository":{"id":40955361,"uuid":"100491778","full_name":"DiamondLightSource/aapy","owner":"DiamondLightSource","description":"Python API for fetching data from the EPICS Archiver Appliance","archived":false,"fork":false,"pushed_at":"2024-07-15T11:19:06.000Z","size":10688,"stargazers_count":2,"open_issues_count":7,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-15T01:50:39.854Z","etag":null,"topics":["from-dls-controls"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DiamondLightSource.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":"2017-08-16T13:22:15.000Z","updated_at":"2024-07-15T11:19:12.000Z","dependencies_parsed_at":"2024-09-07T09:19:22.338Z","dependency_job_id":"992b3bbe-0b54-4a97-bd0a-c2625fe0f72f","html_url":"https://github.com/DiamondLightSource/aapy","commit_stats":null,"previous_names":["dls-controls/aapy"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Faapy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Faapy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Faapy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Faapy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiamondLightSource","download_url":"https://codeload.github.com/DiamondLightSource/aapy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241582515,"owners_count":19985845,"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":["from-dls-controls"],"created_at":"2025-03-02T22:31:34.387Z","updated_at":"2025-03-02T22:31:45.524Z","avatar_url":"https://github.com/DiamondLightSource.png","language":"Python","readme":"[![Build Status](https://travis-ci.org/dls-controls/aapy.svg?branch=travis)](https://travis-ci.org/dls-controls/aapy) [![Coverage Status](https://coveralls.io/repos/github/dls-controls/aapy/badge.svg?branch=master)](https://coveralls.io/github/dls-controls/aapy?branch=master)\n\nPython code to retrieve data from the\n[EPICS Archiver Appliance](https://slacmshankar.github.io/epicsarchiver_docs/).\n\n## Usage\n\n### Note on timezones\n\nWhen you pass a datetime to aapy it doesn't know by default what timezone\nthat datetime is supposed to be in. It will assume that it is the local\ntimezone, but will print a warning. If you pass it a timezone-aware\ndatetime no warning will be printed. You can use `utc_datetime()` as\na shortcut:\n\n    \u003e\u003e\u003e from aa.utils import utc_datetime\n    \u003e\u003e\u003e utc_datetime(2019, 10, 7, 17) # 5pm UTC on 7th October 2019\n\n### Fetching data\n\nTo retrieve data, create the appropriate fetcher\n\n    \u003e\u003e\u003e from aa.js import JsonFetcher\n    \u003e\u003e\u003e jf = JsonFetcher('archappl.diamond.ac.uk', 80)\n\nYou can request a single event, returning an ArchiveEvent object:\n\n    \u003e\u003e\u003e from datetime import datetime\n    \u003e\u003e\u003e event = jf.get_event_at('SR-DI-DCCT-01:SIGNAL', datetime.now())\n    WARNING:root:Assuming timezone for 2019-10-07 16:42:13.301672 is Europe/London\n    Archive event for PV SR-DI-DCCT-01:SIGNAL: timestamp 2019-10-07\n    15:42:04.876639 UTC value [301.33007915] severity 0\n    \u003e\u003e\u003e event.value\n    array([300.77982715])\n    \u003e\u003e\u003e event.utc_datetime\n    datetime.datetime(2019, 10, 7, 16, 2, 54, 928836, tzinfo=\u003cUTC\u003e)\n\n\nYou can also request a range of events, returning an ArchiveData object:\n\n    \u003e\u003e\u003e data = jf.get_values('SR-DI-DCCT-01:SIGNAL', utc_datetime(2018, 1, 7), utc_datetime(2018, 1, 8))\n    \u003e\u003e\u003e data.values\n    array([[2.51189843e-03],\n       [1.56371643e-03],\n       [5.54392030e-04],\n       ...,\n       [2.77373366e+02],\n       [2.77329542e+02],\n       [2.77287664e+02]])\n    \u003e\u003e\u003e data.utc_datetimes\n    array([datetime.datetime(2018, 1, 6, 23, 59, 59, 3897, tzinfo=\u003cUTC\u003e),\n       datetime.datetime(2018, 1, 7, 0, 0, 2, 3975, tzinfo=\u003cUTC\u003e),\n       datetime.datetime(2018, 1, 7, 0, 0, 5, 4066, tzinfo=\u003cUTC\u003e), ...,\n       datetime.datetime(2018, 1, 7, 23, 59, 53, 3885, tzinfo=\u003cUTC\u003e),\n       datetime.datetime(2018, 1, 7, 23, 59, 56, 3825, tzinfo=\u003cUTC\u003e),\n       datetime.datetime(2018, 1, 7, 23, 59, 59, 3726, tzinfo=\u003cUTC\u003e)],\n      dtype=object)\n    \u003e\u003e\u003e len(data)\n    28764\n\n\n## Development\n\naapy uses Pipenv to manage its dependencies.\n\nTo install development requirements:\n\n    pipenv install --dev\n\nTo run the tests and static checks:\n\n    pipenv run tests\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiamondlightsource%2Faapy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiamondlightsource%2Faapy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiamondlightsource%2Faapy/lists"}