Skip to main content

Upsource API

Project description

Upsource API

A Python client library for accessing Upsource APIs. These client library are not complete and are in developing mode.

Index

  1. Install
  2. Usage
  3. Publish package

Install

You can run Upsource API through Docker:

docker run -it --rm vanyaland/upsourceapi --help

Build by your own:

docker build -t upsourceapi .
docker run -it --rm upsourceapi --help

or install it using the Python package manager:

pip install .

Usage

Command line usage

In this section we cover in detail each of the commands implemented in upsourceapi.

upsourceapi --help

Commands

Get all projects

With this command you can the list of all short project infos.

  • --base-url: Base URL of the Upsource API.
  • --auth-token: Upsource authorization token, provide it to see private projects. optional

Example:

upsourceapi get-all-projects \
  --base-url "https://example.com/~rpc" \
  --auth-token "AUTH_TOKEN"

Create a project

You must have configured your SSH previously.

With this command you can create upsource project.

  • --base-url: Base URL of the Upsource API.
  • --auth-token: Upsource authorization token. To see private projects.
  • --project-name: Name for the new Upsource project.
  • --project-url: The URL to the repo, e.g. ssh://git@example.com/example-repo.git.
  • --ssh-key: Private SSH key in OpenSSH format.
  • --ssh-key-passphrase: SSH key passphrase.
  • --sync-token: Anonymous access to the GitLab/GitHub API is forbidden. Please provide an OAuth 2.0 token (recommended) or a personal access token, which we'll use to read data from GitLab/GitHub. Write requests will be performed on behalf of each individual Upsource user.

Example:

upsourceapi create-project \
  --auth-token "AUTH_TOKEN" \
  --base-url "https://example.com/~rpc" \
  --project-name "example-project" \
  --project-url "ssh://git@example.com/example-project.git" \
  --ssh-key "$(cat ~/.ssh/id_rsa)" \
  --ssh-key-passphrase "ssh-key-passphrase" \
  --sync-token "OAuth 2.0 token"

Find projects

With this command you can get the list of projects matching a given search criteria.

  • --base-url: Base URL of the Upsource API.
  • --auth-token: Upsource authorization token, provide it to see private projects. optional
  • --pattern: Search query, e.g. part of the name.
  • --limit: Number of projects to return.

Example:

docker run -it --rm upsourceapi find-projects \
  --base-url "https://example.com/~rpc" \
  --auth-token "AUTH_TOKEN" \
  --pattern "query" \
  --limit 10

Publish package

Create a source distribution with the following command:

python3 setup.py sdist

Start upload process:

twine upload dist/*

or

python3 -m twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

upsourceapi-0.1.4.tar.gz (14.6 kB view details)

Uploaded Source

File details

Details for the file upsourceapi-0.1.4.tar.gz.

File metadata

  • Download URL: upsourceapi-0.1.4.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for upsourceapi-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0af2bccc001254e876934a42a2caeb6c74b36da032b9e622c7dfab6a0be6e715
MD5 f00f4eff0968115c7575b205673d4836
BLAKE2b-256 68b20df835f697e4b10ab43a82f3259c7da2315e0c62e35345cf44843211a278

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page