{"id":41435639,"url":"https://github.com/ecmwf-projects/cads-broker","last_synced_at":"2026-04-16T12:01:04.430Z","repository":{"id":180425986,"uuid":"506810100","full_name":"ecmwf-projects/cads-broker","owner":"ecmwf-projects","description":"CADS broker service","archived":false,"fork":false,"pushed_at":"2026-04-13T13:47:24.000Z","size":903,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-04-13T15:30:15.720Z","etag":null,"topics":["cads"],"latest_commit_sha":null,"homepage":"","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/ecmwf-projects.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":"2022-06-23T22:34:43.000Z","updated_at":"2026-04-03T07:38:55.000Z","dependencies_parsed_at":"2023-12-19T03:03:11.099Z","dependency_job_id":"6f898929-c63a-4bf9-a656-575c726ab6b3","html_url":"https://github.com/ecmwf-projects/cads-broker","commit_stats":{"total_commits":425,"total_committers":9,"mean_commits":47.22222222222222,"dds":"0.35764705882352943","last_synced_commit":"bc533997df4fd3d08c92a2f375d38a2d3178d586"},"previous_names":["ecmwf-projects/cads-broker"],"tags_count":75,"template":false,"template_full_name":null,"purl":"pkg:github/ecmwf-projects/cads-broker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecmwf-projects%2Fcads-broker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecmwf-projects%2Fcads-broker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecmwf-projects%2Fcads-broker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecmwf-projects%2Fcads-broker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecmwf-projects","download_url":"https://codeload.github.com/ecmwf-projects/cads-broker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecmwf-projects%2Fcads-broker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31884929,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T11:36:10.202Z","status":"ssl_error","status_checked_at":"2026-04-16T11:36:09.652Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cads"],"created_at":"2026-01-23T14:37:27.883Z","updated_at":"2026-04-16T12:01:04.404Z","avatar_url":"https://github.com/ecmwf-projects.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cads-broker\n\nCADS broker service\n\n## Quick Start\n\n```python\n\u003e\u003e\u003e import cads_broker\n\n```\n\n## Workflow for developers/contributors\n\nFor best experience create a new conda environment (e.g. DEVELOP) with Python 3.12:\n\n```\nconda create -n DEVELOP -c conda-forge python=3.12\nconda activate DEVELOP\n```\n\nBefore pushing to GitHub, run the following commands:\n\n1. Update conda environment: `make conda-env-update`\n1. Install this package: `pip install -e .`\n1. Sync with the latest [template](https://github.com/ecmwf-projects/cookiecutter-conda-package) (optional): `make template-update`\n1. Run quality assurance checks: `make qa`\n1. Run tests: `make unit-tests`\n1. Run the static type checker: `make type-check`\n1. Build the documentation (see [Sphinx tutorial](https://www.sphinx-doc.org/en/master/tutorial/)): `make docs-build`\n\n### Instructions for creating a new database version\n\nThe package `cads-broker` comes with its 'broker' database.\nIn case of database structure upgrade, developers must follow these steps:\n\n1. Update the new database structure modifying [/cads_broker/database.py](/cads_broker/database.py), using\n   [SQLAlchemy ORM technologies](https://docs.sqlalchemy.org/en/latest/orm/)\n1. Execute from the cads-broker work folder:\n   ```\n   alembic revision -m \"message about the db modification\"\n   ```\n1. The last command will create a new python file inside [/alembic/versions](/alembic/versions). Fill the `upgrade`\n   function with the operations that must be executed to migrate the database from the old structure to the new one.\n   Keep in mind both DDL (structure modification) and DML (data modification) instructions. For reference,\n   use https://alembic.sqlalchemy.org/en/latest/ops.html#ops.\n   Similarly, do the same with the `downgrade` function.\n1. Commit and push the modifications and the new file.\n\n### Instructions for moving between different database versions\n\nThe package comes with its own 'broker-alembic-cli' script in order to move between different\ndatabase versions. This script is a slight modified version of the 'alembic' script, overriding\ndefault config path used ([/alembic.ini](/alembic.ini)) and the sqlalchemy.url used, that is\nautomatically computed by the environment and not read from any ini file.\n\nAll the database releases where you can migrate up and down must be defined by files contained inside\nthe folder [/alembic/versions](/alembic/versions). All these files are in a version queue: each file has\nlink to its revision hash (variable 'revision', the prefix of the file name) and to the next older one\n(variable 'down_revision'), and contains code to step up and down that database version.\\\nSome useful commands are listed below.\n\n- To migrate to the newest version, type:\\\n  `broker-alembic-cli upgrade head`\n- To upgrade to a specific version hash, for example 8ccbe515155c, type:\\\n  `broker-alembic-cli upgrade 8ccbe515155c`\n- To downgrade to a specific version hash, for example 8ccbe515155c, type:\\\n  `broker-alembic-cli downgrade 8ccbe515155c`\n- To get the current version hash of the database, type:\\\n  `broker-alembic-cli current`\n\nDatabase migration changes could be applied to the cacholote component of the database, too. In such case,\nmigrate the cacholote component after the migration by the 'broker-alembic-cli' tool.\n\nOther details are the same of the standard alembic migration tool,\nsee the [Alembic tutorial](https://alembic.sqlalchemy.org/en/latest/tutorial.html).\n\nFor details about the alembic migration tool, see the [Alembic tutorial](https://alembic.sqlalchemy.org/en/latest/tutorial.html).\n\n## Quality of Service rules examples\n\n```\n# User limits\n# user \"Limit for anonymous\"       (user == \"anonymous\") : numberOfWorkers\n# user \"Default per-user limit\"   (user ~ \".*\")        : 8\n\n# limits for finished requests in the last hours\n# user \"Limit for test user 1: 10 finished requests in the last 24 hours\" (user == \"00000000-0000-4000-a000-000000000000\")   : 10 - userRequestCount(hour(24))\n# user \"Limit for users: 10 finished requests in the last 24 hours\" (user ~ \".*\")   : 10 - userRequestCount(hour(24))\n\n# Limits\n# limit \"Limit for dummy-dataset\"    (dataset == \"test-dummy-adaptor\")      : numberOfWorkers\n# limit \"Limit for cads_adaptors:DummyAdaptor\" (adaptor == \"cads_adaptors:DummyAdaptor\")   : numberOfWorkers - 6\n\n# Permissions\n# permission \"anonymous cannot access dummy-dataset\"  (dataset == \"test-dummy-adaptor\"): user != 'anonymous'\n\n# Priorities\npriority \"Priority for test user 1\"    (user == \"00000000-0000-4000-a000-000000000000\")  :  hour(1)\npriority \"Priority for test user 2\"    (user == \"00000000-0000-3000-abcd-000000000001\")  :  -hour(1)\n\n# Functions examples\n\n# Request contains any of the specified variable\n# priority \"Priority for temperature and humidity\" (request_contains_any(\"variable\", [\"temperature\", \"relative_humidity\"])): -hour(1)\n\n# Request contains all the specified months\n# limit \"Limit for retrieve with all months\" (request_contains_all(\"month\", [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"])): 2\n\n# The adaptor is tagged with \"block\"\n# permission \"The adaptor is blocked.\" (tagged(\"block\")): false\n\n```\n\n## License\n\n```\nCopyright 2022, European Union.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecmwf-projects%2Fcads-broker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecmwf-projects%2Fcads-broker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecmwf-projects%2Fcads-broker/lists"}