{"id":21996926,"url":"https://github.com/spraakbanken/metadata-api","last_synced_at":"2026-03-01T09:32:04.855Z","repository":{"id":53596256,"uuid":"218517263","full_name":"spraakbanken/metadata-api","owner":"spraakbanken","description":"REST-API that serves meta data for SB's corpora and lexicons","archived":false,"fork":false,"pushed_at":"2026-01-13T12:13:51.000Z","size":503,"stargazers_count":1,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-13T15:25:12.145Z","etag":null,"topics":["flask","python3","rest-api"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spraakbanken.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-10-30T11:59:01.000Z","updated_at":"2025-12-08T13:37:48.000Z","dependencies_parsed_at":"2024-03-27T12:46:04.714Z","dependency_job_id":null,"html_url":"https://github.com/spraakbanken/metadata-api","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/spraakbanken/metadata-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spraakbanken%2Fmetadata-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spraakbanken%2Fmetadata-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spraakbanken%2Fmetadata-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spraakbanken%2Fmetadata-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spraakbanken","download_url":"https://codeload.github.com/spraakbanken/metadata-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spraakbanken%2Fmetadata-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29965586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T06:55:38.174Z","status":"ssl_error","status_checked_at":"2026-03-01T06:53:04.810Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["flask","python3","rest-api"],"created_at":"2024-11-29T22:13:32.173Z","updated_at":"2026-03-01T09:32:04.844Z","avatar_url":"https://github.com/spraakbanken.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Språkbanken Text Metadata API\n\nThe Språkbanken Text Metadata API is a RESTful web service that provides access to metadata for various resources\nmaintained by Språkbanken Text, including corpora, lexicons, models, analyses, and utilities. The metadata is stored in\nYAML files in a separate [metadata repository](https://github.com/spraakbanken/metadata).\n\nFor more technical details please refer to the [developer documentation](docs/dev-docs.md).\n\n## API Usage\n\nAvailable API calls (please note that the URL contains the API version, e.g. `/v3`, `/dev` etc):\n\n| Endpoint | Description |\n|----------|-------------|\n| 📁 [/](https://ws.spraakbanken.gu.se/ws/metadata/v3/) | List all resources |\n| 📁 [/?resource-type=[resource-type]](https://ws.spraakbanken.gu.se/ws/metadata/v3/?resource-type=corpus) | List all resources of a specific type.\u003cbr\u003eAvailable types: `corpus`, `lexicon`, `model`, `analysis`, `utility`, `collection` |\n| 📁 [/list-ids](https://ws.spraakbanken.gu.se/ws/metadata/v3/list-ids) | List all existing resource IDs |\n| 🔍 [/?resource=saldo](https://ws.spraakbanken.gu.se/ws/metadata/v3/?resource=saldo) | Retrieve a specific resource and its description (if available) |\n| 🔍 [/bibtex?resource=[resource-id]](https://ws.spraakbanken.gu.se/ws/metadata/v3/bibtex?resource=attasidor) | Return BibTeX citation for the specified resource |\n| 🔍 [/check-id-availability?id=[resource-id]](https://ws.spraakbanken.gu.se/ws/metadata/v3/check-id-availability?id=attasidor) | Check if a given resource ID is available |\n| 🔧 [/renew-cache](https://ws.spraakbanken.gu.se/ws/metadata/v3/renew-cache) | Update all metadata files from git, re-process JSON, and update cache.|\n| 🔧 [/renew-cache?resource-paths=[resource-type]/[resource-id]](https://ws.spraakbanken.gu.se/ws/metadata/v3/renew-cache?resource-paths=corpus/attasidor) | Update cache for specific resources, e.g.:\u003cbr\u003e\u003ccode\u003eresource-paths=corpus/attasidor,lexicon/saldo\u003c/code\u003e|\n| 📘 [/schema](https://ws.spraakbanken.gu.se/ws/metadata/v3/schema) | Return JSON schema for resources |\n| 📘 [/openapi.json](https://ws.spraakbanken.gu.se/ws/metadata/v3/openapi.json) | Serve API documentation as JSON |\n\n## Requirements\n\n- [Python 3.11](https://docs.python.org/3.11/) or newer\n- [Redis](https://redis.io/) (used for Celery background tasks)\n- [Memcached](https://memcached.org/) (for optional caching, check [caching.md](docs/caching.md) for more info)\n\n## Installation\n\nTo install the dependencies, we recommend using [uv](https://docs.astral.sh/uv/).\n\n1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/) if you don't have it already.\n2. While in the metadata-api directory, run:\n\n   ```sh\n   uv sync --no-install-project\n   ```\n\n   This will create a virtual environment in the `.venv` directory and install the dependencies listed in\n   `pyproject.toml`.\n\nAlternatively, you can set up a virtual environment manually using Python's built-in `venv` module and install the\ndependencies using pip:\n\n```sh\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -e .\n```\n\n## Configuration\n\nThe default configuration is specified in [`metadata_api/settings.py`](metadata_api/settings.py). You can override these\nsettings using environment variables or by creating a local `.env` file in the project's root directory. Common\nconfiguration options include:\n\n- `LOG_LEVEL` (default: `INFO`)\n- `LOG_TO_FILE` (default: `True`): Logs always go to stdout; if `True`, they are also saved to\n  `logs/metadata_api_\u003cDATE\u003e.log`.\n- `ROOT_PATH`: The root path for the API, e.g., \"/metadata-api\" if served from a subpath.\n- `METADATA_DIR`: Absolute path to the directory containing the [metadata YAML\n  files](https://github.com/spraakbanken/metadata).\n- `CELERY_BROKER_URL`: URL for the Celery broker used for background tasks.\n- `MEMCACHED_SERVER`: Host and port of the Memcached server, or path to the socket file.\n- `SLACK_WEBHOOK`: URL to a Slack webhook for error notifications (optional).\n\nExample `.env` file:\n\n```env\nLOG_LEVEL=DEBUG\nLOG_TO_FILE=False\nROOT_PATH=\"/metadata-api\"\nMETADATA_DIR=\"/path-to-metadata-dir\"\nCELERY_BROKER_URL=\"redis://localhost:6379/1\"\nMEMCACHED_SERVER=\"localhost:11211\"  # Set to None to disable caching\nSLACK_WEBHOOK=\"https://hooks.slack.com/services/...\"\n```\n\n## Running a test server\n\nFor testing purposes, you can run the app using the following script (with an activated virtual environment, or by\nprefixing with `uv run`). The default settings when using `run.py` are:\n\n- Host/port: `127.0.0.1:8000`\n- `ENV=development`\n- `LOG_LEVEL=DEBUG`\n- `LOG_TO_FILE=False` (logs to console only)\n- `reload=True` (auto-restart on code changes)\n\n```bash\npython run.py [--host HOST] [--port PORT] [--log-level LOG_LEVEL]\n```\n\nIf you prefer to run the app with `uvicorn`, you can use the following command:\n\n```bash\nuvicorn metadata_api.main:app\n```\n\nYou also need to have a running Celery worker for background tasks. You can start a worker with:\n\n```bash\ncelery -A metadata_api.tasks worker --loglevel=INFO\n```\n\nPlease note that you need to have a running [Redis](https://redis.io/) server for Celery to work.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspraakbanken%2Fmetadata-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspraakbanken%2Fmetadata-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspraakbanken%2Fmetadata-api/lists"}