Skip to content

Commit

Permalink
Add Alma API Client
Browse files Browse the repository at this point in the history
Why these changes are being introduced:
Application needs to communicate with Alma via Acquistions API

How this addresses that need:
* Adds alma module with AlmaClient class, including methods to retrieve
  the necessary data for Invoice processing and mark processed invoices paid.
* Adds tests and fixtures to reflect changes.

Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/IN-731
  • Loading branch information
adamshire123 committed Mar 1, 2023
1 parent fe7f501 commit 6936d98
Show file tree
Hide file tree
Showing 9 changed files with 589 additions and 106 deletions.
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ mypy = "*"
pylama = {extras = ["all"], version = "*"}
pytest = "*"
pydocstyle = "*"
requests-mock = "*"
types-requests = "*"

[requires]
python_version = "3.11"
Expand Down
172 changes: 103 additions & 69 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sets trasmitted invoice to paid in Alma
## Required ENV
- `ALMA_API_URL` = Base URL for making Alma API calls
- `ALMA_API_READ_WRITE_KEY` = API key for making Alma API calls
- `SAP_DROPBOX_CONNECTION` = JSON formatted connection information for accessing SAP dropbox
- `SAP_DROPBOX_CLOUDCONNECTOR_JSON` = JSON formatted connection information for accessing SAP dropbox
- `SAP_REPLY_TO_EMAIL` = reply-to email on emails to SAP recipient email lists
- `SAP_FINAL_RECIPIENT_EMAIL` = moira list to recieves final run emails
- `SAP_REVIEW_RECIPIENT_EMAIL` = moira list to recieve review run emails
Expand All @@ -23,5 +23,6 @@ sets trasmitted invoice to paid in Alma
- `WORKSPACE` = Set to `dev` for local development, this will be set to `stage` and `prod` in those environments by Terraform.

## Optional ENV
- `LOG_LEVEL` = Optional, set to a valid Python logging level (e.g. DEBUG, case-insensitive) if desired. Can also be passed as an option directly to the ccslips command. Defaults to INFO if not set or passed to the command.
- `ALMA_API_TIMEOUT`= Request timeout for Alma API calls. Defaults to 30 seconds if not set.
- `LOG_LEVEL` = Set to a valid Python logging level (e.g. DEBUG, case-insensitive) if desired. Can also be passed as an option directly to the ccslips command. Defaults to INFO if not set or passed to the command.
- `SENTRY_DSN` = If set to a valid Sentry DSN, enables Sentry exception monitoring. This is not needed for local development.
Loading

0 comments on commit 6936d98

Please sign in to comment.