Skip to content
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

Bump certifi from 2018.4.16 to 2022.12.7 #206

Open
wants to merge 341 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
341 commits
Select commit Hold shift + click to select a range
8cb5526
Merge remote-tracking branch 'OpenConceptLab/master'
maurya Feb 9, 2018
0b6e1bd
Updating scripts to use zip instead of tar and removed forwarding hea…
maurya Feb 9, 2018
af8d9ce
Merge pull request #198 from maurya/master
maurya Feb 9, 2018
7f567f8
Added imapexport and modified directory structure
paynejd Jul 15, 2018
3e97dfb
Merge remote-tracking branch 'origin/master'
paynejd Jul 15, 2018
a601f92
Interim update
paynejd Jul 16, 2018
3f21537
Removed all circular imports
paynejd Jul 16, 2018
11fdb29
fixed a couple typos
paynejd Jul 16, 2018
480fdf0
Interim update to the imap import scripts
paynejd Jul 17, 2018
f5f7f8b
Added FY17 and RW-FY18 CSV files
paynejd Sep 4, 2018
2a862db
Major MOH transform update
paynejd Sep 4, 2018
80f44b0
Removed pre-populated parameters from imapexport.py
paynejd Sep 4, 2018
08db180
adding country name to the accepted argument list
maurya Sep 5, 2018
3ca8eb0
Added additional FY18 CSV examples
paynejd Sep 5, 2018
8c82765
Fixed CSV fieldname typo
paynejd Sep 5, 2018
5997961
adding verbosity and exclude_empty_maps to parameters
maurya Sep 5, 2018
b99b4e0
fixing integer conversion issue for verbosity
maurya Sep 5, 2018
3456bc9
Added additional debug output to import and export scripts
paynejd Sep 6, 2018
c39a3af
Created script to import multiple countries at once
paynejd Sep 6, 2018
8552df9
Fixed typo in imapimport.py
paynejd Sep 7, 2018
7ec466c
Added include_extra_info to IMAP display and get_imap_data methods
paynejd Sep 7, 2018
60ab6ce
Adding a workaround to handle default period from mediators
maurya Sep 7, 2018
00f3266
Added include_extra_info parameter to imapexport.py
paynejd Sep 7, 2018
e7bb753
Handling boolean case for command line arguments
maurya Sep 7, 2018
9bce4a4
Added Handling include_extra_info from command line arguments to supp…
maurya Sep 7, 2018
a44f0dd
Added null_disag support for imports and exports
paynejd Sep 13, 2018
34e343f
Updated requirements.txt to the new ocldev package
paynejd Sep 14, 2018
d16054e
Added "delete org if exists" feature to import scripts
paynejd Sep 23, 2018
eb34f9d
Added support for HTML IMAP exports
paynejd Oct 3, 2018
7a85960
Improved log output for errors during export
paynejd Oct 9, 2018
f4ffe60
Added dedup to generating import script from diff
paynejd Oct 11, 2018
224bea5
Improved log output for IMAP imports
paynejd Oct 12, 2018
2282400
adding test mode as an argument to the script
maurya Oct 12, 2018
7755df3
changing the script to accept testmode argument
maurya Oct 12, 2018
1e1f76e
Fixing indentation and ascii character error for test_mode
maurya Oct 12, 2018
875f140
Changed import script to fetch latest IMAP for diff and to retire cou…
paynejd Oct 17, 2018
b4f79f5
Improved export script handling of country IMAP versions
paynejd Oct 17, 2018
7c55d1f
Added feature to auto-populate country name in import if blank
paynejd Oct 19, 2018
555f4eb
Adding support scripts - celery and shell scripts
maurya Oct 23, 2018
403e0b0
adding country locking response in imapexport
maurya Oct 23, 2018
d9a9369
Adding execution permissions to shell scripts
maurya Oct 23, 2018
c103b1e
Updating status codes for task status check
maurya Oct 24, 2018
43eedec
Fixed debug output error with IMAP column mismatch
paynejd Mar 27, 2019
fc79917
Udpated requirements.txt to use ocldev v0.1.14
paynejd Mar 27, 2019
29fda38
Removed unrecognized columns from DatimImap objects when loaded
paynejd Mar 27, 2019
8f46394
Updated imap export to handle empty country mapping collections
paynejd Apr 10, 2019
ac61a6e
Updated package to ocldev v0.1.16
paynejd Apr 10, 2019
44bc84d
Fixed IMAP field name typo
paynejd Apr 10, 2019
6eb7110
Improved unicode handling when loading CSVs
paynejd Apr 16, 2019
bc51559
Fixed issue with loading unicode into DatimImap object
paynejd Apr 17, 2019
4c2916a
Cleaned utils folder
paynejd Apr 17, 2019
aebafd2
Updated documentation for importinit.py
paynejd Apr 17, 2019
de1de2a
Comitted clean LS FY-17 csv
paynejd Apr 17, 2019
7588f08
Removing un-needed settings
maurya Apr 17, 2019
2a32722
Modified batch import #1 to use the bulk import
paynejd Apr 20, 2019
c23348f
Updated ocldev package to v0.1.17
paynejd Apr 20, 2019
653ffd3
Incorporated bulk import API in part 2 of IMAP import
paynejd Apr 24, 2019
777a9b9
Merge branch 'bulk_import'
paynejd Apr 24, 2019
05caf5a
Updated to ocldev v0.1.18
paynejd Apr 24, 2019
8dc9e1e
Added ability to set public_access for country org/repo
paynejd Apr 30, 2019
29442f1
Merge branch 'bulk_import'
paynejd Apr 30, 2019
49e6613
Added ability to load IMAP from JSON in addition to CSV
paynejd May 10, 2019
59beeaa
Fix file ending issues
maurya May 31, 2019
4f40647
Updated MOH sync and show scripts
paynejd Jun 1, 2019
263adce
Implemented helper class for MOH sync and show
paynejd Jun 1, 2019
f96205d
Merge branch 'master' of https://github.com/OpenConceptLab/DATIM-Meta…
paynejd Jun 1, 2019
2ce916f
Fixed DatimConstants typo & many minor changes
paynejd Jun 4, 2019
f961dd3
Major update for FY19
paynejd Jun 6, 2019
9eede6e
Updating shell scripts references
maurya Jun 6, 2019
8984640
Adding datim folder to the shell scripts
maurya Jun 6, 2019
888800b
Updating datim references to direct show references in shell scripts
maurya Jun 6, 2019
ace24fc
Finished updating for FY19 MVP
paynejd Jun 11, 2019
fa580ef
Improved IMAP CSV validation
paynejd Jul 8, 2019
6a59df7
Modified IMAP scripts to support reused indicator/disag IDs
paynejd Jul 11, 2019
a00cfe9
adding utf-8 encoding to fix https://github.com/pepfar-datim/DATIM-OC…
maurya Jul 17, 2019
4b023f1
Added to utils
paynejd Aug 7, 2019
1354154
Merge branch 'master' of https://github.com/OpenConceptLab/DATIM-Meta…
paynejd Aug 7, 2019
9ddd378
Moved dhis2 account settings out of individual scripts
paynejd Aug 7, 2019
c4c75ea
adding Pipfile
maurya Aug 15, 2019
300b0eb
Adding Pipfile.lock
maurya Aug 15, 2019
17a33e6
Moved ocl account settings out of individual scripts
maurya Aug 15, 2019
7bc1250
change repo to period
maurya Aug 15, 2019
9f3a094
Implemented temp permissions fix
paynejd Aug 16, 2019
efc45c0
Merge branch 'master' of https://github.com/OpenConceptLab/DATIM-Meta…
paynejd Aug 16, 2019
19cee7a
Updated export request round 2
paynejd Aug 16, 2019
aa628d9
Switched country public access to view
paynejd Aug 16, 2019
c930f32
Updated DatimBase export requests to use auth token again
paynejd Aug 17, 2019
54dfb3f
Fixing #351 issues with production deployment
maurya Aug 18, 2019
78532d8
sourcing python to pipenv shell version
maurya Aug 18, 2019
8d50170
removing unneded processing to improve speed
maurya Aug 18, 2019
24b69cd
Implemented async export requests for IMAP export
paynejd Aug 22, 2019
8a75eae
Removed 2 unused files
paynejd Aug 22, 2019
f854184
Improved IMAP diffs and import logging output
paynejd Aug 23, 2019
8fed216
Updated requirements.txt
paynejd Aug 23, 2019
31e9ee8
updated Pipfile and Pipfile.lock
maurya Aug 23, 2019
2cf408e
Implemented DatimImapTests and improved IMAP import/export scripts
paynejd Aug 29, 2019
f3ebc5f
Removed comment block from imaptest.py
paynejd Aug 29, 2019
56ae350
Modified imaptest.py to use OCL env from settings.py
paynejd Aug 29, 2019
aca1df8
Improved debug output in DatimImap.create_repo_version
paynejd Aug 29, 2019
5c76b32
Updated to latest ocldev package
paynejd Aug 29, 2019
c75cfd2
Adding new Pipfile and Pipfile.lock
maurya Aug 30, 2019
c4d187f
Implemented time profiling
paynejd Sep 3, 2019
9c24b9d
Improved handling of repo export POST responses
paynejd Sep 4, 2019
01d703b
Updated to latest ocldev package
paynejd Nov 18, 2019
419e85c
Updated DatimImap to point to new OclConstants
paynejd Nov 18, 2019
868cd2b
adding a shell for #421 python script
maurya Jan 28, 2020
765f96b
Created ShowMsp with custom data element ID list support
paynejd Mar 2, 2020
edd8a87
Merge branch 'master' of https://github.com/OpenConceptLab/DATIM-Meta…
paynejd Mar 2, 2020
d7db84c
adding requirements info
maurya Mar 4, 2020
ee41966
Initial qmap commit plus showmsp.py command line updates
paynejd Mar 11, 2020
cc39574
Added option to use separate admin token for deleting existing Qmap
paynejd Mar 12, 2020
f24567f
Updated requirements.txt
paynejd Mar 12, 2020
02ca956
Changed exportqmap.py to return correct string
paynejd Mar 17, 2020
415e0c4
Create bulkImportStatus.py
maurya Mar 26, 2020
97d9b7e
Updated QMAP to retrieve questionnaire from FHIR server
paynejd Apr 9, 2020
a3cabd8
Fixed typo in Questionnaire error handler
paynejd Apr 13, 2020
32f512e
Update importqmap.py
paynejd Apr 13, 2020
9b871d9
Added sample QMAP files
paynejd Apr 13, 2020
aab1ac9
Changed QMAP export errors to return JSON
paynejd Apr 13, 2020
bb16d5c
suppressing urllib error
maurya Apr 15, 2020
8e77d85
changing imapexport to a named arguments format
maurya Apr 22, 2020
d6308d1
Switched qmap ID to uid instead of name
paynejd Apr 27, 2020
0da61f0
Updated ocldev to v0.1.58
paynejd Apr 27, 2020
a06f774
Update output handling for bulkIMportStatus.py
paynejd Apr 28, 2020
c2719f3
Fixing args token not being taken into account
maurya May 4, 2020
9a525a5
Updated ocldev package and fixed null_disag ID
paynejd May 5, 2020
aa56395
Implemented getimaporgs.py
paynejd May 6, 2020
e30d1e5
Fixed environment url and api token
paynejd May 6, 2020
f2eb1ed
Changed imapexport error handling to return JSON
paynejd May 6, 2020
3d427df
Reverting DatimBase.NULL_DISAG_ID to use hyphen
paynejd May 6, 2020
ab782c2
Changed imapimport.py to use argparse
paynejd May 6, 2020
2a540f6
Updated to ocldev v0.1.60
paynejd May 6, 2020
1d14907
Added docstring for getimaporgs.py
paynejd May 6, 2020
087f8bd
Added request retries to IMAP exports & standard attr to IMAP repos
paynejd May 7, 2020
a2f0e5c
Initial commit of getqmaprepos.py
paynejd May 7, 2020
6286e70
Finished up get imap/qmap scripts
paynejd May 11, 2020
3011f16
Revised example usage docstrings
paynejd May 11, 2020
cd41b0f
Removed debug code from imapimport.py
paynejd May 12, 2020
5ddfd40
Made auth token optional for showmsp
paynejd May 12, 2020
9e668fa
changing moh to named arguments
maurya May 15, 2020
36552b4
adding domain
maurya May 20, 2020
995f381
Create oclPassThroughRequests.py
maurya May 20, 2020
91892cc
updating token requirement
maurya May 20, 2020
c68f39d
Removed old defaults from showmoh.py
paynejd May 28, 2020
5afdb0b
Improved error handling and logging for showmsp
paynejd May 28, 2020
d397544
Cleaned up CSVs
paynejd Jun 2, 2020
37303cb
Cleanup
paynejd Jun 2, 2020
39db9c8
Annotated timer steps
paynejd Jun 2, 2020
d1e0f2a
Preparing for imap import refactor
paynejd Jun 5, 2020
b3696fc
Merge pull request #201 from OpenConceptLab/ImapRefactor
paynejd Jun 5, 2020
84a5f22
Refactored IMAP importer
paynejd Jun 8, 2020
127ba4d
Exported FY18/19 MOH data elements from all environments for comparison
paynejd Jun 8, 2020
7a130db
Merge branch 'ImapRefactor'
paynejd Jun 8, 2020
0dbd8a6
Added new custom attributes to DATIM MOH repositories
paynejd Jun 11, 2020
cbf5ef8
adding codelists passthrough request
maurya Jun 12, 2020
9ec91ae
Update oclPassThroughRequests.py
maurya Jun 12, 2020
ea3c9e3
updating successful response
maurya Jun 12, 2020
d366a61
removing json dumps
maurya Jun 12, 2020
a19451e
adding mohsources
maurya Jun 12, 2020
95eeca1
removing unnecessary character
maurya Jun 12, 2020
6eb04ae
updating moh sources link
maurya Jun 12, 2020
d9e6267
Finished IMAP import overhaul
paynejd Jul 1, 2020
da1d0a3
Changed getter scripts to use API request with custom attribute filters
paynejd Jul 1, 2020
e5f4ba0
adding country code argument for passthrough
maurya Jul 2, 2020
96a5336
adding default format
maurya Jul 2, 2020
b30ae61
Added DEMO-FY20 IMAP
paynejd Jul 7, 2020
45c7a10
Merge branch 'master' of https://github.com/OpenConceptLab/DATIM-Meta…
paynejd Jul 7, 2020
42a7239
Updated for MOH FY20
paynejd Jul 8, 2020
4aae56b
Added new IMAP validation for FY20
paynejd Jul 8, 2020
1484d89
Modified MOH collection IDs and implemented imapdiff.py
paynejd Jul 8, 2020
373bb28
adding extra underscore
maurya Jul 9, 2020
df3fc39
changing error status code to 500
maurya Jul 10, 2020
9434d5e
adding json wrapper to succesful summary import status
maurya Jul 10, 2020
2abd40c
fixing text
maurya Jul 10, 2020
2b4554d
changin to response code
maurya Jul 10, 2020
bb17bf9
check response codes for bulk import passthrough
maurya Jul 10, 2020
580c3e6
cleaning json of u string
maurya Jul 10, 2020
46ea422
adding conditional verbosity
maurya Jul 10, 2020
d9a1b4b
modifying bool condition
maurya Jul 10, 2020
9c83056
updating verbosity boolean
maurya Jul 10, 2020
e95b544
making bulk import upper to resolve status errors
maurya Jul 10, 2020
e584b8f
Added IMAP samples
paynejd Jul 13, 2020
8c72226
Merge branch 'master' of https://github.com/OpenConceptLab/DATIM-Meta…
paynejd Jul 13, 2020
9a075ee
updating OCL passthrough for Bulk import status
maurya Jul 16, 2020
7175016
Added 3-letter country code and updated pass-thru mediator support
paynejd Jul 16, 2020
2503463
Merge branch 'country-codes'
paynejd Jul 16, 2020
b09fc97
Implemented imapbackup.py, improved pylint score
paynejd Jul 22, 2020
8d6edc3
Merge pull request #202 from OpenConceptLab/imap_backup
maurya Jul 23, 2020
ce8b103
Fixed FY18/19 MOH codelist discrepancies
paynejd Jul 27, 2020
26aaa07
updating moh codelists and datim codelists names
maurya Jul 28, 2020
a6f1363
fixing a typo
maurya Jul 28, 2020
a28d2e4
Initial commit of imaprestore.py
paynejd Jul 29, 2020
45e1aab
Improved output JSON of IMAP import scripts
paynejd Jul 29, 2020
6354189
Added filter params to imaprestore.py
paynejd Jul 31, 2020
f54786e
Added bulk import queue support to IMAP import
paynejd Jul 31, 2020
252b544
Update requirements.txt
paynejd Jul 31, 2020
5f0c894
Merge branch 'imap_backup'
paynejd Jul 31, 2020
d1daf68
Updated bulk import queue key for IMAP import
paynejd Jul 31, 2020
f665818
Fixed bulk import queue key
paynejd Jul 31, 2020
1094bf7
Update requirements.txt
paynejd Jul 31, 2020
9249103
Added queue management to IMAP import/export
paynejd Aug 3, 2020
2f3242c
Merge pull request #203 from OpenConceptLab/imap-import-queue
maurya Aug 6, 2020
1f5ac54
Updated FY20 classifications for qFWmLNueTPF
paynejd Aug 7, 2020
e7bb39c
Update the PEPFAR-Test reference for DATIM codelists
maurya Aug 18, 2020
11222ea
removing pprint to resolve ansible installatiton issues - MoH-PEPFAR-…
maurya Aug 24, 2020
0944bc0
Updating piploc and pip file
maurya Aug 25, 2020
1cd939c
adding changes from vlad
maurya Aug 25, 2020
d87902e
Added operation type to mapping id
paynejd Nov 5, 2020
341bb31
Initial commit for supporting oclapi2
paynejd Jan 15, 2021
208798e
Minor fixes in datim imap scripts
paynejd Jan 26, 2021
5ba61fd
making minor changes. to passthrough scripts
maurya Jan 26, 2021
749be0f
making changes to. support api update 2 in passthrough scripts
maurya Jan 26, 2021
f857039
adding arguments for ocl passthrough script
maurya Jan 27, 2021
87b252c
Updates for new mapping model
paynejd Feb 3, 2021
5472a6e
Updated export handler
paynejd Feb 5, 2021
c03d007
Updated for new mapping model
paynejd Feb 8, 2021
7bc255e
Improved logic checking for availability of cached export
paynejd Feb 11, 2021
d415724
Added released=true param to DatimImapFactory#get_repo_latest_period_…
paynejd Feb 11, 2021
ecd60ff
adding changes for api2 bulk import response
maurya Feb 18, 2021
5a38cf9
Updated to latest ocldev
paynejd Feb 23, 2021
ca2de97
Fixed get_qmap_domains method for oclapi2
paynejd Feb 24, 2021
d5e1380
Updated qmap to ocldev 0.1.86
paynejd Feb 24, 2021
f091458
Modified qmap to support new choiceMap
paynejd Mar 10, 2021
797decd
Implemented qmap headerPath and unmapped field support
paynejd Mar 15, 2021
1d98b42
Improved OCL API multi-version support
paynejd Apr 5, 2021
c3f000d
Updated URLs for launch, added imapdiffbackup.py
paynejd Apr 12, 2021
919d59b
Backups for FY18-20
paynejd Apr 20, 2021
d967b78
Merge branch 'oclapi2-update'
paynejd Apr 20, 2021
73792cc
commenting out pprint
maurya Apr 29, 2021
e6d5caa
removing duplicate settings
maurya Apr 29, 2021
90ee120
Added `logic` field for qmap header items
paynejd May 10, 2021
3e6f901
Merge branch 'master' of github.com:OpenConceptLab/ocl_datim
paynejd May 10, 2021
9a3d49a
removing unused shell scripts and local celery files
maurya May 18, 2021
3a023ab
Squashed commit of the following:
paynejd Aug 11, 2021
e312342
removing pprint from the last commit
maurya Aug 26, 2021
9a24a46
Revised FY21 content. Removed pprint
paynejd Aug 27, 2021
75901c7
Added MER-FY21 T-PSNU codelist
paynejd Sep 23, 2021
21cb4ce
Minor updates for OCL's new dev env & expansions model
paynejd Feb 10, 2022
e72ff65
Blank settings file
paynejd May 31, 2022
7141c24
Configured pylint
paynejd Jul 25, 2022
05785a6
Squashed commit of the following:
paynejd Jul 25, 2022
7113b9d
Improved documentation
paynejd Aug 15, 2022
9428909
Updated FY22 category code process
paynejd Aug 16, 2022
311a085
Updated to latest ocldev
paynejd Aug 16, 2022
e891dbe
Updating pipfile
maurya Aug 16, 2022
6d71a90
Updating pipfile lock to python version 3.9
maurya Aug 16, 2022
c79cf52
Minor fixes
paynejd Aug 18, 2022
7cdfe9e
Merge branch 'master' of github.com:OpenConceptLab/ocl_datim
paynejd Aug 18, 2022
fb4efd4
Slimmed down settings file
paynejd Aug 18, 2022
237341b
Bump certifi from 2018.4.16 to 2022.12.7
dependabot[bot] Dec 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.idea/*
*.pyc
*.log
*.tar
data/*
logs/*

*.pyc
datim/.DS_Store
.DS_Store
.pylintrc
3 changes: 3 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[MASTER]
init-hook='import sys; sys.path.append("/Users/paynejd/dev/ocl_datim/")'

61 changes: 61 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
amqp = "==2.4.2"
astroid = "==2.11.5"
attrs = "==19.3.0"
billiard = "==3.5.0.5"
celery = "==4.2.2"
certifi = "==2022.12.7"
chardet = "==3.0.4"
configparser = "==3.5.0"
contextlib2 = "==0.6.0.post1"
deepdiff = "==3.3.0"
dnspython = "==1.16.0"
enum34 = "==1.1.6"
eventlet = "==0.25.1"
gevent = "==21.12.0"
greenlet = "==1.1.2"
grequests = "==0.6.0"
idna = "==2.7"
importlib-metadata = "==1.5.0"
isort = "==4.3.4"
jsonpickle = "==0.9.6"
jsonschema = "==3.2.0"
kombu = "==4.3.0"
lazy-object-proxy = "==1.7.1"
mccabe = "==0.6.1"
monotonic = "==1.5"
ocldev = "==0.1.88"
pathlib2 = "==2.3.5"
pylint = "==2.14.1"
pyrsistent = "==0.18.1"
pytz = "==2018.9"
redis = "==3.2.1"
requests = "==2.24.0"
scandir = "==1.10.0"
singledispatch = "==3.4.0.3"
six = "==1.11.0"
urllib3 = "==1.23"
vine = "==1.3.0"
wrapt = "==1.14.1"
zipp = "==1.2.0"
dill = "==0.3.5.1"
platformdirs = "==2.5.2"
style = "==1.1.0"
toml = "==0.10.2"
tomli = "==2.0.1"
tomlkit = "==0.11.0"
typing-extensions = "==4.2.0"
unicodecsv = "==0.14.1"
vulture = "==2.4"
zope-event = "==4.5.0"
zope-interface = "==5.4.0"

[requires]
python_version = "3.9"
687 changes: 687 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

57 changes: 45 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,50 @@
## Installation

**Process**
1) Run MER_Indicators.py - expects input file named 'MER_Indicator.csv' containing list of unique MER Indicators by uid. Results in MER_Indicator.json file
2) Run MER_Disaggregation.py - expects input file named 'MER_Disaggregation.csv' containing list of unique MER Disaggregations by uid. Results in MER_Disaggregationr.json file
3) Run Mechanisms.py - expects input file named 'Mechanisms partners agencies OUS Start End.csv' containing list of unique Mechanisms by uid. Results in Mechanisms.json file
Please run `pip install -r requirements.txt` to install the required dependencies

### Environment setup
The settings for these scripts can be hard-coded or set as environment variables:
```
dhis2env = os.environ['DHIS2_ENV'] # DHIS2 Environment URL
dhis2uid = os.environ['DHIS2_USER'] # DHIS2 Authentication USER
dhis2pwd = os.environ['DHIS2_PASS'] # DHIS2 Authentication PASSWORD
oclapitoken = os.environ['OCL_API_TOKEN'] # OCL Authentication API
oclenv = os.environ['OCL_ENV'] # DHIS2 Environment URL
compare2previousexport = os.environ['COMPARE_PREVIOUS_EXPORT'] in ['true', 'True'] # Whether to compare to previous export
```

**Changes Made**
File: csv_to_json_flex
## Scripts
### Shared
* settings.py

1) Changed From print ('SKIPPING: '), csv_resource_def['definition_name']
TO print 'SKIPPING: ', csv_resource_def['definition_name']
2) Added argument and line for output JSON file
### IMAP
* imapexport.py
* imapimport.py
* showmoh.py
* MOH Sync Scripts
* syncmoh.py
* syncmohfy18.py
* syncmohfy19.py
* Test scripts:
* imaptest.py
* imaptestcompareocl2csv.py
* imaptestmediator.py

FILE: MER_Indicator etc...
1) process_by_row() function - remove 30 argument
2) _init_ - added output_filename argument
### QMAP
* exportqmap.py
* importqmap.py

### Supporting scripts
* bulkImportStatus.py
* celeryconfig.py
* constants.py
* import_manager.py
* import_util.py
* status_util.py

### Older scripts
* showmechanisms.py
* showmer.py
* syncmer.py
* syncmermsp.py
* synctest.py
68 changes: 68 additions & 0 deletions common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
""" Common methods and functions for command-line python tools """
import argparse
import requests


# Script constants
APP_VERSION = '0.1.0'
OCL_ENVIRONMENTS = {
'qa': 'https://api.qa.openconceptlab.org',
'dev': 'https://api.dev.openconceptlab.org',
'staging': 'https://api.staging.openconceptlab.org',
'production': 'https://api.openconceptlab.org',
'demo': 'https://api.demo.openconceptlab.org',
}


# Argument parser validation functions
def ocl_environment(string):
""" Return OCL environment URL for the specified enviroment key"""
if string not in OCL_ENVIRONMENTS:
raise argparse.ArgumentTypeError('Argument "env" must be %s' % (
', '.join(list(OCL_ENVIRONMENTS.keys()))))
return OCL_ENVIRONMENTS[string]


def get_imap_orgs(ocl_env_url, ocl_api_token, period_filter='', country_code_filter='',
verbose=False, ocl_api_version='v2'):
"""
Returns list of country Indicator Mapping organizations available in the specified OCL
environment. This is determined by the 'datim_moh_object' == True custom attribute of
the org. Orgs typically have an ID in the format 'DATIM-MOH-xx-FYyy', where 'xx' is
the country code (eg. CM, BI, UG) and 'yy' is the fiscal year (eg. 18, 19, 20).
Optional arguments 'period_filter' and 'country_code_filter' may be either a string or
a list and will filter the country list accordingly. For example, setting period_filter to
['FY18', 'FY19'] will only return IMAP orgs from those fiscal years. Similarly, setting
country_code_filter to ['UG', 'BI', 'UA'] will only return those three matching
country codes.
"""

# Prepare the filters
if period_filter:
if not isinstance(period_filter, list):
period_filter = [period_filter]
if country_code_filter:
if not isinstance(country_code_filter, list):
country_code_filter = [country_code_filter]

# Retrieve list of all orgs from OCL
extras_separator = '__' if ocl_api_version == 'v1' else '.'
ocl_api_headers = {'Content-Type': 'application/json'}
request_params = {
'limit': '200',
'verbose': 'true',
}
request_params['extras%sdatim_moh_object' % extras_separator] = 'true'
if period_filter:
request_params['extras%sdatim_moh_period' % extras_separator] = ','.join(period_filter)
if country_code_filter:
request_params['extras%sdatim_moh_country_code' % extras_separator] = ','.join(country_code_filter)
if ocl_api_token:
ocl_api_headers['Authorization'] = 'Token ' + ocl_api_token
url_all_orgs = '%s/orgs/' % ocl_env_url
response = requests.get(url_all_orgs, headers=ocl_api_headers, params=request_params)
if verbose:
print(response.url)
response.raise_for_status()
ocl_all_orgs = response.json()
return ocl_all_orgs
Binary file removed csv_to_json_flex.pyc
Binary file not shown.
File renamed without changes.
Loading