aind-metadata-extractor 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Allen Institute for Neural Dynamics
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.4
2
+ Name: aind-metadata-extractor
3
+ Version: 0.0.1
4
+ Summary: Generated from aind-library-template
5
+ Author: Allen Institute for Neural Dynamics
6
+ License: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: pydantic
12
+ Requires-Dist: pydantic-settings
13
+ Provides-Extra: dev
14
+ Requires-Dist: black; extra == "dev"
15
+ Requires-Dist: coverage; extra == "dev"
16
+ Requires-Dist: flake8; extra == "dev"
17
+ Requires-Dist: interrogate; extra == "dev"
18
+ Requires-Dist: isort; extra == "dev"
19
+ Requires-Dist: Sphinx; extra == "dev"
20
+ Requires-Dist: furo; extra == "dev"
21
+ Provides-Extra: smartspim
22
+ Requires-Dist: requests; extra == "smartspim"
23
+ Dynamic: license-file
24
+
25
+ # aind-metadata-extractor
26
+
27
+ [![License](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)
28
+ ![Code Style](https://img.shields.io/badge/code%20style-black-black)
29
+ [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
30
+ ![Interrogate](https://img.shields.io/badge/interrogate-100.0%25-brightgreen)
31
+ ![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)
32
+ ![Python](https://img.shields.io/badge/python->=3.10-blue?logo=python)
33
+
34
+ ## Usage
35
+ - To use this template, click the green `Use this template` button and `Create new repository`.
36
+ - After github initially creates the new repository, please wait an extra minute for the initialization scripts to finish organizing the repo.
37
+ - To enable the automatic semantic version increments: in the repository go to `Settings` and `Collaborators and teams`. Click the green `Add people` button. Add `svc-aindscicomp` as an admin. Modify the file in `.github/workflows/tag_and_publish.yml` and remove the if statement in line 65. The semantic version will now be incremented every time a code is committed into the main branch.
38
+ - To publish to PyPI, enable semantic versioning and uncomment the publish block in `.github/workflows/tag_and_publish.yml`. The code will now be published to PyPI every time the code is committed into the main branch.
39
+ - The `.github/workflows/test_and_lint.yml` file will run automated tests and style checks every time a Pull Request is opened. If the checks are undesired, the `test_and_lint.yml` can be deleted. The strictness of the code coverage level, etc., can be modified by altering the configurations in the `pyproject.toml` file and the `.flake8` file.
40
+ - Please make any necessary updates to the README.md and CITATION.cff files
41
+
42
+ ## Level of Support
43
+ Please indicate a level of support:
44
+ - [ ] Supported: We are releasing this code to the public as a tool we expect others to use. Issues are welcomed, and we expect to address them promptly; pull requests will be vetted by our staff before inclusion.
45
+ - [ ] Occasional updates: We are planning on occasional updating this tool with no fixed schedule. Community involvement is encouraged through both issues and pull requests.
46
+ - [ ] Unsupported: We are not currently supporting this code, but simply releasing it to the community AS IS but are not able to provide any guarantees of support. The community is welcome to submit issues, but you should not expect an active response.
47
+
48
+ ## Release Status
49
+ GitHub's tags and Release features can be used to indicate a Release status.
50
+
51
+ - Stable: v1.0.0 and above. Ready for production.
52
+ - Beta: v0.x.x or indicated in the tag. Ready for beta testers and early adopters.
53
+ - Alpha: v0.x.x or indicated in the tag. Still in early development.
54
+
55
+ ## Installation
56
+ To use the software, in the root directory, run
57
+ ```bash
58
+ pip install -e .
59
+ ```
60
+
61
+ To develop the code, run
62
+ ```bash
63
+ pip install -e .[dev]
64
+ ```
@@ -0,0 +1,40 @@
1
+ # aind-metadata-extractor
2
+
3
+ [![License](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)
4
+ ![Code Style](https://img.shields.io/badge/code%20style-black-black)
5
+ [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
6
+ ![Interrogate](https://img.shields.io/badge/interrogate-100.0%25-brightgreen)
7
+ ![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)
8
+ ![Python](https://img.shields.io/badge/python->=3.10-blue?logo=python)
9
+
10
+ ## Usage
11
+ - To use this template, click the green `Use this template` button and `Create new repository`.
12
+ - After github initially creates the new repository, please wait an extra minute for the initialization scripts to finish organizing the repo.
13
+ - To enable the automatic semantic version increments: in the repository go to `Settings` and `Collaborators and teams`. Click the green `Add people` button. Add `svc-aindscicomp` as an admin. Modify the file in `.github/workflows/tag_and_publish.yml` and remove the if statement in line 65. The semantic version will now be incremented every time a code is committed into the main branch.
14
+ - To publish to PyPI, enable semantic versioning and uncomment the publish block in `.github/workflows/tag_and_publish.yml`. The code will now be published to PyPI every time the code is committed into the main branch.
15
+ - The `.github/workflows/test_and_lint.yml` file will run automated tests and style checks every time a Pull Request is opened. If the checks are undesired, the `test_and_lint.yml` can be deleted. The strictness of the code coverage level, etc., can be modified by altering the configurations in the `pyproject.toml` file and the `.flake8` file.
16
+ - Please make any necessary updates to the README.md and CITATION.cff files
17
+
18
+ ## Level of Support
19
+ Please indicate a level of support:
20
+ - [ ] Supported: We are releasing this code to the public as a tool we expect others to use. Issues are welcomed, and we expect to address them promptly; pull requests will be vetted by our staff before inclusion.
21
+ - [ ] Occasional updates: We are planning on occasional updating this tool with no fixed schedule. Community involvement is encouraged through both issues and pull requests.
22
+ - [ ] Unsupported: We are not currently supporting this code, but simply releasing it to the community AS IS but are not able to provide any guarantees of support. The community is welcome to submit issues, but you should not expect an active response.
23
+
24
+ ## Release Status
25
+ GitHub's tags and Release features can be used to indicate a Release status.
26
+
27
+ - Stable: v1.0.0 and above. Ready for production.
28
+ - Beta: v0.x.x or indicated in the tag. Ready for beta testers and early adopters.
29
+ - Alpha: v0.x.x or indicated in the tag. Still in early development.
30
+
31
+ ## Installation
32
+ To use the software, in the root directory, run
33
+ ```bash
34
+ pip install -e .
35
+ ```
36
+
37
+ To develop the code, run
38
+ ```bash
39
+ pip install -e .[dev]
40
+ ```
@@ -0,0 +1,87 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "aind-metadata-extractor"
7
+ description = "Generated from aind-library-template"
8
+ license = {text = "MIT"}
9
+ requires-python = ">=3.10"
10
+ authors = [
11
+ {name = "Allen Institute for Neural Dynamics"}
12
+ ]
13
+ classifiers = [
14
+ "Programming Language :: Python :: 3"
15
+ ]
16
+ readme = "README.md"
17
+ dynamic = ["version"]
18
+
19
+ dependencies = [
20
+ 'pydantic',
21
+ 'pydantic-settings',
22
+ ]
23
+
24
+ [project.optional-dependencies]
25
+ dev = [
26
+ 'black',
27
+ 'coverage',
28
+ 'flake8',
29
+ 'interrogate',
30
+ 'isort',
31
+ 'Sphinx',
32
+ 'furo'
33
+ ]
34
+
35
+ smartspim = [
36
+ 'requests',
37
+ ]
38
+
39
+ [tool.setuptools.packages.find]
40
+ where = ["src"]
41
+
42
+ [tool.setuptools.dynamic]
43
+ version = {attr = "aind_metadata_extractor.__version__"}
44
+
45
+ [tool.black]
46
+ line-length = 120
47
+ target_version = ['py310']
48
+ exclude = '''
49
+
50
+ (
51
+ /(
52
+ \.eggs # exclude a few common directories in the
53
+ | \.git # root of the project
54
+ | \.hg
55
+ | \.mypy_cache
56
+ | \.tox
57
+ | \.venv
58
+ | _build
59
+ | build
60
+ | dist
61
+ | .conda
62
+ )/
63
+ | .gitignore
64
+ )
65
+ '''
66
+
67
+ [tool.coverage.run]
68
+ omit = ["*__init__*"]
69
+ source = ["aind_metadata_extractor", "tests"]
70
+
71
+ [tool.coverage.report]
72
+ exclude_lines = [
73
+ "if __name__ == .__main__.:",
74
+ "^from .* import .*",
75
+ "^import .*",
76
+ "pragma: no cover"
77
+ ]
78
+ fail_under = 100
79
+
80
+ [tool.isort]
81
+ line_length = 120
82
+ profile = "black"
83
+ skip = [".conda"]
84
+
85
+ [tool.interrogate]
86
+ exclude = ["setup.py", "docs", "build", ".conda"]
87
+ fail-under = 100
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,4 @@
1
+ from setuptools import setup
2
+
3
+ if __name__ == "__main__":
4
+ setup()
@@ -0,0 +1,2 @@
1
+ """Init package"""
2
+ __version__ = "0.0.1"
@@ -0,0 +1,98 @@
1
+ import argparse
2
+ from pydantic_settings import BaseSettings, EnvSettingsSource, InitSettingsSource, JsonConfigSettingsSource, PydanticBaseSettingsSource
3
+ from pydantic import Field
4
+ from typing import Optional, Union, List, Type, Tuple
5
+ from pathlib import Path
6
+
7
+
8
+ class BaseJobSettings(BaseSettings):
9
+ """Parent class for generating settings from a config file."""
10
+
11
+ job_settings_name: str = Field(
12
+ ...,
13
+ description=(
14
+ "Literal name for job settings to make serialized class distinct."
15
+ ),
16
+ )
17
+ input_source: Optional[Union[Path, str, List[str], List[Path]]] = Field(
18
+ default=None,
19
+ description=(
20
+ "Location or locations of data sources to parse for metadata."
21
+ ),
22
+ )
23
+ output_directory: Optional[Union[Path, str]] = Field(
24
+ default=None,
25
+ description=(
26
+ "Location to metadata file data to. None to return object."
27
+ ),
28
+ )
29
+
30
+ user_settings_config_file: Optional[Union[Path, str]] = Field(
31
+ default=None,
32
+ repr=False,
33
+ description="Optionally pull settings from a local config file.",
34
+ )
35
+
36
+ class Config:
37
+ """Pydantic config to exclude field from displaying"""
38
+
39
+ extra = "allow"
40
+ exclude = {"user_settings_config_file"}
41
+
42
+ @classmethod
43
+ def settings_customise_sources(
44
+ cls,
45
+ settings_cls: Type[BaseSettings],
46
+ init_settings: InitSettingsSource,
47
+ env_settings: EnvSettingsSource,
48
+ dotenv_settings: PydanticBaseSettingsSource,
49
+ file_secret_settings: PydanticBaseSettingsSource,
50
+ ) -> Tuple[PydanticBaseSettingsSource, ...]:
51
+ """
52
+ Customize the order of settings sources, including JSON file.
53
+ """
54
+ config_file = init_settings.init_kwargs.get(
55
+ "user_settings_config_file"
56
+ )
57
+ sources = [init_settings, env_settings]
58
+
59
+ if isinstance(config_file, str):
60
+ config_file = Path(config_file)
61
+
62
+ if config_file and config_file.is_file():
63
+ sources.append(JsonConfigSettingsSource(settings_cls, config_file))
64
+
65
+ return tuple(sources)
66
+
67
+ @classmethod
68
+ def from_args(cls, args: list):
69
+ """
70
+ Adds ability to construct settings from a list of arguments.
71
+ Parameters
72
+ ----------
73
+ args : list
74
+ A list of command line arguments to parse.
75
+ """
76
+
77
+ parser = argparse.ArgumentParser()
78
+ parser.add_argument(
79
+ "-j",
80
+ "--job-settings",
81
+ required=True,
82
+ type=str,
83
+ help=(
84
+ r"""
85
+ Custom settings defined by the user defined as a json
86
+ string. For example: -j
87
+ '{
88
+ "input_source":"/directory/to/read/from",
89
+ "output_directory":"/directory/to/write/to",
90
+ "job_settings_name": "Bergamo"}'
91
+ """
92
+ ),
93
+ )
94
+ job_args = parser.parse_args(args)
95
+ job_settings_from_args = cls.model_validate_json(job_args.job_settings)
96
+ return cls(
97
+ job_settings=job_settings_from_args,
98
+ )
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.4
2
+ Name: aind-metadata-extractor
3
+ Version: 0.0.1
4
+ Summary: Generated from aind-library-template
5
+ Author: Allen Institute for Neural Dynamics
6
+ License: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: pydantic
12
+ Requires-Dist: pydantic-settings
13
+ Provides-Extra: dev
14
+ Requires-Dist: black; extra == "dev"
15
+ Requires-Dist: coverage; extra == "dev"
16
+ Requires-Dist: flake8; extra == "dev"
17
+ Requires-Dist: interrogate; extra == "dev"
18
+ Requires-Dist: isort; extra == "dev"
19
+ Requires-Dist: Sphinx; extra == "dev"
20
+ Requires-Dist: furo; extra == "dev"
21
+ Provides-Extra: smartspim
22
+ Requires-Dist: requests; extra == "smartspim"
23
+ Dynamic: license-file
24
+
25
+ # aind-metadata-extractor
26
+
27
+ [![License](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)
28
+ ![Code Style](https://img.shields.io/badge/code%20style-black-black)
29
+ [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
30
+ ![Interrogate](https://img.shields.io/badge/interrogate-100.0%25-brightgreen)
31
+ ![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)
32
+ ![Python](https://img.shields.io/badge/python->=3.10-blue?logo=python)
33
+
34
+ ## Usage
35
+ - To use this template, click the green `Use this template` button and `Create new repository`.
36
+ - After github initially creates the new repository, please wait an extra minute for the initialization scripts to finish organizing the repo.
37
+ - To enable the automatic semantic version increments: in the repository go to `Settings` and `Collaborators and teams`. Click the green `Add people` button. Add `svc-aindscicomp` as an admin. Modify the file in `.github/workflows/tag_and_publish.yml` and remove the if statement in line 65. The semantic version will now be incremented every time a code is committed into the main branch.
38
+ - To publish to PyPI, enable semantic versioning and uncomment the publish block in `.github/workflows/tag_and_publish.yml`. The code will now be published to PyPI every time the code is committed into the main branch.
39
+ - The `.github/workflows/test_and_lint.yml` file will run automated tests and style checks every time a Pull Request is opened. If the checks are undesired, the `test_and_lint.yml` can be deleted. The strictness of the code coverage level, etc., can be modified by altering the configurations in the `pyproject.toml` file and the `.flake8` file.
40
+ - Please make any necessary updates to the README.md and CITATION.cff files
41
+
42
+ ## Level of Support
43
+ Please indicate a level of support:
44
+ - [ ] Supported: We are releasing this code to the public as a tool we expect others to use. Issues are welcomed, and we expect to address them promptly; pull requests will be vetted by our staff before inclusion.
45
+ - [ ] Occasional updates: We are planning on occasional updating this tool with no fixed schedule. Community involvement is encouraged through both issues and pull requests.
46
+ - [ ] Unsupported: We are not currently supporting this code, but simply releasing it to the community AS IS but are not able to provide any guarantees of support. The community is welcome to submit issues, but you should not expect an active response.
47
+
48
+ ## Release Status
49
+ GitHub's tags and Release features can be used to indicate a Release status.
50
+
51
+ - Stable: v1.0.0 and above. Ready for production.
52
+ - Beta: v0.x.x or indicated in the tag. Ready for beta testers and early adopters.
53
+ - Alpha: v0.x.x or indicated in the tag. Still in early development.
54
+
55
+ ## Installation
56
+ To use the software, in the root directory, run
57
+ ```bash
58
+ pip install -e .
59
+ ```
60
+
61
+ To develop the code, run
62
+ ```bash
63
+ pip install -e .[dev]
64
+ ```
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ src/aind_metadata_extractor/__init__.py
6
+ src/aind_metadata_extractor/core.py
7
+ src/aind_metadata_extractor.egg-info/PKG-INFO
8
+ src/aind_metadata_extractor.egg-info/SOURCES.txt
9
+ src/aind_metadata_extractor.egg-info/dependency_links.txt
10
+ src/aind_metadata_extractor.egg-info/requires.txt
11
+ src/aind_metadata_extractor.egg-info/top_level.txt
@@ -0,0 +1,14 @@
1
+ pydantic
2
+ pydantic-settings
3
+
4
+ [dev]
5
+ black
6
+ coverage
7
+ flake8
8
+ interrogate
9
+ isort
10
+ Sphinx
11
+ furo
12
+
13
+ [smartspim]
14
+ requests