data-annalist 0.1.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.
- data-annalist-0.1.0/AUTHORS.rst +13 -0
- data-annalist-0.1.0/CONTRIBUTING.rst +128 -0
- data-annalist-0.1.0/HISTORY.rst +8 -0
- data-annalist-0.1.0/LICENSE +32 -0
- data-annalist-0.1.0/MANIFEST.in +11 -0
- data-annalist-0.1.0/PKG-INFO +137 -0
- data-annalist-0.1.0/README.rst +106 -0
- data-annalist-0.1.0/annalist/__init__.py +5 -0
- data-annalist-0.1.0/annalist/annalist.py +39 -0
- data-annalist-0.1.0/data_annalist.egg-info/PKG-INFO +137 -0
- data-annalist-0.1.0/data_annalist.egg-info/SOURCES.txt +32 -0
- data-annalist-0.1.0/data_annalist.egg-info/dependency_links.txt +1 -0
- data-annalist-0.1.0/data_annalist.egg-info/not-zip-safe +1 -0
- data-annalist-0.1.0/data_annalist.egg-info/top_level.txt +1 -0
- data-annalist-0.1.0/docs/Makefile +20 -0
- data-annalist-0.1.0/docs/_build/html/_static/file.png +0 -0
- data-annalist-0.1.0/docs/_build/html/_static/minus.png +0 -0
- data-annalist-0.1.0/docs/_build/html/_static/plus.png +0 -0
- data-annalist-0.1.0/docs/annalist.rst +21 -0
- data-annalist-0.1.0/docs/authors.rst +1 -0
- data-annalist-0.1.0/docs/conf.py +159 -0
- data-annalist-0.1.0/docs/contributing.rst +1 -0
- data-annalist-0.1.0/docs/history.rst +1 -0
- data-annalist-0.1.0/docs/index.rst +20 -0
- data-annalist-0.1.0/docs/installation.rst +51 -0
- data-annalist-0.1.0/docs/make.bat +36 -0
- data-annalist-0.1.0/docs/modules.rst +7 -0
- data-annalist-0.1.0/docs/readme.rst +1 -0
- data-annalist-0.1.0/docs/usage.rst +7 -0
- data-annalist-0.1.0/setup.cfg +26 -0
- data-annalist-0.1.0/setup.py +43 -0
- data-annalist-0.1.0/tests/__init__.py +1 -0
- data-annalist-0.1.0/tests/test_annalist.py +33 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
.. highlight:: shell
|
|
2
|
+
|
|
3
|
+
============
|
|
4
|
+
Contributing
|
|
5
|
+
============
|
|
6
|
+
|
|
7
|
+
Contributions are welcome, and they are greatly appreciated! Every little bit
|
|
8
|
+
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/nicmostert/annalist.git.
|
|
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" and "help
|
|
30
|
+
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
|
+
Annalist could always use more documentation, whether as part of the
|
|
42
|
+
official Annalist 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/nicmostert/annalist.git.
|
|
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 `annalist` for local development.
|
|
61
|
+
|
|
62
|
+
1. Fork the `annalist` repo on GitLab.
|
|
63
|
+
2. Clone your fork locally::
|
|
64
|
+
|
|
65
|
+
$ git clone https://github.com/nicmostert/annalist.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 annalist
|
|
70
|
+
$ cd annalist/
|
|
71
|
+
$ python -m venv <path to venv>
|
|
72
|
+
$ source <path to venv>/bin/activate
|
|
73
|
+
$ pip install -r requirements_dev.txt
|
|
74
|
+
$ python setup.py develop
|
|
75
|
+
|
|
76
|
+
4. Create a branch for local development::
|
|
77
|
+
|
|
78
|
+
$ git checkout -b name-of-your-bugfix-or-feature
|
|
79
|
+
|
|
80
|
+
Now you can make your changes locally.
|
|
81
|
+
|
|
82
|
+
5. When you're done making changes, check that your changes pass flake8 and the
|
|
83
|
+
tests, including testing other Python versions with tox::
|
|
84
|
+
|
|
85
|
+
$ flake8 annalist tests
|
|
86
|
+
$ python setup.py test or pytest
|
|
87
|
+
$ tox
|
|
88
|
+
|
|
89
|
+
To get flake8 and tox, just pip install them into your virtualenv.
|
|
90
|
+
|
|
91
|
+
6. Commit your changes and push your branch to GitHub::
|
|
92
|
+
|
|
93
|
+
$ git add .
|
|
94
|
+
$ git commit -m "Your detailed description of your changes."
|
|
95
|
+
$ git push origin name-of-your-bugfix-or-feature
|
|
96
|
+
|
|
97
|
+
7. Submit a pull request through the GitHub website.
|
|
98
|
+
|
|
99
|
+
Pull Request Guidelines
|
|
100
|
+
-----------------------
|
|
101
|
+
|
|
102
|
+
Before you submit a pull request, check that it meets these guidelines:
|
|
103
|
+
|
|
104
|
+
1. The pull request should include tests.
|
|
105
|
+
2. If the pull request adds functionality, the docs should be updated. Put
|
|
106
|
+
your new functionality into a function with a docstring, and add the
|
|
107
|
+
feature to the list in README.rst.
|
|
108
|
+
|
|
109
|
+
Tips
|
|
110
|
+
----
|
|
111
|
+
|
|
112
|
+
To run a subset of tests::
|
|
113
|
+
|
|
114
|
+
$ pytest tests.test_annalist
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
Deploying
|
|
118
|
+
---------
|
|
119
|
+
|
|
120
|
+
A reminder for the maintainers on how to deploy.
|
|
121
|
+
Make sure all your changes are committed (including an entry in HISTORY.rst).
|
|
122
|
+
Then run::
|
|
123
|
+
|
|
124
|
+
$ bump2version patch # possible: major / minor / patch
|
|
125
|
+
$ git push
|
|
126
|
+
$ git push --tags
|
|
127
|
+
|
|
128
|
+
Travis will then deploy to PyPI if tests pass.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
GNU GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Audit trail generator for data processing scripts.
|
|
5
|
+
Copyright (C) 2023 Nic Mostert
|
|
6
|
+
|
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
This program is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
|
|
20
|
+
Also add information on how to contact you by electronic and paper mail.
|
|
21
|
+
|
|
22
|
+
You should also get your employer (if you work as a programmer) or school,
|
|
23
|
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
24
|
+
For more information on this, and how to apply and follow the GNU GPL, see
|
|
25
|
+
<http://www.gnu.org/licenses/>.
|
|
26
|
+
|
|
27
|
+
The GNU General Public License does not permit incorporating your program
|
|
28
|
+
into proprietary programs. If your program is a subroutine library, you
|
|
29
|
+
may consider it more useful to permit linking proprietary applications with
|
|
30
|
+
the library. If this is what you want to do, use the GNU Lesser General
|
|
31
|
+
Public License instead of this License. But first, please read
|
|
32
|
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
include AUTHORS.rst
|
|
2
|
+
include CONTRIBUTING.rst
|
|
3
|
+
include HISTORY.rst
|
|
4
|
+
include LICENSE
|
|
5
|
+
include README.rst
|
|
6
|
+
|
|
7
|
+
recursive-include tests *
|
|
8
|
+
recursive-exclude * __pycache__
|
|
9
|
+
recursive-exclude * *.py[co]
|
|
10
|
+
|
|
11
|
+
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: data-annalist
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Audit trail generator for data processing scripts.
|
|
5
|
+
Home-page: https://github.com/nicmostert/annalist.git
|
|
6
|
+
Author: Nic Mostert
|
|
7
|
+
Author-email: nicolas.mostert@horizons.govt.nz
|
|
8
|
+
License: GNU General Public License v3
|
|
9
|
+
Keywords: annalist
|
|
10
|
+
Platform: UNKNOWN
|
|
11
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
14
|
+
Classifier: Natural Language :: English
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Requires-Python: >=3.6
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
License-File: AUTHORS.rst
|
|
19
|
+
|
|
20
|
+
==========
|
|
21
|
+
Annalist
|
|
22
|
+
==========
|
|
23
|
+
|
|
24
|
+
.. image:: https://img.shields.io/pypi/v/annalist.svg
|
|
25
|
+
:target: https://pypi.python.org/pypi/annalist
|
|
26
|
+
|
|
27
|
+
.. image:: https://readthedocs.org/projects/annalist/badge/?version=latest
|
|
28
|
+
:target: https://annalist.readthedocs.io/en/latest/?version=latest
|
|
29
|
+
:alt: Documentation Status
|
|
30
|
+
|
|
31
|
+
.. image:: https://results.pre-commit.ci/badge/github/nicmostert/annalist/main.svg
|
|
32
|
+
:target: https://results.pre-commit.ci/latest/github/nicmostert/annalist/main
|
|
33
|
+
:alt: pre-commit.ci status
|
|
34
|
+
|
|
35
|
+
Audit trail generator for data processing scripts.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
* Free software: GNU General Public License v3
|
|
39
|
+
* Documentation: https://annalist.readthedocs.io.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
==================
|
|
43
|
+
Feature Roadmap
|
|
44
|
+
==================
|
|
45
|
+
|
|
46
|
+
This roadmap outlines the planned features and milestones for the development of our deterministic and reproducible process auditing system.
|
|
47
|
+
|
|
48
|
+
Milestone 1: Audit Logging Framework
|
|
49
|
+
-------------------------------------
|
|
50
|
+
- Develop a custom audit logging framework or class.
|
|
51
|
+
- Capture function names, input parameters, return values, data types, and timestamps.
|
|
52
|
+
- Implement basic logging mechanisms for integration.
|
|
53
|
+
|
|
54
|
+
Milestone 2: Standardized Logging Format
|
|
55
|
+
-----------------------------------------
|
|
56
|
+
- Define a standardized logging format for comprehensive auditing.
|
|
57
|
+
- Ensure consistency and machine-readability of the logging format.
|
|
58
|
+
|
|
59
|
+
Milestone 3: Serialization and Deserialization
|
|
60
|
+
----------------------------------------------
|
|
61
|
+
- Implement serialization and deserialization mechanisms.
|
|
62
|
+
- Store and retrieve complex data structures and objects.
|
|
63
|
+
- Test serialization for data integrity.
|
|
64
|
+
|
|
65
|
+
Milestone 4: Versioning and Dependency Tracking
|
|
66
|
+
-----------------------------------------------
|
|
67
|
+
- Capture and log codebase version (Git commit hash) and dependencies.
|
|
68
|
+
- Ensure accurate logging of version and dependency information.
|
|
69
|
+
|
|
70
|
+
Milestone 5: Integration Testing
|
|
71
|
+
--------------------------------
|
|
72
|
+
- Create integration tests using the audit logging framework.
|
|
73
|
+
- Log information during the execution of key processes.
|
|
74
|
+
- Begin development of process recreation capability.
|
|
75
|
+
|
|
76
|
+
Milestone 6: Reproduction Tool (Partial)
|
|
77
|
+
----------------------------------------
|
|
78
|
+
- Develop a tool or script to read and reproduce processes from the audit trail.
|
|
79
|
+
- Focus on recreating the environment and loading serialized data.
|
|
80
|
+
|
|
81
|
+
Milestone 7: Documentation (Partial)
|
|
82
|
+
--------------------------------------
|
|
83
|
+
- Create initial documentation.
|
|
84
|
+
- Explain how to use the audit logging framework and the audit trail format.
|
|
85
|
+
- Document basic project functionalities.
|
|
86
|
+
|
|
87
|
+
Milestone 8: Error Handling
|
|
88
|
+
---------------------------
|
|
89
|
+
- Implement robust error handling for auditing and reproduction code.
|
|
90
|
+
- Gracefully handle potential issues.
|
|
91
|
+
- Provide informative and actionable error messages.
|
|
92
|
+
|
|
93
|
+
Milestone 9: MVP Testing
|
|
94
|
+
-------------------------
|
|
95
|
+
- Conduct testing of the MVP.
|
|
96
|
+
- Reproduce processes from the audit trail and verify correctness.
|
|
97
|
+
- Gather feedback from initial users within the organization.
|
|
98
|
+
|
|
99
|
+
Milestone 10: MVP Deployment
|
|
100
|
+
------------------------------
|
|
101
|
+
- Deploy the MVP within the organization.
|
|
102
|
+
- Make it available to relevant team members.
|
|
103
|
+
- Encourage usage and collect user feedback.
|
|
104
|
+
|
|
105
|
+
Milestone 11: Feedback and Iteration
|
|
106
|
+
--------------------------------------
|
|
107
|
+
- Gather feedback from MVP users.
|
|
108
|
+
- Identify shortcomings, usability issues, or missing features.
|
|
109
|
+
- Prioritize and plan improvements based on user feedback.
|
|
110
|
+
|
|
111
|
+
Milestone 12: Scaling and Extending
|
|
112
|
+
------------------------------------
|
|
113
|
+
- Explore scaling the solution to cover more processes.
|
|
114
|
+
- Add additional features and capabilities to enhance usability.
|
|
115
|
+
|
|
116
|
+
Please note that milestones may overlap, and the order can be adjusted based on project-specific needs. We aim to remain flexible and responsive to feedback during development.
|
|
117
|
+
|
|
118
|
+
=======
|
|
119
|
+
Credits
|
|
120
|
+
=======
|
|
121
|
+
|
|
122
|
+
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
|
|
123
|
+
|
|
124
|
+
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
|
|
125
|
+
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
=======
|
|
129
|
+
History
|
|
130
|
+
=======
|
|
131
|
+
|
|
132
|
+
0.1.0 (2023-09-13)
|
|
133
|
+
------------------
|
|
134
|
+
|
|
135
|
+
* First release on PyPI.
|
|
136
|
+
|
|
137
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
==========
|
|
2
|
+
Annalist
|
|
3
|
+
==========
|
|
4
|
+
|
|
5
|
+
.. image:: https://img.shields.io/pypi/v/annalist.svg
|
|
6
|
+
:target: https://pypi.python.org/pypi/annalist
|
|
7
|
+
|
|
8
|
+
.. image:: https://readthedocs.org/projects/annalist/badge/?version=latest
|
|
9
|
+
:target: https://annalist.readthedocs.io/en/latest/?version=latest
|
|
10
|
+
:alt: Documentation Status
|
|
11
|
+
|
|
12
|
+
.. image:: https://results.pre-commit.ci/badge/github/nicmostert/annalist/main.svg
|
|
13
|
+
:target: https://results.pre-commit.ci/latest/github/nicmostert/annalist/main
|
|
14
|
+
:alt: pre-commit.ci status
|
|
15
|
+
|
|
16
|
+
Audit trail generator for data processing scripts.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
* Free software: GNU General Public License v3
|
|
20
|
+
* Documentation: https://annalist.readthedocs.io.
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
==================
|
|
24
|
+
Feature Roadmap
|
|
25
|
+
==================
|
|
26
|
+
|
|
27
|
+
This roadmap outlines the planned features and milestones for the development of our deterministic and reproducible process auditing system.
|
|
28
|
+
|
|
29
|
+
Milestone 1: Audit Logging Framework
|
|
30
|
+
-------------------------------------
|
|
31
|
+
- Develop a custom audit logging framework or class.
|
|
32
|
+
- Capture function names, input parameters, return values, data types, and timestamps.
|
|
33
|
+
- Implement basic logging mechanisms for integration.
|
|
34
|
+
|
|
35
|
+
Milestone 2: Standardized Logging Format
|
|
36
|
+
-----------------------------------------
|
|
37
|
+
- Define a standardized logging format for comprehensive auditing.
|
|
38
|
+
- Ensure consistency and machine-readability of the logging format.
|
|
39
|
+
|
|
40
|
+
Milestone 3: Serialization and Deserialization
|
|
41
|
+
----------------------------------------------
|
|
42
|
+
- Implement serialization and deserialization mechanisms.
|
|
43
|
+
- Store and retrieve complex data structures and objects.
|
|
44
|
+
- Test serialization for data integrity.
|
|
45
|
+
|
|
46
|
+
Milestone 4: Versioning and Dependency Tracking
|
|
47
|
+
-----------------------------------------------
|
|
48
|
+
- Capture and log codebase version (Git commit hash) and dependencies.
|
|
49
|
+
- Ensure accurate logging of version and dependency information.
|
|
50
|
+
|
|
51
|
+
Milestone 5: Integration Testing
|
|
52
|
+
--------------------------------
|
|
53
|
+
- Create integration tests using the audit logging framework.
|
|
54
|
+
- Log information during the execution of key processes.
|
|
55
|
+
- Begin development of process recreation capability.
|
|
56
|
+
|
|
57
|
+
Milestone 6: Reproduction Tool (Partial)
|
|
58
|
+
----------------------------------------
|
|
59
|
+
- Develop a tool or script to read and reproduce processes from the audit trail.
|
|
60
|
+
- Focus on recreating the environment and loading serialized data.
|
|
61
|
+
|
|
62
|
+
Milestone 7: Documentation (Partial)
|
|
63
|
+
--------------------------------------
|
|
64
|
+
- Create initial documentation.
|
|
65
|
+
- Explain how to use the audit logging framework and the audit trail format.
|
|
66
|
+
- Document basic project functionalities.
|
|
67
|
+
|
|
68
|
+
Milestone 8: Error Handling
|
|
69
|
+
---------------------------
|
|
70
|
+
- Implement robust error handling for auditing and reproduction code.
|
|
71
|
+
- Gracefully handle potential issues.
|
|
72
|
+
- Provide informative and actionable error messages.
|
|
73
|
+
|
|
74
|
+
Milestone 9: MVP Testing
|
|
75
|
+
-------------------------
|
|
76
|
+
- Conduct testing of the MVP.
|
|
77
|
+
- Reproduce processes from the audit trail and verify correctness.
|
|
78
|
+
- Gather feedback from initial users within the organization.
|
|
79
|
+
|
|
80
|
+
Milestone 10: MVP Deployment
|
|
81
|
+
------------------------------
|
|
82
|
+
- Deploy the MVP within the organization.
|
|
83
|
+
- Make it available to relevant team members.
|
|
84
|
+
- Encourage usage and collect user feedback.
|
|
85
|
+
|
|
86
|
+
Milestone 11: Feedback and Iteration
|
|
87
|
+
--------------------------------------
|
|
88
|
+
- Gather feedback from MVP users.
|
|
89
|
+
- Identify shortcomings, usability issues, or missing features.
|
|
90
|
+
- Prioritize and plan improvements based on user feedback.
|
|
91
|
+
|
|
92
|
+
Milestone 12: Scaling and Extending
|
|
93
|
+
------------------------------------
|
|
94
|
+
- Explore scaling the solution to cover more processes.
|
|
95
|
+
- Add additional features and capabilities to enhance usability.
|
|
96
|
+
|
|
97
|
+
Please note that milestones may overlap, and the order can be adjusted based on project-specific needs. We aim to remain flexible and responsive to feedback during development.
|
|
98
|
+
|
|
99
|
+
=======
|
|
100
|
+
Credits
|
|
101
|
+
=======
|
|
102
|
+
|
|
103
|
+
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
|
|
104
|
+
|
|
105
|
+
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
|
|
106
|
+
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Main module."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
|
|
5
|
+
GET_DATA = 25
|
|
6
|
+
PROCESS = 26
|
|
7
|
+
PUT_DATA = 27
|
|
8
|
+
|
|
9
|
+
logging.addLevelName(GET_DATA, "GET_DATA")
|
|
10
|
+
logging.addLevelName(PROCESS, "PROCESS")
|
|
11
|
+
logging.addLevelName(PUT_DATA, "PUT_DATA")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
auditor = logging.getLogger("auditor")
|
|
15
|
+
handler = logging.StreamHandler()
|
|
16
|
+
formatter = logging.Formatter(
|
|
17
|
+
"%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
|
18
|
+
)
|
|
19
|
+
handler.setFormatter(formatter)
|
|
20
|
+
auditor.addHandler(handler)
|
|
21
|
+
auditor.setLevel(GET_DATA)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def decorator_logger(func):
|
|
25
|
+
def wrapper(*args, **kwargs):
|
|
26
|
+
result = func(*args, **kwargs)
|
|
27
|
+
function_name = func.__name__
|
|
28
|
+
function_class = func.__class__
|
|
29
|
+
function_module = func.__module__
|
|
30
|
+
function_dir = dir(func)
|
|
31
|
+
function_doc = func.__doc__
|
|
32
|
+
auditor.log(PROCESS, function_name)
|
|
33
|
+
auditor.log(PROCESS, function_class)
|
|
34
|
+
auditor.log(PROCESS, function_module)
|
|
35
|
+
auditor.log(PROCESS, function_dir)
|
|
36
|
+
auditor.log(PROCESS, function_doc)
|
|
37
|
+
return result
|
|
38
|
+
|
|
39
|
+
return wrapper
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: data-annalist
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Audit trail generator for data processing scripts.
|
|
5
|
+
Home-page: https://github.com/nicmostert/annalist.git
|
|
6
|
+
Author: Nic Mostert
|
|
7
|
+
Author-email: nicolas.mostert@horizons.govt.nz
|
|
8
|
+
License: GNU General Public License v3
|
|
9
|
+
Keywords: annalist
|
|
10
|
+
Platform: UNKNOWN
|
|
11
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
14
|
+
Classifier: Natural Language :: English
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Requires-Python: >=3.6
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
License-File: AUTHORS.rst
|
|
19
|
+
|
|
20
|
+
==========
|
|
21
|
+
Annalist
|
|
22
|
+
==========
|
|
23
|
+
|
|
24
|
+
.. image:: https://img.shields.io/pypi/v/annalist.svg
|
|
25
|
+
:target: https://pypi.python.org/pypi/annalist
|
|
26
|
+
|
|
27
|
+
.. image:: https://readthedocs.org/projects/annalist/badge/?version=latest
|
|
28
|
+
:target: https://annalist.readthedocs.io/en/latest/?version=latest
|
|
29
|
+
:alt: Documentation Status
|
|
30
|
+
|
|
31
|
+
.. image:: https://results.pre-commit.ci/badge/github/nicmostert/annalist/main.svg
|
|
32
|
+
:target: https://results.pre-commit.ci/latest/github/nicmostert/annalist/main
|
|
33
|
+
:alt: pre-commit.ci status
|
|
34
|
+
|
|
35
|
+
Audit trail generator for data processing scripts.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
* Free software: GNU General Public License v3
|
|
39
|
+
* Documentation: https://annalist.readthedocs.io.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
==================
|
|
43
|
+
Feature Roadmap
|
|
44
|
+
==================
|
|
45
|
+
|
|
46
|
+
This roadmap outlines the planned features and milestones for the development of our deterministic and reproducible process auditing system.
|
|
47
|
+
|
|
48
|
+
Milestone 1: Audit Logging Framework
|
|
49
|
+
-------------------------------------
|
|
50
|
+
- Develop a custom audit logging framework or class.
|
|
51
|
+
- Capture function names, input parameters, return values, data types, and timestamps.
|
|
52
|
+
- Implement basic logging mechanisms for integration.
|
|
53
|
+
|
|
54
|
+
Milestone 2: Standardized Logging Format
|
|
55
|
+
-----------------------------------------
|
|
56
|
+
- Define a standardized logging format for comprehensive auditing.
|
|
57
|
+
- Ensure consistency and machine-readability of the logging format.
|
|
58
|
+
|
|
59
|
+
Milestone 3: Serialization and Deserialization
|
|
60
|
+
----------------------------------------------
|
|
61
|
+
- Implement serialization and deserialization mechanisms.
|
|
62
|
+
- Store and retrieve complex data structures and objects.
|
|
63
|
+
- Test serialization for data integrity.
|
|
64
|
+
|
|
65
|
+
Milestone 4: Versioning and Dependency Tracking
|
|
66
|
+
-----------------------------------------------
|
|
67
|
+
- Capture and log codebase version (Git commit hash) and dependencies.
|
|
68
|
+
- Ensure accurate logging of version and dependency information.
|
|
69
|
+
|
|
70
|
+
Milestone 5: Integration Testing
|
|
71
|
+
--------------------------------
|
|
72
|
+
- Create integration tests using the audit logging framework.
|
|
73
|
+
- Log information during the execution of key processes.
|
|
74
|
+
- Begin development of process recreation capability.
|
|
75
|
+
|
|
76
|
+
Milestone 6: Reproduction Tool (Partial)
|
|
77
|
+
----------------------------------------
|
|
78
|
+
- Develop a tool or script to read and reproduce processes from the audit trail.
|
|
79
|
+
- Focus on recreating the environment and loading serialized data.
|
|
80
|
+
|
|
81
|
+
Milestone 7: Documentation (Partial)
|
|
82
|
+
--------------------------------------
|
|
83
|
+
- Create initial documentation.
|
|
84
|
+
- Explain how to use the audit logging framework and the audit trail format.
|
|
85
|
+
- Document basic project functionalities.
|
|
86
|
+
|
|
87
|
+
Milestone 8: Error Handling
|
|
88
|
+
---------------------------
|
|
89
|
+
- Implement robust error handling for auditing and reproduction code.
|
|
90
|
+
- Gracefully handle potential issues.
|
|
91
|
+
- Provide informative and actionable error messages.
|
|
92
|
+
|
|
93
|
+
Milestone 9: MVP Testing
|
|
94
|
+
-------------------------
|
|
95
|
+
- Conduct testing of the MVP.
|
|
96
|
+
- Reproduce processes from the audit trail and verify correctness.
|
|
97
|
+
- Gather feedback from initial users within the organization.
|
|
98
|
+
|
|
99
|
+
Milestone 10: MVP Deployment
|
|
100
|
+
------------------------------
|
|
101
|
+
- Deploy the MVP within the organization.
|
|
102
|
+
- Make it available to relevant team members.
|
|
103
|
+
- Encourage usage and collect user feedback.
|
|
104
|
+
|
|
105
|
+
Milestone 11: Feedback and Iteration
|
|
106
|
+
--------------------------------------
|
|
107
|
+
- Gather feedback from MVP users.
|
|
108
|
+
- Identify shortcomings, usability issues, or missing features.
|
|
109
|
+
- Prioritize and plan improvements based on user feedback.
|
|
110
|
+
|
|
111
|
+
Milestone 12: Scaling and Extending
|
|
112
|
+
------------------------------------
|
|
113
|
+
- Explore scaling the solution to cover more processes.
|
|
114
|
+
- Add additional features and capabilities to enhance usability.
|
|
115
|
+
|
|
116
|
+
Please note that milestones may overlap, and the order can be adjusted based on project-specific needs. We aim to remain flexible and responsive to feedback during development.
|
|
117
|
+
|
|
118
|
+
=======
|
|
119
|
+
Credits
|
|
120
|
+
=======
|
|
121
|
+
|
|
122
|
+
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
|
|
123
|
+
|
|
124
|
+
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
|
|
125
|
+
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
=======
|
|
129
|
+
History
|
|
130
|
+
=======
|
|
131
|
+
|
|
132
|
+
0.1.0 (2023-09-13)
|
|
133
|
+
------------------
|
|
134
|
+
|
|
135
|
+
* First release on PyPI.
|
|
136
|
+
|
|
137
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
AUTHORS.rst
|
|
2
|
+
CONTRIBUTING.rst
|
|
3
|
+
HISTORY.rst
|
|
4
|
+
LICENSE
|
|
5
|
+
MANIFEST.in
|
|
6
|
+
README.rst
|
|
7
|
+
setup.cfg
|
|
8
|
+
setup.py
|
|
9
|
+
annalist/__init__.py
|
|
10
|
+
annalist/annalist.py
|
|
11
|
+
data_annalist.egg-info/PKG-INFO
|
|
12
|
+
data_annalist.egg-info/SOURCES.txt
|
|
13
|
+
data_annalist.egg-info/dependency_links.txt
|
|
14
|
+
data_annalist.egg-info/not-zip-safe
|
|
15
|
+
data_annalist.egg-info/top_level.txt
|
|
16
|
+
docs/Makefile
|
|
17
|
+
docs/annalist.rst
|
|
18
|
+
docs/authors.rst
|
|
19
|
+
docs/conf.py
|
|
20
|
+
docs/contributing.rst
|
|
21
|
+
docs/history.rst
|
|
22
|
+
docs/index.rst
|
|
23
|
+
docs/installation.rst
|
|
24
|
+
docs/make.bat
|
|
25
|
+
docs/modules.rst
|
|
26
|
+
docs/readme.rst
|
|
27
|
+
docs/usage.rst
|
|
28
|
+
docs/_build/html/_static/file.png
|
|
29
|
+
docs/_build/html/_static/minus.png
|
|
30
|
+
docs/_build/html/_static/plus.png
|
|
31
|
+
tests/__init__.py
|
|
32
|
+
tests/test_annalist.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
annalist
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line.
|
|
5
|
+
SPHINXOPTS =
|
|
6
|
+
SPHINXBUILD = python -msphinx
|
|
7
|
+
SPHINXPROJ = chronicler
|
|
8
|
+
SOURCEDIR = .
|
|
9
|
+
BUILDDIR = _build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
annalist package
|
|
2
|
+
================
|
|
3
|
+
|
|
4
|
+
Submodules
|
|
5
|
+
----------
|
|
6
|
+
|
|
7
|
+
annalist.annalist module
|
|
8
|
+
------------------------
|
|
9
|
+
|
|
10
|
+
.. automodule:: annalist.annalist
|
|
11
|
+
:members:
|
|
12
|
+
:undoc-members:
|
|
13
|
+
:show-inheritance:
|
|
14
|
+
|
|
15
|
+
Module contents
|
|
16
|
+
---------------
|
|
17
|
+
|
|
18
|
+
.. automodule:: annalist
|
|
19
|
+
:members:
|
|
20
|
+
:undoc-members:
|
|
21
|
+
:show-inheritance:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.. include:: ../AUTHORS.rst
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
#
|
|
3
|
+
# annalist documentation build configuration file, created by
|
|
4
|
+
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
|
|
5
|
+
#
|
|
6
|
+
# This file is execfile()d with the current directory set to its
|
|
7
|
+
# containing dir.
|
|
8
|
+
#
|
|
9
|
+
# Note that not all possible configuration values are present in this
|
|
10
|
+
# autogenerated file.
|
|
11
|
+
#
|
|
12
|
+
# All configuration values have a default; values that are commented out
|
|
13
|
+
# serve to show the default.
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
import sys
|
|
17
|
+
|
|
18
|
+
# If extensions (or modules to document with autodoc) are in another
|
|
19
|
+
# directory, add these directories to sys.path here. If the directory is
|
|
20
|
+
# relative to the documentation root, use os.path.abspath to make it
|
|
21
|
+
# absolute, like shown here.
|
|
22
|
+
#
|
|
23
|
+
sys.path.insert(0, os.path.abspath(".."))
|
|
24
|
+
import annalist
|
|
25
|
+
|
|
26
|
+
# -- General configuration ---------------------------------------------
|
|
27
|
+
|
|
28
|
+
# If your documentation needs a minimal Sphinx version, state it here.
|
|
29
|
+
#
|
|
30
|
+
# needs_sphinx = '1.0'
|
|
31
|
+
|
|
32
|
+
# Add any Sphinx extension module names here, as strings. They can be
|
|
33
|
+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
|
34
|
+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
|
|
35
|
+
|
|
36
|
+
# Add any paths that contain templates here, relative to this directory.
|
|
37
|
+
templates_path = ["_templates"]
|
|
38
|
+
|
|
39
|
+
# The suffix(es) of source filenames.
|
|
40
|
+
# You can specify multiple suffix as a list of string:
|
|
41
|
+
#
|
|
42
|
+
# source_suffix = ['.rst', '.md']
|
|
43
|
+
source_suffix = ".rst"
|
|
44
|
+
|
|
45
|
+
# The master toctree document.
|
|
46
|
+
master_doc = "index"
|
|
47
|
+
|
|
48
|
+
# General information about the project.
|
|
49
|
+
project = "Annalist"
|
|
50
|
+
copyright = "2023, Nic Mostert"
|
|
51
|
+
author = "Nic Mostert"
|
|
52
|
+
|
|
53
|
+
# The version info for the project you're documenting, acts as replacement
|
|
54
|
+
# for |version| and |release|, also used in various other places throughout
|
|
55
|
+
# the built documents.
|
|
56
|
+
#
|
|
57
|
+
# The short X.Y version.
|
|
58
|
+
version = annalist.__version__
|
|
59
|
+
# The full version, including alpha/beta/rc tags.
|
|
60
|
+
release = annalist.__version__
|
|
61
|
+
|
|
62
|
+
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
63
|
+
# for a list of supported languages.
|
|
64
|
+
#
|
|
65
|
+
# This is also used if you do content translation via gettext catalogs.
|
|
66
|
+
# Usually you set "language" from the command line for these cases.
|
|
67
|
+
language = "python"
|
|
68
|
+
|
|
69
|
+
# List of patterns, relative to source directory, that match files and
|
|
70
|
+
# directories to ignore when looking for source files.
|
|
71
|
+
# This patterns also effect to html_static_path and html_extra_path
|
|
72
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
73
|
+
|
|
74
|
+
# The name of the Pygments (syntax highlighting) style to use.
|
|
75
|
+
pygments_style = "sphinx"
|
|
76
|
+
|
|
77
|
+
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
|
78
|
+
todo_include_todos = False
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# -- Options for HTML output -------------------------------------------
|
|
82
|
+
|
|
83
|
+
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
84
|
+
# a list of builtin themes.
|
|
85
|
+
#
|
|
86
|
+
html_theme = "alabaster"
|
|
87
|
+
|
|
88
|
+
# Theme options are theme-specific and customize the look and feel of a
|
|
89
|
+
# theme further. For a list of options available for each theme, see the
|
|
90
|
+
# documentation.
|
|
91
|
+
#
|
|
92
|
+
# html_theme_options = {}
|
|
93
|
+
|
|
94
|
+
# Add any paths that contain custom static files (such as style sheets) here,
|
|
95
|
+
# relative to this directory. They are copied after the builtin static files,
|
|
96
|
+
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
97
|
+
html_static_path = ["_static"]
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# -- Options for HTMLHelp output ---------------------------------------
|
|
101
|
+
|
|
102
|
+
# Output file base name for HTML help builder.
|
|
103
|
+
htmlhelp_basename = "annalistdoc"
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
# -- Options for LaTeX output ------------------------------------------
|
|
107
|
+
|
|
108
|
+
latex_elements = {
|
|
109
|
+
# The paper size ('letterpaper' or 'a4paper').
|
|
110
|
+
#
|
|
111
|
+
# 'papersize': 'letterpaper',
|
|
112
|
+
# The font size ('10pt', '11pt' or '12pt').
|
|
113
|
+
#
|
|
114
|
+
# 'pointsize': '10pt',
|
|
115
|
+
# Additional stuff for the LaTeX preamble.
|
|
116
|
+
#
|
|
117
|
+
# 'preamble': '',
|
|
118
|
+
# Latex figure (float) alignment
|
|
119
|
+
#
|
|
120
|
+
# 'figure_align': 'htbp',
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
# Grouping the document tree into LaTeX files. List of tuples
|
|
124
|
+
# (source start file, target name, title, author, documentclass
|
|
125
|
+
# [howto, manual, or own class]).
|
|
126
|
+
latex_documents = [
|
|
127
|
+
(
|
|
128
|
+
master_doc,
|
|
129
|
+
"annalist.tex",
|
|
130
|
+
"Annalist Documentation",
|
|
131
|
+
"Nic Mostert",
|
|
132
|
+
"manual",
|
|
133
|
+
),
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
# -- Options for manual page output ------------------------------------
|
|
138
|
+
|
|
139
|
+
# One entry per manual page. List of tuples
|
|
140
|
+
# (source start file, name, description, authors, manual section).
|
|
141
|
+
man_pages = [(master_doc, "annalist", "Annalist Documentation", [author], 1)]
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# -- Options for Texinfo output ----------------------------------------
|
|
145
|
+
|
|
146
|
+
# Grouping the document tree into Texinfo files. List of tuples
|
|
147
|
+
# (source start file, target name, title, author,
|
|
148
|
+
# dir menu entry, description, category)
|
|
149
|
+
texinfo_documents = [
|
|
150
|
+
(
|
|
151
|
+
master_doc,
|
|
152
|
+
"annalist",
|
|
153
|
+
"Annalist Documentation",
|
|
154
|
+
author,
|
|
155
|
+
"annalist",
|
|
156
|
+
"One line description of project.",
|
|
157
|
+
"Miscellaneous",
|
|
158
|
+
),
|
|
159
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.. include:: ../CONTRIBUTING.rst
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.. include:: ../HISTORY.rst
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Welcome to Annalist's documentation!
|
|
2
|
+
======================================
|
|
3
|
+
|
|
4
|
+
.. toctree::
|
|
5
|
+
:maxdepth: 2
|
|
6
|
+
:caption: Contents:
|
|
7
|
+
|
|
8
|
+
readme
|
|
9
|
+
installation
|
|
10
|
+
usage
|
|
11
|
+
modules
|
|
12
|
+
contributing
|
|
13
|
+
authors
|
|
14
|
+
history
|
|
15
|
+
|
|
16
|
+
Indices and tables
|
|
17
|
+
==================
|
|
18
|
+
* :ref:`genindex`
|
|
19
|
+
* :ref:`modindex`
|
|
20
|
+
* :ref:`search`
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
.. highlight:: shell
|
|
2
|
+
|
|
3
|
+
============
|
|
4
|
+
Installation
|
|
5
|
+
============
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Stable release
|
|
9
|
+
--------------
|
|
10
|
+
|
|
11
|
+
To install Annalist, run this command in your terminal:
|
|
12
|
+
|
|
13
|
+
.. code-block:: console
|
|
14
|
+
|
|
15
|
+
$ pip install annalist
|
|
16
|
+
|
|
17
|
+
This is the preferred method to install Annalist, as it will always install the most recent stable release.
|
|
18
|
+
|
|
19
|
+
If you don't have `pip`_ installed, this `Python installation guide`_ can guide
|
|
20
|
+
you through the process.
|
|
21
|
+
|
|
22
|
+
.. _pip: https://pip.pypa.io
|
|
23
|
+
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
From sources
|
|
27
|
+
------------
|
|
28
|
+
|
|
29
|
+
The sources for Annalist can be downloaded from the `Github repo`_.
|
|
30
|
+
|
|
31
|
+
You can either clone the public repository:
|
|
32
|
+
|
|
33
|
+
.. code-block:: console
|
|
34
|
+
|
|
35
|
+
$ git clone git://github.com/nicmostert/annalist
|
|
36
|
+
|
|
37
|
+
Or download the `tarball`_:
|
|
38
|
+
|
|
39
|
+
.. code-block:: console
|
|
40
|
+
|
|
41
|
+
$ curl -OJL https://github.com/nicmostert/annalist/tarball/master
|
|
42
|
+
|
|
43
|
+
Once you have a copy of the source, you can install it with:
|
|
44
|
+
|
|
45
|
+
.. code-block:: console
|
|
46
|
+
|
|
47
|
+
$ python setup.py install
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
.. _Github repo: https://github.com/nicmostert/annalist
|
|
51
|
+
.. _tarball: https://github.com/nicmostert/annalist/tarball/master
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@ECHO OFF
|
|
2
|
+
|
|
3
|
+
pushd %~dp0
|
|
4
|
+
|
|
5
|
+
REM Command file for Sphinx documentation
|
|
6
|
+
|
|
7
|
+
if "%SPHINXBUILD%" == "" (
|
|
8
|
+
set SPHINXBUILD=python -msphinx
|
|
9
|
+
)
|
|
10
|
+
set SOURCEDIR=.
|
|
11
|
+
set BUILDDIR=_build
|
|
12
|
+
set SPHINXPROJ=annalist
|
|
13
|
+
|
|
14
|
+
if "%1" == "" goto help
|
|
15
|
+
|
|
16
|
+
%SPHINXBUILD% >NUL 2>NUL
|
|
17
|
+
if errorlevel 9009 (
|
|
18
|
+
echo.
|
|
19
|
+
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
|
|
20
|
+
echo.then set the SPHINXBUILD environment variable to point to the full
|
|
21
|
+
echo.path of the 'sphinx-build' executable. Alternatively you may add the
|
|
22
|
+
echo.Sphinx directory to PATH.
|
|
23
|
+
echo.
|
|
24
|
+
echo.If you don't have Sphinx installed, grab it from
|
|
25
|
+
echo.http://sphinx-doc.org/
|
|
26
|
+
exit /b 1
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
|
30
|
+
goto end
|
|
31
|
+
|
|
32
|
+
:help
|
|
33
|
+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
|
34
|
+
|
|
35
|
+
:end
|
|
36
|
+
popd
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.. include:: ../README.rst
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[bumpversion]
|
|
2
|
+
current_version = 0.1.0
|
|
3
|
+
commit = True
|
|
4
|
+
tag = True
|
|
5
|
+
|
|
6
|
+
[bumpversion:file:setup.py]
|
|
7
|
+
search = version='{current_version}'
|
|
8
|
+
replace = version='{new_version}'
|
|
9
|
+
|
|
10
|
+
[bumpversion:file:annalist/__init__.py]
|
|
11
|
+
search = __version__ = '{current_version}'
|
|
12
|
+
replace = __version__ = '{new_version}'
|
|
13
|
+
|
|
14
|
+
[bdist_wheel]
|
|
15
|
+
universal = 1
|
|
16
|
+
|
|
17
|
+
[flake8]
|
|
18
|
+
exclude = docs
|
|
19
|
+
|
|
20
|
+
[tool:pytest]
|
|
21
|
+
addopts = --ignore=setup.py
|
|
22
|
+
|
|
23
|
+
[egg_info]
|
|
24
|
+
tag_build =
|
|
25
|
+
tag_date = 0
|
|
26
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
"""The setup script."""
|
|
4
|
+
|
|
5
|
+
from setuptools import find_packages, setup
|
|
6
|
+
|
|
7
|
+
with open("README.rst") as readme_file:
|
|
8
|
+
readme = readme_file.read()
|
|
9
|
+
|
|
10
|
+
with open("HISTORY.rst") as history_file:
|
|
11
|
+
history = history_file.read()
|
|
12
|
+
|
|
13
|
+
requirements: list[str] = []
|
|
14
|
+
|
|
15
|
+
test_requirements = [
|
|
16
|
+
"pytest>=3",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
setup(
|
|
20
|
+
author="Nic Mostert",
|
|
21
|
+
author_email="nicolas.mostert@horizons.govt.nz",
|
|
22
|
+
python_requires=">=3.6",
|
|
23
|
+
classifiers=[
|
|
24
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
25
|
+
"Intended Audience :: Developers",
|
|
26
|
+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
27
|
+
"Natural Language :: English",
|
|
28
|
+
"Programming Language :: Python :: 3.10",
|
|
29
|
+
],
|
|
30
|
+
description="Audit trail generator for data processing scripts.",
|
|
31
|
+
install_requires=requirements,
|
|
32
|
+
license="GNU General Public License v3",
|
|
33
|
+
long_description=readme + "\n\n" + history,
|
|
34
|
+
include_package_data=True,
|
|
35
|
+
keywords="annalist",
|
|
36
|
+
name="data-annalist",
|
|
37
|
+
packages=find_packages(include=["annalist", "annalist.*"]),
|
|
38
|
+
test_suite="tests",
|
|
39
|
+
tests_require=test_requirements,
|
|
40
|
+
url="https://github.com/nicmostert/annalist.git",
|
|
41
|
+
version="0.1.0",
|
|
42
|
+
zip_safe=False,
|
|
43
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Unit test package for annalist."""
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
"""Tests for `annalist` package."""
|
|
4
|
+
|
|
5
|
+
from annalist.annalist import decorator_logger
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@decorator_logger
|
|
9
|
+
def len_of_string_example(str_arg):
|
|
10
|
+
return len(str_arg)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test_decorator_logger_functionality(caplog):
|
|
14
|
+
"""Test logger behaviour"""
|
|
15
|
+
str_example = "This is a string"
|
|
16
|
+
result = len_of_string_example(str_example)
|
|
17
|
+
print([dir(rec) for rec in caplog.records])
|
|
18
|
+
log_messages = [rec.message for rec in caplog.records]
|
|
19
|
+
assert log_messages == "whatsit"
|
|
20
|
+
assert result == len(str_example)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def test_decorator_logger_wrapper():
|
|
24
|
+
"""Test decorator function directly"""
|
|
25
|
+
|
|
26
|
+
def mock_func():
|
|
27
|
+
print("Console Output to Intercept?")
|
|
28
|
+
return "Mock function called."
|
|
29
|
+
|
|
30
|
+
decorated_mock_func = decorator_logger(mock_func)
|
|
31
|
+
|
|
32
|
+
result = decorated_mock_func()
|
|
33
|
+
assert result == "Mock function called."
|