-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit brings all of the original assets of the automation tools' amclient (Archivematica API client) into a single pypi package. The first release is a drop-in replacement for that work in the modules and tools that already make use of it.
- Loading branch information
1 parent
7e7191f
commit c032974
Showing
65 changed files
with
109,251 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Ensure that fixtures do not generate additional noise for those | ||
# doing code-review. | ||
|
||
# vcrpy generated files. | ||
fixtures/vcr_cassettes/*.yaml linguist-generated=true |
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,23 @@ | ||
*.py[co] | ||
*.swp | ||
*~ | ||
|
||
# Eclipse IDE files | ||
.project | ||
.pydevproject | ||
.settings/ | ||
|
||
# Sublime files | ||
*.sublime-* | ||
|
||
# Log files | ||
*.log.[0-9] | ||
*.log | ||
|
||
# Tox files | ||
.tox/ | ||
|
||
# Build output | ||
build/ | ||
dist/ | ||
*.egg-info/ |
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,34 @@ | ||
--- | ||
|
||
sudo: false | ||
|
||
language: python | ||
cache: pip | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- p7zip-full | ||
|
||
before_script: | ||
- pip install tox | ||
|
||
script: tox | ||
|
||
notifications: | ||
email: false | ||
|
||
matrix: | ||
include: | ||
|
||
- python: "2.7" | ||
env: TOXENV=py27 | ||
|
||
- python: "3.6" | ||
env: TOXENV=py36 | ||
|
||
- python: "2.7" | ||
env: TOXENV=py27-flake8 | ||
|
||
- python: "3.6" | ||
env: TOXENV=py36-flake8 |
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,25 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
.PHONY: clean package package-deps package-source package-upload package-wheel | ||
|
||
package-deps: ## Upgrade dependencies for packaging | ||
python3 -m pip install --upgrade twine wheel | ||
|
||
package-source: ## Package the source code | ||
python3 setup.py sdist | ||
|
||
package-wheel: package-deps ## Package a Python wheel | ||
python3 setup.py bdist_wheel --universal | ||
|
||
package-upload: package-deps package-source package-wheel ## Upload package | ||
twine upload dist/* --repository-url https://upload.pypi.org/legacy/ | ||
|
||
package: package-upload | ||
|
||
clean: ## Clean the package directory | ||
rm -rf amclient.egg-info/ | ||
rm -rf build/ | ||
rm -rf dist/ | ||
|
||
help: ## Print this help message. | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
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,2 +1,44 @@ | ||
# amclient | ||
Archivematica API client module | ||
|
||
The transfers/amclient.py script is a module and CLI that provides | ||
functionality for interacting with the various Archivematica APIs. | ||
|
||
Basic usage: | ||
`amclient.py <subcommand> [optional arguments] <positional argument(s)>` | ||
|
||
E.g.: | ||
```bash | ||
amclient.py close-completed-transfers \ | ||
--am-user-name test 234deffdf89d887a7023546e6bc0031167cedf6 | ||
``` | ||
|
||
To see a list of all commands and how they are used, then run `amclient.py` | ||
without any arguments. | ||
|
||
To understand how to use an individual subcommand, simply run: | ||
`amclient.py <subcommand>`, the output will describe the input parameters for | ||
that command: | ||
|
||
E.g.: | ||
```bash | ||
usage: amclient extract-file [-h] [--ss-user-name USERNAME] [--ss-url URL] | ||
[--directory DIR] | ||
[--saveas-filename SAVEASFILENAME] | ||
ss_api_key package_uuid relative_path | ||
``` | ||
|
||
Calling the module from Python: | ||
|
||
E.g.: | ||
```python | ||
Python 3.6.7 (default, Oct 22 2018, 11:32:17) | ||
[GCC 8.2.0] on linux | ||
Type "help", "copyright", "credits" or "license" for more information. | ||
>>> from amclient import AMClient | ||
>>> am = AMClient() | ||
>>> am.ss_url = "http://127.0.0.1:62081" | ||
>>> am.ss_user_name = "test" | ||
>>> am.ss_api_key = "test" | ||
>>> am.list_storage_locations() | ||
...json is output here... | ||
``` |
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,9 @@ | ||
Artefactual Systems Inc. <http://artefactual.com> owns all Archivematica | ||
trademarks, service marks, and graphic logos. | ||
|
||
Archivematica's LICENSE does not grant permission to use the trade names, | ||
trademarks, service marks, or product names of the Licensor except as required | ||
for reasonable and customary use in describing the origin of the Work. | ||
|
||
Guidelines for the use of Archivematica trademarks, service marks, and graphic | ||
logos are available at http://archivematica.org/trademark. |
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,9 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
# Import the primary AMClient script. | ||
from .amclient import AMClient | ||
|
||
# If the additional module commands need to be included they can also be | ||
# included here. | ||
__all__ = [] |
Oops, something went wrong.