Skip to main content

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/*

Release files for upsourceapi 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for upsourceapi 0.1.4
File Size Uploaded
upsourceapi-0.1.4.tar.gz 14.6 kB Details

Release files / upsourceapi-0.1.4.tar.gz

Download URL upsourceapi-0.1.4.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0af2bccc001254e876934a42a2caeb6c74b36da032b9e622c7dfab6a0be6e715
BLAKE2b-256 checksum
How to use checksums
68b20df835f697e4b10ab43a82f3259c7da2315e0c62e35345cf44843211a278
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page