{"id":26404496,"url":"https://github.com/nsls2/nsls2api","last_synced_at":"2026-05-16T23:03:19.510Z","repository":{"id":181108349,"uuid":"666166385","full_name":"NSLS2/nsls2api","owner":"NSLS2","description":"NSLS-II Facility API","archived":false,"fork":false,"pushed_at":"2024-05-22T11:43:58.000Z","size":4728,"stargazers_count":0,"open_issues_count":9,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-22T16:15:34.673Z","etag":null,"topics":["api","facility","fastapi"],"latest_commit_sha":null,"homepage":"https://api.nsls2.bnl.gov","language":"JavaScript","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/NSLS2.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":"2023-07-13T21:46:59.000Z","updated_at":"2024-05-29T01:22:12.323Z","dependencies_parsed_at":"2024-02-14T20:11:25.311Z","dependency_job_id":"ab37ab54-bc7f-43ec-9d0e-3851bb8b354b","html_url":"https://github.com/NSLS2/nsls2api","commit_stats":null,"previous_names":["stuartcampbell/nsls2api"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSLS2%2Fnsls2api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSLS2%2Fnsls2api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSLS2%2Fnsls2api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSLS2%2Fnsls2api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NSLS2","download_url":"https://codeload.github.com/NSLS2/nsls2api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244069634,"owners_count":20393062,"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":["api","facility","fastapi"],"created_at":"2025-03-17T16:36:14.919Z","updated_at":"2026-05-16T23:03:19.504Z","avatar_url":"https://github.com/NSLS2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NSLS-II Facility API\n\nThis is the repository for the NSLS-II Facility API codebase.\n\n## Current Status\n\n[![Integration Tests for Deployed API](https://github.com/NSLS2/nsls2api/actions/workflows/test-production-deployment.yml/badge.svg)](https://github.com/NSLS2/nsls2api/actions/workflows/test-production-deployment.yml)\n\n[![Integration Tests for DEV API](https://github.com/NSLS2/nsls2api/actions/workflows/test-dev-deployment.yml/badge.svg)](https://github.com/NSLS2/nsls2api/actions/workflows/test-dev-deployment.yml)\n\n[![Data Consistency Checks between DEV and PROD APIs](https://github.com/NSLS2/nsls2api/actions/workflows/data-consistency-workflow.yml/badge.svg)](https://github.com/NSLS2/nsls2api/actions/workflows/data-consistency-workflow.yml)\n\n\n## Developer Notes\n\nIn order to develop locally you will need to have a local MongoDB running.  \nThis can be installed using your preferred method, a native install\nor [running a container](https://hub.docker.com/_/mongo) work perfectly fine.\n\nOnce you have MongoDB up and running you then need to 'seed' the facility and beamline information that\ndoes not get pulled from any other source.\n\nThe files for the collections can be found within the `/nsls2/software/dssi/nsls2core/nsls2core-development.tgz`\n\n1. Copy and unpack the archive into a directory (e.g. `nsls2core-development`) to your development machine\n\n2. Import facility information into the local mongodb```\n   ```bash\n   mongorestore --uri=\"mongodb://localhost:27017\" --nsFrom=nsls2core-development.facilities --nsTo=nsls2core-development.facilities ./nsls2core-development/facilities.bson\n   ```\n3. Import beamline information into the local mongodb\n   ```bash\n   mongorestore --uri=\"mongodb://localhost:27017\" --nsFrom=nsls2core-development.beamlines --nsTo=nsls2core-development.beamlines ./nsls2core-development/beamlines.bson\n   ```\n\nYou will then need to create a `.env` file that contains the configuration (an example can also be found in the same\ndirectory as the json files).\n\n1. Copy `/nsls2/software/dssi/nsls2core/.env.development` to your local machine\n2. Rename to `.env` and place in the `src/nsls2api` directory in your cloned repo (in the same folder as `main.py`)\n3. Ensure that you have the `bnlroot.crt` file (which is deployed to all BNL managed machines) in the location specified\n   within the `.env` file.\n\n### Code Style\n\nThis project uses `ruff` to format the code - in order to run the formatter simply type:\n```bash\n   uvx ruff format\n```\n### Code Linting\n\nThis project uses `ruff` to check the code - in order to run the linter simply type:\n```bash\n   uvx ruff check\n```\n\n\n### Updating Dependencies\n\nThe project uses `uv pip compile` to manage the `requirements.txt` and `requirements-dev.txt` files.\n\nIn order to upgrade the packages versions you will need to simply run\n\n```\nuv pip compile requirements-dev.in --upgrade -o requirements-dev.txt\nuv pip compile requirements.in --upgrade -o requirements.txt\n```\n\nThen in order to actually upgrade the packages \n```\nuv pip install -r requirements-dev.txt\nuv pip install -r requirements.txt\n```\nOf course, you can drop the `uv` from these last commands if you want to wait longer. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsls2%2Fnsls2api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnsls2%2Fnsls2api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsls2%2Fnsls2api/lists"}