https://github.com/atlassian-labs/transfer-api-ref-client
Reference API implementation that supports large file uploads (>100GB) in a chunked and resumable fashion to https://transfer.atlassian.com
https://github.com/atlassian-labs/transfer-api-ref-client
transfer
Last synced: about 1 month ago
JSON representation
Reference API implementation that supports large file uploads (>100GB) in a chunked and resumable fashion to https://transfer.atlassian.com
- Host: GitHub
- URL: https://github.com/atlassian-labs/transfer-api-ref-client
- Owner: atlassian-labs
- License: apache-2.0
- Created: 2020-09-09T18:23:38.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-25T07:30:51.000Z (4 months ago)
- Last Synced: 2025-03-30T11:23:17.097Z (2 months ago)
- Topics: transfer
- Language: Python
- Homepage: https://transfer.atlassian.com
- Size: 43 KB
- Stars: 7
- Watchers: 6
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# transfer-api-ref-client
[](LICENSE)   
[](CONTRIBUTING.md)Welcome to the reference API client implementation for the [transfer.atlassian.com REST API](https://transfer.atlassian.com/swagger-ui/index.html?configUrl=/api-docs/swagger-config). This client is provided as a reference implementation for the provided [REST API](https://transfer.atlassian.com/swagger-ui/index.html?configUrl=/api-docs/swagger-config) which allows resumable and chunked file uploads to https://transfer.atlassian.com. It is provided as a command-line tool (CLI).
The tool performs file upload by chunks and can resume file upload after failures. If you are faced with failure during file upload, you can run the tool again and the tool skip chunks uploaded before and upload the missed file fragments automatically.
## Usage (simple)
1. Install the client. Refer: [Installation](#Installation)2. First, obtain an API token from transfer.atlassian.com/auth_token
3. Then use your favorite terminal to run the reference client to upload one or multiple files:
```
python app.py \
--file \
--file \
--issue_key= \
--user= \
--auth_token=
```
Note: `--issue-key` needs to refer to an existing open Support issue in the [Atlassian's Support System](https://support.atlassian.com) where you have proper permissions to add attachments.## Using Docker
It is possible to build a local Docker image which has all the necessary dependencies added. The tool can then be run by just running the container.
Steps:
1. Build the image: `docker build -t transfer-reference-client .`
1. Run the following command line to upload a file:docker run --rm -it --name transfer-reference-client \
--volume /:/upload \
transfer-reference-client:latest \
--file /upload/ \
--issue_key= \
--user= \
--auth_token=## Installation
1. Make sure you use Python3:
$ which python
It should point to a Python3 installation1. Clone this repository
1. Install the dependencies:pip install -r requirements.txt
1. (Optional) Run tests to ensure your environment is working properlypython -m unittest tests/*.py -v
Note:
If you encounter cryptography depedency installation error as below,
``` note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cryptography
Failed to build cryptography
```
you might need to manually install cryptography using
```
pip3 install cryptography
```## Development
For development we recommend use Python virtual environment:
```
$ virtualenv -p `which python3` .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt
$ python -m unittest tests/*.py -v
```## Tests
The existing tests are located in the `tests/` folder. They do not actually check full connectivity to the API but check the contract implementation.
You can run the tests using: `python -m unittest tests/*.py -v`
Note:
If you encounter `libmagic` issues while running the tests and see below error
```'failed to find libmagic. Check your installation'```
Then, you will need to install `libmagic`. You can do that using
### Mac
```
brew install libmagic
```### Debian/Ubuntu
```
sudo apt-get update
sudo apt-get install libmagic1 libmagic-dev
```### Windows
```
pip install python-magic-bin
```## Contributions
Contributions to `transfer-api-ref-client` are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
## License
Copyright (c) 2020 Atlassian and others.
Apache 2.0 licensed, see [LICENSE](LICENSE) file.
[](https://www.atlassian.com)