aind-data-transfer-lite 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.
Files changed (33) hide show
  1. aind_data_transfer_lite-0.0.1/.flake8 +8 -0
  2. aind_data_transfer_lite-0.0.1/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  3. aind_data_transfer_lite-0.0.1/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  4. aind_data_transfer_lite-0.0.1/.github/ISSUE_TEMPLATE/user-story.md +27 -0
  5. aind_data_transfer_lite-0.0.1/.github/workflows/add_issue_to_project_board.yml +15 -0
  6. aind_data_transfer_lite-0.0.1/.github/workflows/tag_and_publish.yml +85 -0
  7. aind_data_transfer_lite-0.0.1/.github/workflows/test_and_lint.yml +26 -0
  8. aind_data_transfer_lite-0.0.1/.gitignore +139 -0
  9. aind_data_transfer_lite-0.0.1/CODE_OF_CONDUCT.md +133 -0
  10. aind_data_transfer_lite-0.0.1/LICENSE +21 -0
  11. aind_data_transfer_lite-0.0.1/PKG-INFO +166 -0
  12. aind_data_transfer_lite-0.0.1/README.md +141 -0
  13. aind_data_transfer_lite-0.0.1/pyproject.toml +86 -0
  14. aind_data_transfer_lite-0.0.1/setup.cfg +4 -0
  15. aind_data_transfer_lite-0.0.1/setup.py +4 -0
  16. aind_data_transfer_lite-0.0.1/src/aind_data_transfer_lite/__init__.py +3 -0
  17. aind_data_transfer_lite-0.0.1/src/aind_data_transfer_lite/models.py +78 -0
  18. aind_data_transfer_lite-0.0.1/src/aind_data_transfer_lite/upload_data.py +210 -0
  19. aind_data_transfer_lite-0.0.1/src/aind_data_transfer_lite.egg-info/PKG-INFO +166 -0
  20. aind_data_transfer_lite-0.0.1/src/aind_data_transfer_lite.egg-info/SOURCES.txt +31 -0
  21. aind_data_transfer_lite-0.0.1/src/aind_data_transfer_lite.egg-info/dependency_links.txt +1 -0
  22. aind_data_transfer_lite-0.0.1/src/aind_data_transfer_lite.egg-info/requires.txt +14 -0
  23. aind_data_transfer_lite-0.0.1/src/aind_data_transfer_lite.egg-info/top_level.txt +1 -0
  24. aind_data_transfer_lite-0.0.1/tests/__init__.py +1 -0
  25. aind_data_transfer_lite-0.0.1/tests/resources/behavior_data/example.txt +1 -0
  26. aind_data_transfer_lite-0.0.1/tests/resources/ecephys_data/example.txt +1 -0
  27. aind_data_transfer_lite-0.0.1/tests/resources/metadata_dir/acquisition.json +715 -0
  28. aind_data_transfer_lite-0.0.1/tests/resources/metadata_dir/data_description.json +52 -0
  29. aind_data_transfer_lite-0.0.1/tests/resources/metadata_dir/instrument.json +876 -0
  30. aind_data_transfer_lite-0.0.1/tests/resources/metadata_dir/procedures.json +258 -0
  31. aind_data_transfer_lite-0.0.1/tests/resources/metadata_dir/subject.json +53 -0
  32. aind_data_transfer_lite-0.0.1/tests/test_models.py +39 -0
  33. aind_data_transfer_lite-0.0.1/tests/test_upload_data.py +322 -0
@@ -0,0 +1,8 @@
1
+ [flake8]
2
+ exclude =
3
+ .git,
4
+ __pycache__,
5
+ build,
6
+ .venv,
7
+ venv
8
+ max-complexity = 10
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: User story
3
+ about: This template provides a basic structure for user story issues.
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ # User story
11
+ As a ..., I want to ..., so I can ...
12
+
13
+ *Ideally, this is in the issue title, but if not, you can put it here. If so, delete this section.*
14
+
15
+ # Acceptance criteria
16
+ - [ ] This is something that can be verified to show that this user story is satisfied.
17
+
18
+ # Sprint Ready Checklist
19
+ - [ ] 1. Acceptance criteria defined
20
+ - [ ] 2. Team understands acceptance criteria
21
+ - [ ] 3. Team has defined solution / steps to satisfy acceptance criteria
22
+ - [ ] 4. Acceptance criteria is verifiable / testable
23
+ - [ ] 5. External / 3rd Party dependencies identified
24
+ - [ ] 6. Ticket is prioritized and sized
25
+
26
+ # Notes
27
+ *Add any helpful notes here.*
@@ -0,0 +1,15 @@
1
+ name: Auto add issues to project board
2
+ on:
3
+ issues:
4
+ types:
5
+ - opened
6
+
7
+ jobs:
8
+ add-to-project:
9
+ name: Add issue to project
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/add-to-project@v1.0.2
13
+ with:
14
+ project-url: https://github.com/orgs/AllenNeuralDynamics/projects/9
15
+ github-token: ${{ secrets.SERVICE_TOKEN }}
@@ -0,0 +1,85 @@
1
+ name: Tag and publish
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+
7
+ jobs:
8
+ update_badges:
9
+ runs-on: ubuntu-latest
10
+ continue-on-error: true
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ with:
14
+ ref: ${{ env.DEFAULT_BRANCH }}
15
+ fetch-depth: 0
16
+ token: ${{ secrets.SERVICE_TOKEN }}
17
+ - name: Set up Python 3.10
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: '3.10'
21
+ - name: Install dependencies
22
+ run: |
23
+ python -m pip install -e .[dev] --no-cache-dir
24
+ - name: Get Python version and Update README.md
25
+ run: |
26
+ python_version=$(grep "requires-python" pyproject.toml | grep -o ">=[^\"]*")
27
+ python_badge=$(grep -o 'python-[^)]*' README.md)
28
+ new_python_badge="python-$python_version-blue?logo=python"
29
+ sed -i "s/$python_badge/$new_python_badge/g" README.md
30
+ - name: Get interrogate values and Update README.md
31
+ run: |
32
+ interrogate_val=$(interrogate . | grep -o 'actual: [0-9]*\.[0-9]*' | awk '{print $2}')
33
+ interrogate_badge=$(grep -o 'interrogate-[^)]*' README.md)
34
+ if (( $(echo "$interrogate_val >= 90.00" | bc -l) )); then
35
+ new_interrogate_badge="interrogate-$interrogate_val%25-brightgreen"
36
+ elif (( $(echo "$interrogate_val < 80.00" | bc -l) )); then
37
+ new_interrogate_badge="interrogate-$interrogate_val%25-red"
38
+ else
39
+ new_interrogate_badge="interrogate-$interrogate_val%25-yellow"
40
+ fi
41
+ sed -i "s/$interrogate_badge/$new_interrogate_badge/g" README.md
42
+ - name: Get Coverage values and Update README.md
43
+ run: |
44
+ coverage run -m unittest discover
45
+ coverage_val=$(coverage report | grep "^TOTAL" | grep -o '[0-9]\+%' | grep -o '[0-9]\+')
46
+ coverage_badge=$(grep -o "coverage-[^?]*" README.md)
47
+ if (( $(echo "$coverage_val >= 90.00" | bc -l) )); then
48
+ new_coverage_badge="coverage-$coverage_val%25-brightgreen"
49
+ elif (( $(echo "$coverage_val < 80.00" | bc -l) )); then
50
+ new_coverage_badge="coverage-$coverage_val%25-red"
51
+ else
52
+ new_coverage_badge="coverage-$coverage_val%25-yellow"
53
+ fi
54
+ sed -i "s/$coverage_badge/$new_coverage_badge/g" README.md
55
+ - name: Commit changes
56
+ uses: EndBug/add-and-commit@v9
57
+ with:
58
+ default_author: github_actions
59
+ message: "ci: update badges [skip actions]"
60
+ add: '["README.md"]'
61
+ tag:
62
+ needs: update_badges
63
+ uses: AllenNeuralDynamics/aind-github-actions/.github/workflows/tag.yml@main
64
+ secrets:
65
+ SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }}
66
+ publish:
67
+ needs: tag
68
+ runs-on: ubuntu-latest
69
+ steps:
70
+ - uses: actions/checkout@v4
71
+ - name: Pull latest changes
72
+ run: git pull origin main
73
+ - name: Set up Python 3.10
74
+ uses: actions/setup-python@v5
75
+ with:
76
+ python-version: '3.10'
77
+ - name: Install dependencies
78
+ run: |
79
+ pip install --upgrade setuptools wheel twine build
80
+ python -m build
81
+ twine check dist/*
82
+ - name: Publish on PyPI
83
+ uses: pypa/gh-action-pypi-publish@release/v1
84
+ with:
85
+ password: ${{ secrets.AIND_PYPI_TOKEN }}
@@ -0,0 +1,26 @@
1
+ name: Lint and run tests
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ ci:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ python-version: [ '3.10', '3.11', '3.12', '3.13' ]
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - name: Set up Python ${{ matrix.python-version }}
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ - name: Install dependencies
21
+ run: |
22
+ python -m pip install -e .[dev]
23
+ - name: Run linter checks
24
+ run: flake8 . && interrogate --verbose .
25
+ - name: Run tests and coverage
26
+ run: coverage run -m unittest discover && coverage report
@@ -0,0 +1,139 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
130
+
131
+ # PyCharm
132
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
133
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
134
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
135
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
136
+ .idea/
137
+
138
+ # MacOs
139
+ **/.DS_Store
@@ -0,0 +1,133 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, religion, or sexual identity
11
+ and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the
27
+ overall community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or
32
+ advances of any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
34
+ * Public or private harassment
35
+ * Publishing others' private information, such as a physical or email
36
+ address, without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official email address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at
64
+ ScientificComputing@AllenInstitute.onmicrosoft.com.
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
85
+
86
+ **Community Impact**: A violation through a single incident or series
87
+ of actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or
94
+ permanent ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within
114
+ the community.
115
+
116
+ ## Attribution
117
+
118
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
+ version 2.0, available at
120
+ [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
121
+
122
+ Community Impact Guidelines were inspired by
123
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124
+
125
+ For answers to common questions about this code of conduct, see the FAQ at
126
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available
127
+ at [https://www.contributor-covenant.org/translations][translations].
128
+
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
131
+ [Mozilla CoC]: https://github.com/mozilla/diversity
132
+ [FAQ]: https://www.contributor-covenant.org/faq
133
+ [translations]: https://www.contributor-covenant.org/translations
@@ -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,166 @@
1
+ Metadata-Version: 2.4
2
+ Name: aind-data-transfer-lite
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<2.12,>=2.0
12
+ Requires-Dist: pydantic-settings<3.0,>=2.8.0
13
+ Requires-Dist: aind-data-schema==2.0.5
14
+ Requires-Dist: aind-data-schema-models<5.0
15
+ Requires-Dist: boto3
16
+ Provides-Extra: dev
17
+ Requires-Dist: black; extra == "dev"
18
+ Requires-Dist: coverage; extra == "dev"
19
+ Requires-Dist: flake8; extra == "dev"
20
+ Requires-Dist: interrogate; extra == "dev"
21
+ Requires-Dist: isort; extra == "dev"
22
+ Requires-Dist: Sphinx; extra == "dev"
23
+ Requires-Dist: furo; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ # aind-data-transfer-lite
27
+
28
+ [![License](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)
29
+ ![Code Style](https://img.shields.io/badge/code%20style-black-black)
30
+ [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
31
+ ![Interrogate](https://img.shields.io/badge/interrogate-100.0%25-brightgreen)
32
+ ![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen?logo=codecov)
33
+ ![Python](https://img.shields.io/badge/python->=3.10-blue?logo=python)
34
+
35
+ ## Getting Started
36
+
37
+ ### Who is this for?
38
+
39
+ You want to upload data to AIND's Cloud Storage platform on AWS.
40
+
41
+ ### Prerequisites
42
+
43
+ - Install [aws cli](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
44
+ - Authentication for write permissions to aind-open-data bucket. Please reach to AIND Scientific Computing for access.
45
+
46
+ ## Installation
47
+ Install directly from PyPI. We recommend installing into a virtual environment or conda environment.
48
+ ```bash
49
+ pip install aind-data-transfer-lite
50
+ ```
51
+
52
+ ## Usage
53
+
54
+ ### Example Python Script
55
+
56
+ ```python
57
+ from pathlib import Path
58
+ import os
59
+ from aind_data_transfer_lite.models import JobSettings
60
+ from aind_data_transfer_lite.upload_data import UploadDataJob
61
+
62
+ # Assuming running from same directory as this README file
63
+ cwd = os.getcwd()
64
+ behavior_path = Path(cwd) / "tests" / "resources" / "behavior_data"
65
+ ecephys_path = Path(cwd) / "tests" / "resources" / "ecephys_data"
66
+ metadata_path = Path(cwd) / "tests" / "resources" / "metadata_dir"
67
+
68
+ modality_directories = {
69
+ "behavior": behavior_path,
70
+ "ecephys": ecephys_path
71
+ }
72
+
73
+ metadata_directory = metadata_path
74
+
75
+ job_settings = JobSettings(
76
+ dry_run=True,
77
+ modality_directories=modality_directories,
78
+ metadata_directory=metadata_directory,
79
+ s3_bucket="aind-open-data-dev"
80
+ )
81
+
82
+ job = UploadDataJob(job_settings=job_settings)
83
+ job.run_job()
84
+ ```
85
+
86
+ ### Example Command Line (Linux and MacOs)
87
+ ```bash
88
+ python -m aind_data_transfer_lite.upload_data \
89
+ --metadata_directory "./tests/resources/metadata_dir" \
90
+ --modality_directories '{"behavior": "./tests/resources/behavior_data", "ecephys": "./tests/resources/ecephys_data"}' \
91
+ --dry_run "True"
92
+ ```
93
+
94
+ ### Example Command Line (PowerShell)
95
+ ```bash
96
+ python -m aind_data_transfer_lite.upload_data `
97
+ --metadata_directory "./tests/resources/metadata_dir" `
98
+ --modality_directories '{\"behavior\": \"./tests/resources/behavior_data\", \"ecephys\": \"./tests/resources/ecephys_data\"}' `
99
+ --dry_run "True"
100
+ ```
101
+
102
+ ## Contributing
103
+
104
+ For code development, clone the repo and install as
105
+ ```bash
106
+ pip install -e ".[dev]"
107
+ ```
108
+
109
+ ### Linters and testing
110
+
111
+ There are several libraries used to run linters, check documentation, and run tests.
112
+
113
+ - Please test your changes using the **coverage** library, which will run the tests and log a coverage report:
114
+
115
+ ```bash
116
+ coverage run -m unittest discover && coverage report
117
+ ```
118
+
119
+ - Use **interrogate** to check that modules, methods, etc. have been documented thoroughly:
120
+
121
+ ```bash
122
+ interrogate .
123
+ ```
124
+
125
+ - Use **flake8** to check that code is up to standards (no unused imports, etc.):
126
+ ```bash
127
+ flake8 .
128
+ ```
129
+
130
+ - Use **black** to automatically format the code into PEP standards:
131
+ ```bash
132
+ black .
133
+ ```
134
+
135
+ - Use **isort** to automatically sort import statements:
136
+ ```bash
137
+ isort .
138
+ ```
139
+
140
+ ### Pull requests
141
+
142
+ For internal members, please create a branch. For external members, please fork the repository 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:
143
+ ```text
144
+ <type>(<scope>): <short summary>
145
+ ```
146
+
147
+ where scope (optional) describes the packages affected by the code changes and type (mandatory) is one of:
148
+
149
+ - **build**: Changes that affect build tools or external dependencies (example scopes: pyproject.toml, setup.py)
150
+ - **ci**: Changes to our CI configuration files and scripts (examples: .github/workflows/ci.yml)
151
+ - **docs**: Documentation only changes
152
+ - **feat**: A new feature
153
+ - **fix**: A bugfix
154
+ - **perf**: A code change that improves performance
155
+ - **refactor**: A code change that neither fixes a bug nor adds a feature
156
+ - **test**: Adding missing tests or correcting existing tests
157
+
158
+ ### Semantic Release
159
+
160
+ The table below, from [semantic release](https://github.com/semantic-release/semantic-release), shows which commit message gets you which release type when `semantic-release` runs (using the default configuration):
161
+
162
+ | Commit message | Release type |
163
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
164
+ | `fix(pencil): stop graphite breaking when too much pressure applied` | ~~Patch~~ Fix Release, Default release |
165
+ | `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
166
+ | `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release <br /> (Note that the `BREAKING CHANGE: ` token must be in the footer of the commit) |