-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
base architecture with
.docx
support (#19)
* add `metadoc.utils` to setup.py * add init to `utils` folder * add `zip_and_extract` function to `util.py` * add dev-requirements for metadoc test update metadoc project's description * Bump numpy from 1.26.2 to 1.26.3 Bumps [numpy](https://github.com/numpy/numpy) from 1.26.2 to 1.26.3. - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](numpy/numpy@v1.26.2...v1.26.3) --- updated-dependencies: - dependency-name: numpy dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump scikit-learn from 1.3.2 to 1.4.0 (#15) Bumps [scikit-learn](https://github.com/scikit-learn/scikit-learn) from 1.3.2 to 1.4.0. - [Release notes](https://github.com/scikit-learn/scikit-learn/releases) - [Commits](scikit-learn/scikit-learn@1.3.2...1.4.0) --- updated-dependencies: - dependency-name: scikit-learn dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump numpy from 1.26.3 to 1.26.4 (#16) Bumps [numpy](https://github.com/numpy/numpy) from 1.26.3 to 1.26.4. - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](numpy/numpy@v1.26.3...v1.26.4) --- updated-dependencies: - dependency-name: numpy dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update package name * update package name * add personal fields correspondence dict in xml files * remove scikit dependancy * apply refactorings * init dmeta * add CLI handler * implement `extract_namespaces` function * implement `remove_format` function * implement `extract_docx` function * implement `read_json` function * init dmeta params * add `PERSONAL_FIELDS_CORE_XML_CORRESPONDENCES` params * add `PERSONAL_FIELDS_APP_XML_CORRESPONDENCES` params * refactoring util.py * add clear functionality * add clear all functionality * add update functionality * add update all functionality * CLI arg parser added * remove numpy & add art * add art * enhance CLI handler * apply refactorings * add overview, shorten some variables * implement `dmeta_help` function * apply refactorings * change `Dmeta` to `dmeta` * `CHANGELOG.md` updated * add space * `CHANGELOG.md` updated * update classifiers * add docstring to `read_json` function * `CHANGELOG.md` updated * update `dmeta` to `DMeta` * update namings * update packages * comment `pytest` job * update name to `DMeta` * `autopep8.sh` applied * fix runner version --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9a4ad10
commit 4ce9039
Showing
23 changed files
with
444 additions
and
87 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -12,7 +12,7 @@ on: | |
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
This file contains 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 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 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 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
python -m autopep8 metadoc --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose --ignore=E721 | ||
python -m autopep8 dmeta --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose --ignore=E721 | ||
python -m autopep8 otherfiles --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose --ignore=E721 | ||
python -m autopep8 setup.py --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose |
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
python -m autopep8 metadoc --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose --ignore=E721 | ||
python -m autopep8 dmeta --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose --ignore=E721 | ||
python -m autopep8 otherfiles --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose --ignore=E721 | ||
python -m autopep8 setup.py --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose |
This file contains 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,7 @@ | ||
art==6.1 | ||
setuptools>=40.8.0 | ||
vulture>=1.0 | ||
bandit>=1.5.1 | ||
pydocstyle>=3.0.0 | ||
pytest>=4.3.1 | ||
pytest-cov>=2.6.1 |
This file contains 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,4 @@ | ||
# -*- coding: utf-8 -*- | ||
"""DMeta modules.""" | ||
from .params import DMETA_VERSION | ||
__version__ = DMETA_VERSION |
This file contains 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,63 @@ | ||
"""DMeta main.""" | ||
import argparse | ||
from art import tprint | ||
from dmeta.functions import run_dmeta, dmeta_help | ||
from dmeta.params import DMETA_VERSION | ||
|
||
|
||
def main(): | ||
""" | ||
CLI main function. | ||
:return: None | ||
""" | ||
tprint("DMeta") | ||
tprint("V:" + DMETA_VERSION) | ||
dmeta_help() | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
'--clear', | ||
nargs=1, | ||
metavar=".docx file", | ||
type=str, | ||
help="the `clear` command clears all matadata in the given `.docx` file.", | ||
) | ||
parser.add_argument( | ||
'--clear-all', | ||
action="store_true", | ||
default=False, | ||
help='the `clear-all` command clears all metadata in any `.docx` file in the current directory.', | ||
) | ||
parser.add_argument( | ||
'--update', | ||
nargs=1, | ||
metavar=".docx file", | ||
type=str, | ||
help="the `update` command updates the given .docx file's metadata according to the given .json config file." | ||
) | ||
parser.add_argument( | ||
'--update-all', | ||
action="store_true", | ||
default=False, | ||
help='the `update-all` command updates all metadata in any `.docx` file in the current directory according to the given .json config file.', | ||
) | ||
parser.add_argument( | ||
'--config', | ||
nargs=1, | ||
metavar=".json config file", | ||
type=str, | ||
help="the `config` command specifices the way metadata in the .docx files get updated." | ||
) | ||
# parse the arguments from the standard input | ||
args = parser.parse_args() | ||
run_dmeta(args) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
|
||
# testcases: | ||
# dmeta --clear "test.docx" | ||
# dmeta --clear-all | ||
# dmeta --update "test.docx" --config "cnf.json" | ||
# dmeta --update-all --config "cnf.json" |
Oops, something went wrong.