-
Notifications
You must be signed in to change notification settings - Fork 4
Added unified datacommons CLI tool
#11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
22bec9b
migrated to uv
dwnoble ee1854e
file formatting, more uv migrations
dwnoble 363ca4c
unit test fixes
dwnoble 0de6c30
python version fix
dwnoble ff20e87
test fixes
dwnoble 3c0fa7b
Added schema validation
dwnoble ca1b4bd
updated lockfile
dwnoble 2c25b95
Added initial schema validation service and in memory knowledge graph…
dwnoble d8d6f6f
merged
dwnoble 96bd55c
cleanup
dwnoble c3c8b66
test fixes
dwnoble b0c5955
Apply suggestions from code review
dwnoble b6b33e2
Apply suggestions from code review
dwnoble 08e0754
test cases
dwnoble 05a9386
refactor
dwnoble c3884f0
header
dwnoble 3cf2e15
fixed readme
dwnoble 8ae1388
readme fixes
dwnoble 0bce7e7
readme fixes
dwnoble 334411a
readme fixes
dwnoble 22bca66
Added datacommons-cli package and migrated command line utilities to …
dwnoble 13bef43
undid accidental changes
dwnoble 28957c7
fix
dwnoble 3fa5732
suggestion
dwnoble 8747f2e
Apply suggestions from code review
dwnoble 5e89dd7
pr feedback
dwnoble be933fe
Merge branch 'datacommons-cli' of github.com:dwnoble/datacommons into…
dwnoble 4430737
updated uv.lock
dwnoble 1595b79
Separated test and lint dependencies into separate groups
dwnoble 82ea89a
Set default uv index to pypi.org to fix github test failures
dwnoble f5ce2b1
comment
dwnoble b2c5a30
simplified set up
dwnoble f5027a6
Formatted
dwnoble File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Copyright 2025 Google LLC. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| import click | ||
|
|
||
| from datacommons_api.core.logging import get_logger, setup_logging | ||
| from datacommons_api.api_cli import api as api_cli | ||
| from datacommons_schema.schema_cli import schema as schema_cli | ||
|
|
||
| setup_logging() | ||
| logger = get_logger(__name__) | ||
|
|
||
|
|
||
| @click.group() | ||
| def cli(): | ||
| """Datacommons CLI suite""" | ||
| pass | ||
|
|
||
|
|
||
| # Add schema CLI commands to the main CLI | ||
| cli.add_command(api_cli) | ||
| cli.add_command(schema_cli) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Copyright 2026 Google LLC. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| __version__ = "0.0.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| [project] | ||
| name = "datacommons-cli" | ||
| dynamic = ["version"] | ||
| description = 'Data Commons CLI' | ||
| license = "Apache-2.0" | ||
| readme = "README.md" | ||
|
|
||
| requires-python = ">=3.11" | ||
| keywords = [] | ||
| authors = [] | ||
| dependencies = [ | ||
| "click>=8.1.7", | ||
| "datacommons-api", | ||
| "datacommons-db", | ||
| "datacommons-schema", | ||
| ] | ||
| urls = {Homepage = "https://github.com/datacommonsorg/datacommons"} | ||
|
|
||
| [project.scripts] | ||
| datacommons = "datacommons_cli.cli:cli" | ||
|
|
||
| [build-system] | ||
| requires = ["uv", "setuptools"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [tool.setuptools] | ||
| include-package-data = true | ||
|
|
||
| [tool.setuptools.dynamic] | ||
| version = {attr = "datacommons_cli.version.__version__"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function modifies the global
app_configobject. Using global state can make the application harder to reason about, debug, and test, as it creates hidden dependencies and makes the behavior of functions dependent on the order in which they are called.A better approach would be to avoid modifying global state. For example, this function could create and return a new configuration object, or the configuration object could be instantiated and passed explicitly where needed, rather than relying on a global instance.