datakit-data 0.2.0__tar.gz → 0.4.0__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 (59) hide show
  1. datakit_data-0.4.0/PKG-INFO +12 -0
  2. datakit_data-0.4.0/datakit_data/__init__.py +6 -0
  3. {datakit-data-0.2.0 → datakit_data-0.4.0}/datakit_data/commands/init.py +14 -9
  4. {datakit-data-0.2.0 → datakit_data-0.4.0}/datakit_data/commands/pull.py +7 -0
  5. {datakit-data-0.2.0 → datakit_data-0.4.0}/datakit_data/commands/push.py +7 -0
  6. {datakit-data-0.2.0 → datakit_data-0.4.0}/datakit_data/project_mixin.py +0 -1
  7. datakit_data-0.4.0/pyproject.toml +58 -0
  8. datakit-data-0.2.0/AUTHORS.rst +0 -11
  9. datakit-data-0.2.0/CONTRIBUTING.rst +0 -106
  10. datakit-data-0.2.0/HISTORY.rst +0 -19
  11. datakit-data-0.2.0/LICENSE +0 -9
  12. datakit-data-0.2.0/MANIFEST.in +0 -13
  13. datakit-data-0.2.0/PKG-INFO +0 -32
  14. datakit-data-0.2.0/README.rst +0 -19
  15. datakit-data-0.2.0/datakit_data/__init__.py +0 -9
  16. datakit-data-0.2.0/datakit_data.egg-info/PKG-INFO +0 -32
  17. datakit-data-0.2.0/datakit_data.egg-info/SOURCES.txt +0 -55
  18. datakit-data-0.2.0/datakit_data.egg-info/dependency_links.txt +0 -1
  19. datakit-data-0.2.0/datakit_data.egg-info/entry_points.txt +0 -5
  20. datakit-data-0.2.0/datakit_data.egg-info/not-zip-safe +0 -1
  21. datakit-data-0.2.0/datakit_data.egg-info/requires.txt +0 -3
  22. datakit-data-0.2.0/datakit_data.egg-info/top_level.txt +0 -1
  23. datakit-data-0.2.0/docs/Makefile +0 -177
  24. datakit-data-0.2.0/docs/_build/html/_static/ajax-loader.gif +0 -0
  25. datakit-data-0.2.0/docs/_build/html/_static/comment-bright.png +0 -0
  26. datakit-data-0.2.0/docs/_build/html/_static/comment-close.png +0 -0
  27. datakit-data-0.2.0/docs/_build/html/_static/comment.png +0 -0
  28. datakit-data-0.2.0/docs/_build/html/_static/down-pressed.png +0 -0
  29. datakit-data-0.2.0/docs/_build/html/_static/down.png +0 -0
  30. datakit-data-0.2.0/docs/_build/html/_static/file.png +0 -0
  31. datakit-data-0.2.0/docs/_build/html/_static/minus.png +0 -0
  32. datakit-data-0.2.0/docs/_build/html/_static/plus.png +0 -0
  33. datakit-data-0.2.0/docs/_build/html/_static/up-pressed.png +0 -0
  34. datakit-data-0.2.0/docs/_build/html/_static/up.png +0 -0
  35. datakit-data-0.2.0/docs/authors.rst +0 -1
  36. datakit-data-0.2.0/docs/conf.py +0 -275
  37. datakit-data-0.2.0/docs/contributing.rst +0 -1
  38. datakit-data-0.2.0/docs/credits.rst +0 -10
  39. datakit-data-0.2.0/docs/datakit_data.commands.rst +0 -38
  40. datakit-data-0.2.0/docs/datakit_data.rst +0 -45
  41. datakit-data-0.2.0/docs/history.rst +0 -1
  42. datakit-data-0.2.0/docs/index.rst +0 -23
  43. datakit-data-0.2.0/docs/installation.rst +0 -35
  44. datakit-data-0.2.0/docs/make.bat +0 -242
  45. datakit-data-0.2.0/docs/modules.rst +0 -7
  46. datakit-data-0.2.0/docs/quickstart.rst +0 -35
  47. datakit-data-0.2.0/docs/readme.rst +0 -73
  48. datakit-data-0.2.0/docs/usage.rst +0 -225
  49. datakit-data-0.2.0/setup.cfg +0 -25
  50. datakit-data-0.2.0/setup.py +0 -61
  51. datakit-data-0.2.0/tests/commands/test_init.py +0 -130
  52. datakit-data-0.2.0/tests/commands/test_pull.py +0 -91
  53. datakit-data-0.2.0/tests/commands/test_push.py +0 -70
  54. datakit-data-0.2.0/tests/conftest.py +0 -46
  55. datakit-data-0.2.0/tests/test_extra_flags.py +0 -13
  56. datakit-data-0.2.0/tests/test_s3.py +0 -99
  57. {datakit-data-0.2.0 → datakit_data-0.4.0}/datakit_data/commands/__init__.py +0 -0
  58. {datakit-data-0.2.0 → datakit_data-0.4.0}/datakit_data/extra_flags.py +0 -0
  59. {datakit-data-0.2.0 → datakit_data-0.4.0}/datakit_data/s3.py +0 -0
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.3
2
+ Name: datakit-data
3
+ Version: 0.4.0
4
+ Summary: A datakit plugin to manage data assets on AWS S3.
5
+ Author: Larry Fenn
6
+ Author-email: Larry Fenn <lfenn@ap.org>
7
+ License: ISC
8
+ Requires-Dist: awscli
9
+ Requires-Dist: cliff
10
+ Requires-Dist: datakit-core>=0.2.1
11
+ Requires-Python: >=3.10
12
+ Project-URL: Homepage, https://github.com/associatedpress/datakit-data
@@ -0,0 +1,6 @@
1
+ __author__ = """Larry Fenn"""
2
+ __email__ = 'lfenn@ap.org'
3
+
4
+ from .commands.init import Init
5
+ from .commands.push import Push
6
+ from .commands.pull import Pull
@@ -26,7 +26,9 @@ class Init(ProjectMixin, CommandHelpers, Command):
26
26
  dirs_to_create = ['data', 'config']
27
27
  [mkdir_p(directory) for directory in dirs_to_create]
28
28
  open('data/.gitkeep', 'w').close()
29
+ self.log.info("Created data/ directory")
29
30
  self.create_project_config()
31
+ self.log.info("Created config/datakit-data.json")
30
32
 
31
33
  def create_project_config(self):
32
34
  """Create project config if they don't already exist.
@@ -34,15 +36,18 @@ class Init(ProjectMixin, CommandHelpers, Command):
34
36
  Plugin-level configs, if configured, will override project defaults.
35
37
 
36
38
  """
37
- if not os.path.exists(self.project_config_path):
38
- try:
39
- plugin_configs = read_json(self.plugin_config_path)
40
- except FileNotFoundError:
41
- plugin_configs = {}
42
- to_write = self.default_configs.copy()
43
- to_write.update(plugin_configs)
44
- self.finalize_configs(to_write)
45
- write_json(self.project_config_path, to_write)
39
+ if os.path.exists(self.project_config_path):
40
+ return
41
+ try:
42
+ plugin_configs = read_json(self.plugin_config_path)
43
+ except FileNotFoundError:
44
+ plugin_configs = {}
45
+ self.log.info(f"No user level config found at {self.plugin_config_path}, empty config created!")
46
+ self.log.info("You will need to fill out config/datakit-data.json manually")
47
+ to_write = self.default_configs.copy()
48
+ to_write.update(plugin_configs)
49
+ self.finalize_configs(to_write)
50
+ write_json(self.project_config_path, to_write)
46
51
 
47
52
  def finalize_configs(self, configs):
48
53
  prefix = self.pop_key(configs, 's3_path_prefix')
@@ -1,5 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  import argparse
3
+ import os
3
4
  from cliff.command import Command
4
5
  from datakit import CommandHelpers
5
6
 
@@ -25,6 +26,12 @@ class Pull(ProjectMixin, CommandHelpers, Command):
25
26
  def take_action(self, parsed_args):
26
27
  user_profile = self.project_configs['aws_user_profile']
27
28
  bucket = self.project_configs['s3_bucket']
29
+ if not os.path.exists("config/datakit-data.json"):
30
+ self.log.info("No config file found - have you run `datakit data init`?")
31
+ return
32
+ if bucket == "":
33
+ self.log.info("No bucket specified in config - no data pushed")
34
+ return
28
35
  s3 = S3(user_profile, bucket)
29
36
  clean_flags = ExtraFlags.convert(parsed_args.args)
30
37
  s3.pull(
@@ -1,5 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  import argparse
3
+ import os
3
4
  from cliff.command import Command
4
5
  from datakit import CommandHelpers
5
6
 
@@ -25,6 +26,12 @@ class Push(ProjectMixin, CommandHelpers, Command):
25
26
  def take_action(self, parsed_args):
26
27
  user_profile = self.project_configs['aws_user_profile']
27
28
  bucket = self.project_configs['s3_bucket']
29
+ if not os.path.exists("config/datakit-data.json"):
30
+ self.log.info("No config file found - have you run `datakit data init`?")
31
+ return
32
+ if bucket == "":
33
+ self.log.info("No bucket specified in config - no data pushed")
34
+ return
28
35
  s3 = S3(user_profile, bucket)
29
36
  clean_flags = ExtraFlags.convert(parsed_args.args)
30
37
  s3.push(
@@ -1,4 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
1
  import os
3
2
 
4
3
  from datakit.utils import read_json
@@ -0,0 +1,58 @@
1
+ [build-system]
2
+ requires = ["uv-build"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "datakit-data"
7
+ version = "0.4.0"
8
+ description = "A datakit plugin to manage data assets on AWS S3."
9
+ authors = [
10
+ {name = "Larry Fenn", email = "lfenn@ap.org"},
11
+ ]
12
+ license = {text = "ISC"}
13
+ requires-python = ">=3.10"
14
+ dependencies = [
15
+ "awscli",
16
+ "cliff",
17
+ "datakit-core>=0.2.1",
18
+ ]
19
+
20
+ [project.urls]
21
+ Homepage = "https://github.com/associatedpress/datakit-data"
22
+
23
+ [project.entry-points."datakit.plugins"]
24
+ "data init" = "datakit_data:Init"
25
+ "data push" = "datakit_data:Push"
26
+ "data pull" = "datakit_data:Pull"
27
+
28
+ [dependency-groups]
29
+ dev = [
30
+ "bumpversion",
31
+ "coverage",
32
+ "cryptography>=42.0.4",
33
+ "ruff",
34
+ "pytest",
35
+ "pytest-mock",
36
+ "Sphinx",
37
+ "tox",
38
+ "tox-uv",
39
+ "watchdog",
40
+ ]
41
+
42
+ [tool.uv.build-backend]
43
+ module-root = ""
44
+
45
+ [tool.tox]
46
+ env_list = ["py311", "py312", "py313"]
47
+
48
+ [tool.tox.env_run_base]
49
+ dependency_groups = ["dev"]
50
+ commands = [["pytest", "{posargs}"]]
51
+
52
+ [tool.ruff]
53
+ line-length = 130
54
+ exclude = ["docs", "datakit_data/__init__.py"]
55
+
56
+ [tool.pytest.ini_options]
57
+ testpaths = ["tests/"]
58
+ log_level = "INFO"
@@ -1,11 +0,0 @@
1
- ============
2
- Contributors
3
- ============
4
-
5
- **Development Lead**
6
-
7
- * Serdar Tumgoren <stumgoren@ap.org>
8
-
9
- **Contributors**
10
-
11
- * Michelle Minkoff <mminkoff@ap.org>
@@ -1,106 +0,0 @@
1
- .. highlight:: shell
2
-
3
- ============
4
- Contributing
5
- ============
6
-
7
- Contributions are welcome, and they are greatly appreciated! Every
8
- little bit helps, and credit will always be given.
9
-
10
- You can contribute in many ways:
11
-
12
- Types of Contributions
13
- ----------------------
14
-
15
- Report Bugs
16
- ~~~~~~~~~~~
17
-
18
- Report bugs at https://github.com/associatedpress/datakit-data/issues.
19
-
20
- If you are reporting a bug, please include:
21
-
22
- * Your operating system name and version.
23
- * Any details about your local setup that might be helpful in troubleshooting.
24
- * Detailed steps to reproduce the bug.
25
-
26
- Fix Bugs
27
- ~~~~~~~~
28
-
29
- Look through the GitHub issues for bugs. Anything tagged with "bug"
30
- and "help wanted" is open to whoever wants to implement it.
31
-
32
- Implement Features
33
- ~~~~~~~~~~~~~~~~~~
34
-
35
- Look through the GitHub issues for features. Anything tagged with "enhancement"
36
- and "help wanted" is open to whoever wants to implement it.
37
-
38
- Write Documentation
39
- ~~~~~~~~~~~~~~~~~~~
40
-
41
- datakit-data plugin could always use more documentation, whether as part of the
42
- official datakit-data plugin docs, in docstrings, or even on the web in blog posts,
43
- articles, and such.
44
-
45
- Submit Feedback
46
- ~~~~~~~~~~~~~~~
47
-
48
- The best way to send feedback is to file an issue at https://github.com/associatedpress/datakit-data/issues.
49
-
50
- If you are proposing a feature:
51
-
52
- * Explain in detail how it would work.
53
- * Keep the scope as narrow as possible, to make it easier to implement.
54
- * Remember that this is a volunteer-driven project, and that contributions
55
- are welcome :)
56
-
57
- Get Started!
58
- ------------
59
-
60
- Ready to contribute? Here's how to set up `datakit-data` for local development.
61
-
62
- 1. Fork the `datakit-data` repo on GitHub.
63
- 2. Clone your fork locally::
64
-
65
- $ git clone git@github.com:your_name_here/datakit-data.git
66
-
67
- 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
68
-
69
- $ mkvirtualenv datakit-data
70
- $ cd datakit-data/
71
- $ python setup.py develop
72
-
73
- 4. Create a branch for local development::
74
-
75
- $ git checkout -b name-of-your-bugfix-or-feature
76
-
77
- Now you can make your changes locally.
78
-
79
- 5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::
80
-
81
- $ flake8 datakit_data tests
82
- $ py.test
83
- $ tox
84
-
85
- To get flake8 and tox, just pip install them into your virtualenv.
86
-
87
- 6. Commit your changes and push your branch to GitHub::
88
-
89
- $ git add .
90
- $ git commit -m "Your detailed description of your changes."
91
- $ git push origin name-of-your-bugfix-or-feature
92
-
93
- 7. Submit a pull request through the GitHub website.
94
-
95
- Pull Request Guidelines
96
- -----------------------
97
-
98
- Before you submit a pull request, check that it meets these guidelines:
99
-
100
- 1. The pull request should include tests.
101
- 2. If the pull request adds functionality, the docs should be updated. Put
102
- your new functionality into a function with a docstring, and add the
103
- feature to the list in README.rst.
104
- 3. The pull request should work for Python version 3.3 or higher. Check
105
- https://travis-ci.org/associatedpress/datakit-data/pull_requests
106
- and make sure that the tests pass for all supported Python versions.
@@ -1,19 +0,0 @@
1
- =======
2
- History
3
- =======
4
-
5
-
6
- 0.2.0 (2018-01-17)
7
- ------------------
8
-
9
- * Switch from colon- to space-separated plugin commands
10
-
11
-
12
- 0.1.0 (2016-03-16)
13
- ------------------
14
-
15
- * Project initialization command
16
- * Push/Pull commands
17
- * Custom syntax for pass-through of boolean flags to aws sync utility
18
- * Project-level configuration inheritance from global configs
19
- * Support for customizing S3 path with prefix/suffix from global configs
@@ -1,9 +0,0 @@
1
-
2
- ISC License
3
-
4
- Copyright (c) 2017, Associated Press
5
-
6
- Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9
-
@@ -1,13 +0,0 @@
1
-
2
- include AUTHORS.rst
3
-
4
- include CONTRIBUTING.rst
5
- include HISTORY.rst
6
- include LICENSE
7
- include README.rst
8
-
9
- recursive-include tests *
10
- recursive-exclude * __pycache__
11
- recursive-exclude * *.py[co]
12
-
13
- recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
@@ -1,32 +0,0 @@
1
- Metadata-Version: 1.1
2
- Name: datakit-data
3
- Version: 0.2.0
4
- Summary: A datakit plugin to manage data assets on AWS S3.
5
- Home-page: https://github.com/associatedpress/datakit-data
6
- Author: Serdar Tumgoren
7
- Author-email: stumgoren@ap.org
8
- License: ISC license
9
- Description-Content-Type: UNKNOWN
10
- Description:
11
-
12
- datakit-data
13
- ---------------
14
-
15
- A `datakit <https://pypi.python.org/pypi/datakit-core/>`_ plugin to simplify use of
16
- Amazon S3 as a data store for data science projects.
17
-
18
- * `Code <https://github.com/associatedpress/datakit-data>`_
19
- * `Docs <http://datakit-data.readthedocs.io/en/latest/>`_
20
-
21
-
22
- Keywords: datakit
23
- Platform: UNKNOWN
24
- Classifier: Development Status :: 3 - Alpha
25
- Classifier: Environment :: Console
26
- Classifier: Intended Audience :: Developers
27
- Classifier: License :: OSI Approved :: ISC License (ISCL)
28
- Classifier: Natural Language :: English
29
- Classifier: Programming Language :: Python :: 3
30
- Classifier: Programming Language :: Python :: 3.3
31
- Classifier: Programming Language :: Python :: 3.4
32
- Classifier: Programming Language :: Python :: 3.5
@@ -1,19 +0,0 @@
1
-
2
- .. image:: https://img.shields.io/pypi/v/datakit-data.svg
3
- :target: https://pypi.python.org/pypi/datakit-data
4
-
5
- .. image:: https://img.shields.io/travis/associatedpress/datakit-data.svg
6
- :target: https://travis-ci.org/associatedpress/datakit-data
7
-
8
- .. image:: http://readthedocs.org/projects/datakit-data/badge/?version=latest
9
- :target: https://datakit-data.readthedocs.io/en/latest/
10
- :alt: Documentation Status
11
-
12
-
13
- The `datakit-data` package is a datakit_ plugin designed to help data analysts
14
- easily archive and share data assets on S3.
15
-
16
- Please see the `official docs`_ for details on installation and usage.
17
-
18
- .. _datakit: https://github.com/associatedpress/datakit-core
19
- .. _`official docs`: https://datakit-data.readthedocs.io/en/latest/
@@ -1,9 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- __author__ = """Serdar Tumgoren"""
4
- __email__ = 'stumgoren@ap.org'
5
- __version__ = '0.2.0'
6
-
7
- from .commands.init import Init
8
- from .commands.push import Push
9
- from .commands.pull import Pull
@@ -1,32 +0,0 @@
1
- Metadata-Version: 1.1
2
- Name: datakit-data
3
- Version: 0.2.0
4
- Summary: A datakit plugin to manage data assets on AWS S3.
5
- Home-page: https://github.com/associatedpress/datakit-data
6
- Author: Serdar Tumgoren
7
- Author-email: stumgoren@ap.org
8
- License: ISC license
9
- Description-Content-Type: UNKNOWN
10
- Description:
11
-
12
- datakit-data
13
- ---------------
14
-
15
- A `datakit <https://pypi.python.org/pypi/datakit-core/>`_ plugin to simplify use of
16
- Amazon S3 as a data store for data science projects.
17
-
18
- * `Code <https://github.com/associatedpress/datakit-data>`_
19
- * `Docs <http://datakit-data.readthedocs.io/en/latest/>`_
20
-
21
-
22
- Keywords: datakit
23
- Platform: UNKNOWN
24
- Classifier: Development Status :: 3 - Alpha
25
- Classifier: Environment :: Console
26
- Classifier: Intended Audience :: Developers
27
- Classifier: License :: OSI Approved :: ISC License (ISCL)
28
- Classifier: Natural Language :: English
29
- Classifier: Programming Language :: Python :: 3
30
- Classifier: Programming Language :: Python :: 3.3
31
- Classifier: Programming Language :: Python :: 3.4
32
- Classifier: Programming Language :: Python :: 3.5
@@ -1,55 +0,0 @@
1
- AUTHORS.rst
2
- CONTRIBUTING.rst
3
- HISTORY.rst
4
- LICENSE
5
- MANIFEST.in
6
- README.rst
7
- setup.cfg
8
- setup.py
9
- datakit_data/__init__.py
10
- datakit_data/extra_flags.py
11
- datakit_data/project_mixin.py
12
- datakit_data/s3.py
13
- datakit_data.egg-info/PKG-INFO
14
- datakit_data.egg-info/SOURCES.txt
15
- datakit_data.egg-info/dependency_links.txt
16
- datakit_data.egg-info/entry_points.txt
17
- datakit_data.egg-info/not-zip-safe
18
- datakit_data.egg-info/requires.txt
19
- datakit_data.egg-info/top_level.txt
20
- datakit_data/commands/__init__.py
21
- datakit_data/commands/init.py
22
- datakit_data/commands/pull.py
23
- datakit_data/commands/push.py
24
- docs/Makefile
25
- docs/authors.rst
26
- docs/conf.py
27
- docs/contributing.rst
28
- docs/credits.rst
29
- docs/datakit_data.commands.rst
30
- docs/datakit_data.rst
31
- docs/history.rst
32
- docs/index.rst
33
- docs/installation.rst
34
- docs/make.bat
35
- docs/modules.rst
36
- docs/quickstart.rst
37
- docs/readme.rst
38
- docs/usage.rst
39
- docs/_build/html/_static/ajax-loader.gif
40
- docs/_build/html/_static/comment-bright.png
41
- docs/_build/html/_static/comment-close.png
42
- docs/_build/html/_static/comment.png
43
- docs/_build/html/_static/down-pressed.png
44
- docs/_build/html/_static/down.png
45
- docs/_build/html/_static/file.png
46
- docs/_build/html/_static/minus.png
47
- docs/_build/html/_static/plus.png
48
- docs/_build/html/_static/up-pressed.png
49
- docs/_build/html/_static/up.png
50
- tests/conftest.py
51
- tests/test_extra_flags.py
52
- tests/test_s3.py
53
- tests/commands/test_init.py
54
- tests/commands/test_pull.py
55
- tests/commands/test_push.py
@@ -1,5 +0,0 @@
1
- [datakit.plugins]
2
- data init = datakit_data:Init
3
- data pull = datakit_data:Pull
4
- data push = datakit_data:Push
5
-
@@ -1,3 +0,0 @@
1
- awscli
2
- cliff
3
- datakit-core>=0.2.1
@@ -1 +0,0 @@
1
- datakit_data