# aind-metadata-service
[](LICENSE)

REST service to retrieve metadata from databases.
## Installation
### Server Installation
Can be pip installed using `pip install aind-metadata-service[server]`.
Installing `pyodbc`.
- You may need to install `unixodbc-dev`. You can follow this [https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16](link) for instructions depending on your os.
- You may need to run `docker system prune` before building the docker image if you're getting erros running apt-get:
```
#10 23.69 Err:1 http://deb.debian.org/debian bullseye/main amd64 libodbc1 amd64 2.3.6-0.1+b1
#10 23.69 Could not connect to debian.map.fastlydns.net:80 (146.75.42.132). - connect (111: Connection refused) Unable to connect to deb.debian.org:http:
```
### Client Installation
Can be pip installed with `pip install aind-metadata-service[client]`
### For Development
In the root directory, run
```
pip install -e .[dev]
```
## Contributing
### Linters and testing
There are several libraries used to run linters, check documentation, and run tests.
- Please test your changes using the **coverage** library, which will run the tests and log a coverage report:
```
coverage run -m unittest discover && coverage report
```
- Use **interrogate** to check that modules, methods, etc. have been documented thoroughly:
```
interrogate .
```
- Use **flake8** to check that code is up to standards (no unused imports, etc.):
```
flake8 .
```
- Use **black** to automatically format the code into PEP standards:
```
black .
```
- Use **isort** to automatically sort import statements:
```
isort .
```
### Pull requests
For internal members, please create a branch. For external members, please fork the repo and open a pull request from the fork. We'll primarily use [Angular](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit) style for commit messages. Roughly, they should follow the pattern:
```
<type>(<scope>): <short summary>
```
where scope (optional) describes the packages affected by the code changes and type (mandatory) is one of:
- **build**: Changes that affect the build system or external dependencies (example scopes: pyproject.toml, setup.py)
- **ci**: Changes to our CI configuration files and scripts (examples: .github/workflows/ci.yml)
- **docs**: Documentation only changes
- **feat**: A new feature
- **fix**: A bug fix
- **perf**: A code change that improves performance
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **test**: Adding missing tests or correcting existing tests
### Documentation
To generate the rst files source files for documentation, run
```
sphinx-apidoc -o doc_template/source/ src
```
Then to create the documentation html files, run
```
sphinx-build -b html doc_template/source/ doc_template/build/html
```
More info on sphinx installation can be found here: https://www.sphinx-doc.org/en/master/usage/installation.html
### Responses
There are 6 possible status code responses for aind-metadata-service:
- **200**: successfully retrieved valid data without any problems.
- **406**: successfully retrieved some data, but failed to validate against pydantic models.
- **404**: found no data that matches query.
- **300**: queried the server, but more items were returned than expected.
- **503**: failed to connect to labtracks/sharepoint servers.
- **500**: successfully connected to labtracks/sharepoint, but some other server error occurred.
These status codes are defined in StatusCodes enum in response_handler.py
Raw data
{
"_id": null,
"home_page": null,
"name": "aind-metadata-service",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Allen Institute for Neural Dynamics",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/3b/07/0b71adce772bce4a56544e5a708ee273fa6f8b62636593dd7e665b3f3d67/aind_metadata_service-0.19.2.tar.gz",
"platform": null,
"description": "# aind-metadata-service\n\n[](LICENSE)\n\n\nREST service to retrieve metadata from databases.\n\n## Installation\n\n### Server Installation\n\nCan be pip installed using `pip install aind-metadata-service[server]`.\n\nInstalling `pyodbc`.\n- You may need to install `unixodbc-dev`. You can follow this [https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16](link) for instructions depending on your os.\n\n- You may need to run `docker system prune` before building the docker image if you're getting erros running apt-get:\n```\n#10 23.69 Err:1 http://deb.debian.org/debian bullseye/main amd64 libodbc1 amd64 2.3.6-0.1+b1\n#10 23.69 Could not connect to debian.map.fastlydns.net:80 (146.75.42.132). - connect (111: Connection refused) Unable to connect to deb.debian.org:http:\n\n```\n\n### Client Installation\n\nCan be pip installed with `pip install aind-metadata-service[client]`\n\n### For Development\n\nIn the root directory, run\n```\npip install -e .[dev]\n```\n\n## Contributing\n\n### Linters and testing\n\nThere are several libraries used to run linters, check documentation, and run tests.\n\n- Please test your changes using the **coverage** library, which will run the tests and log a coverage report:\n\n```\ncoverage run -m unittest discover && coverage report\n```\n\n- Use **interrogate** to check that modules, methods, etc. have been documented thoroughly:\n\n```\ninterrogate .\n```\n\n- Use **flake8** to check that code is up to standards (no unused imports, etc.):\n```\nflake8 .\n```\n\n- Use **black** to automatically format the code into PEP standards:\n```\nblack .\n```\n\n- Use **isort** to automatically sort import statements:\n```\nisort .\n```\n\n### Pull requests\n\nFor internal members, please create a branch. For external members, please fork the repo and open a pull request from the fork. We'll primarily use [Angular](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit) style for commit messages. Roughly, they should follow the pattern:\n```\n<type>(<scope>): <short summary>\n```\n\nwhere scope (optional) describes the packages affected by the code changes and type (mandatory) is one of:\n\n- **build**: Changes that affect the build system or external dependencies (example scopes: pyproject.toml, setup.py)\n- **ci**: Changes to our CI configuration files and scripts (examples: .github/workflows/ci.yml)\n- **docs**: Documentation only changes\n- **feat**: A new feature\n- **fix**: A bug fix\n- **perf**: A code change that improves performance\n- **refactor**: A code change that neither fixes a bug nor adds a feature\n- **test**: Adding missing tests or correcting existing tests\n\n### Documentation\nTo generate the rst files source files for documentation, run\n```\nsphinx-apidoc -o doc_template/source/ src \n```\nThen to create the documentation html files, run\n```\nsphinx-build -b html doc_template/source/ doc_template/build/html\n```\nMore info on sphinx installation can be found here: https://www.sphinx-doc.org/en/master/usage/installation.html\n\n### Responses\nThere are 6 possible status code responses for aind-metadata-service:\n- **200**: successfully retrieved valid data without any problems. \n- **406**: successfully retrieved some data, but failed to validate against pydantic models.\n- **404**: found no data that matches query.\n- **300**: queried the server, but more items were returned than expected.\n- **503**: failed to connect to labtracks/sharepoint servers.\n- **500**: successfully connected to labtracks/sharepoint, but some other server error occurred.\nThese status codes are defined in StatusCodes enum in response_handler.py\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "REST service to retrive metadata from databases.",
"version": "0.19.2",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f5dd43fd936d76b1b5e720c4e880ee4c4865a69280b551902ee562678cfc7a03",
"md5": "20e99e1a52b827dca7f9f323d6531081",
"sha256": "6a54add0ac0f592a693854376e4bcf49cd7cc9fd10889c0bd3bd105e84d48cc2"
},
"downloads": -1,
"filename": "aind_metadata_service-0.19.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "20e99e1a52b827dca7f9f323d6531081",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 125122,
"upload_time": "2025-02-10T19:32:22",
"upload_time_iso_8601": "2025-02-10T19:32:22.663643Z",
"url": "https://files.pythonhosted.org/packages/f5/dd/43fd936d76b1b5e720c4e880ee4c4865a69280b551902ee562678cfc7a03/aind_metadata_service-0.19.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3b070b71adce772bce4a56544e5a708ee273fa6f8b62636593dd7e665b3f3d67",
"md5": "5e31ad82801319b8f78506aa8726f231",
"sha256": "b48c1e008d081f87e85cfd7a0a2950198fd2711f10d1e37bbf0f3e08cf9975fb"
},
"downloads": -1,
"filename": "aind_metadata_service-0.19.2.tar.gz",
"has_sig": false,
"md5_digest": "5e31ad82801319b8f78506aa8726f231",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 187573,
"upload_time": "2025-02-10T19:32:23",
"upload_time_iso_8601": "2025-02-10T19:32:23.871781Z",
"url": "https://files.pythonhosted.org/packages/3b/07/0b71adce772bce4a56544e5a708ee273fa6f8b62636593dd7e665b3f3d67/aind_metadata_service-0.19.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-10 19:32:23",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "aind-metadata-service"
}