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

Create a 1.0.0-rc package #1

Merged
merged 1 commit into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .gitattributes
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
23 changes: 23 additions & 0 deletions .gitignore
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/

helenst marked this conversation as resolved.
Show resolved Hide resolved
# Build output
build/
dist/
*.egg-info/
34 changes: 34 additions & 0 deletions .travis.yml
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
25 changes: 25 additions & 0 deletions Makefile
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}'
44 changes: 43 additions & 1 deletion README.md
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...
```
9 changes: 9 additions & 0 deletions TRADEMARK
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.
9 changes: 9 additions & 0 deletions amclient/__init__.py
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__ = []
Loading