bintray package

Submodules

bintray.bintray module

Python Wrapper for Bintray API

https://bintray.com/docs/api

class bintray.bintray.Bintray(username=None, api_key=None)[source]

Bases: object

Python Wrapper for Bintray API

BINTRAY_URL = 'https://api.bintray.com'
create_access_key_org(org, id, url=None, cache_for_secs=None, expiry=None, white_cidrs=None, black_cidrs=None, api_only=False)[source]

Create a new access key identified by an access key id, for an organization.

An access key password will be auto-generated if not specified.
Parameters:
  • org – organization name
  • id – access key id
  • expiry – after that will be automatically revoked. (Unix epoch time in milliseconds)
  • url – URL for existence_check (callback)
  • cache_for_secs – specified period for caching result. minimum is 60 seconds.
  • white_cidrs – will allow access only for those IPs that exist in that address range
  • black_cidrs – will block access for all IPs that exist in the specified range.
  • api_only – allow access keys access to Bintray UI as well as to the API
Returns:

request response

create_access_key_user(user, id, url=None, cache_for_secs=None, expiry=None, white_cidrs=None, black_cidrs=None, api_only=False)[source]

Create a new access key identified by an access key id, for an user.

An access key password will be auto-generated if not specified.
Parameters:
  • user – user name
  • id – access key id
  • expiry – after that will be automatically revoked. (Unix epoch time in milliseconds)
  • url – URL for existence_check (callback)
  • cache_for_secs – specified period for caching result. minimum is 60 seconds.
  • white_cidrs – will allow access only for those IPs that exist in that address range
  • black_cidrs – will block access for all IPs that exist in the specified range.
  • api_only – allow access keys access to Bintray UI as well as to the API
Returns:

request response

create_entitlement(subject, repo=None, package=None, version=None, access=None, access_keys=None, path=None, tags=None, product=None)[source]
Create an entitlement on the specified scope. Scope can be a product, a repository with

an optional path, a package or a version.

When specifying an optional path value for repository scope, path needs to be relative and refer to a directory or a file in the repository.

Access mode can be either rw (read-write: implies download, upload and delete) or r (read: implies download).

When specifying a scope with product, access mode can only be r (read: implies download). Tags can be added for search purposes.

An entitlement id will be auto-generated if not specified.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version
  • product – product name (only for Enterprise Account)
  • access – entitlement access more (r/w)
  • access_keys – list of access keys
  • path – file path
  • tags – associated tags
Returns:

entitlements list

create_eula(subject, product, name, syntax, content, versions, default=False)[source]

Create a EULA for the given subject, with the given product.

A new EULA will apply to all new versions if the ‘default’ parameter is specified.

This resource is only available to Bintray Enterprise users.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • product – product name
  • name – EULA name
  • syntax – EULA syntax [markdown/asciidoc/plain_text default markdown]
  • content – EULA content
  • versions – product versions to use this new EULA
  • default – True if all product versions should use same EULA.
Returns:

request response

create_org_proprietary_license(org, name, description, url)[source]
Create a license associated with an organization.
Caller must be an admin of the organization.
Parameters:
  • org – Organization name
  • name – license name
  • description – license description
  • url – license url
Returns:

request answer

create_org_team(org, name, members, allow_repo_creation=True, business_unit=None)[source]

Create a new team for an organization

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • org – organization name
  • name – team name
  • members – list of members to be associated to the team
  • allow_repo_creation – team members are allowed to create and update repositories.
  • business_unit – a default business unit can be associated to a team and will be the default business unit for all repositories that are created by this team. A business unit can only be associated with a team if its members are allowed to create repositories.
Returns:

request response

create_package(subject, repo, package, licenses=None, vcs_url=None, custom_licenses=None, desc=None, labels=None, website_url=None, issue_tracker_url=None, github_repo=None, github_release_notes_file=None, public_download_numbers=None, public_stats=None)[source]

Creates a new package in the specified repo (user has to be an owner of the repo)

Security: Authenticated user with ‘publish’ permission, or repository read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • desc – package description
  • labels – package lables (tags)
  • licenses – list of licenses (mandatory for OSS packages)
  • custom_licenses – custom licenses (available only for Premium accounts)
  • vcs_url – VCS url (mandatory for OSS packages)
  • website_url – website url
  • issue_tracker_url – issue tracker url
  • github_repo – Github repository
  • github_release_notes_file – release notes on Github
  • public_download_numbers – display download number
  • public_stats – stats are public (available only for Premium accounts)
Returns:

request response

create_package_release_notes_bintray(subject, repo, package, syntax, content)[source]

Create release notes for a package by subject

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • syntax – content syntax
  • content – release notes content
Returns:

request response

create_package_release_notes_github(subject, repo, package, github_repo, github_release_notes_file)[source]

Create release notes for a package by subject

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • github_repo – GitHub repository name
  • github_release_notes_file – GitHub release notes file path
Returns:

request response

create_product(subject, name, display_name, desc, website, vcs, packages, sign_url_expiry=10)[source]

Create a product for the given subject.

Security: Authenticated user with ‘admin’ permission.
Parameters:
  • subject – repository owner
  • name – product name
  • display_name – product name to be displayed
  • desc – product description
  • website – product website url
  • vcs – product VCS url
  • packages – list of packages associated to the product
  • sign_url_expiry – expiration time
Returns:

request response

create_product_readme(subject, product, github=None, bintray_syntax=None, bintray_content=None)[source]

Sets the readme for all of a product’s underlying packages.

“content” has to be passed to the command if using “bintray”, or will be retrieved from a GitHub repository, when using “github”. GitHub repository name has to be provided.

Security: Authenticated user with ‘publish’ permission,
or package read/write entitlement.
Parameters:
  • subject – repository owner
  • product – product name
  • github – Github URL with README
  • bintray_syntax – Readme syntax e.g. [markdown/asciidoc/plain_text default markdown]
  • bintray_content – Readme content
Returns:

request response

create_readme(subject, repo, package, github=None, bintray_syntax=None, bintray_content=None)[source]

Creates a new readme for the specified package by subject.

“content” has to be passed to the command if using “bintray”, or will be retrieved from a GitHub repository, when using “github”. GitHub repository name has to be provided.

Security: Authenticated user with ‘publish’ permission,
or package read/write entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • github – Github URL with README
  • bintray_syntax – Readme syntax e.g. [markdown/asciidoc/plain_text default markdown]
  • bintray_content – Readme content
Returns:

request response

create_repository(subject, repo, type, description, private=False, labels=None, gpg_sign_metadata=False, gpg_sign_files=False, gpg_use_owner_key=False, business_unit=None, version_update_max_days=None)[source]

Create a repository under to the specified subject.

The possible types for a repository are: maven, debian, conan, rpm, docker, npm, opkg, nuget, vagrant and generic (default).

GPG auto sign flags - they let you specify whether GPG signing should be applied to this repo. auto signing with gpg is disabled by default.

Parameters:
  • subject – repository owner
  • repo – repository name
  • type – repository type
  • private – True to private repository (premium account). Otherwise, False.
  • description – repository description
  • labels – repository labels (tags)
  • gpg_sign_metadata – if set to true then the repo’s metadata will be automatically signed with Bintray GPG key.
  • gpg_sign_files – if set to true then the repo’s files will be automatically signed with Bintray GPG key.
  • gpg_use_owner_key – if set to true then the repo’s metadata and files will be signed automatically with the owner’s GPG key. this flag cannot be set true simultaneously with either of the bintray key falgs (files or metadata). this flag can be set true only if the repo’s owner supplied a private (and public) GPG key on his bintray profile.
  • business_unit – can be associated to repositories allowing you to monitor overall usage per business unit.
  • version_update_max_days – Number of days after the version is published in which an organization member can upload, override or delete files in the version, delete the version or its package. After this period these actions are not available to the member. This does not apply to the Admin of the repository who can make changes to the version at any time after it is published
Returns:

Request response

create_usage_threshold_business_unit(org, business_unit, monthly_storage=None, monthly_download=None, daily_download=None, alert_to_emails=None, alert_to_admins=True)[source]

Create usage threshold for business unit

Security: Authenticated user with organization ‘admin’ permission.
Parameters:
  • org – organization name
  • business_unit – business unit name
  • monthly_storage – monthly storage in bytes
  • monthly_download – monthly download in bytes
  • daily_download – daily download in bytes
  • alert_to_emails – list of emails to receive alerts
  • alert_to_admins – send alerts to admins.
Returns:

request response

create_usage_threshold_org(org, monthly_storage=None, monthly_download=None, daily_download=None, alert_to_emails=None, alert_to_admins=True)[source]

Create organization usage threshold

Security: Authenticated user with organization ‘admin’ permission.
Parameters:
  • org – organization name
  • monthly_storage – monthly storage in bytes
  • monthly_download – monthly download in bytes
  • daily_download – daily download in bytes
  • alert_to_emails – list of emails to receive alerts
  • alert_to_admins – send alerts to admins.
Returns:

request response

create_usage_threshold_repository(org, repo, monthly_storage=None, monthly_download=None, daily_download=None, alert_to_emails=None, alert_to_admins=True)[source]

Create repository usage threshold

Security: Authenticated user with organization ‘admin’ permission.
Parameters:
  • org – organization name
  • repo – repository name
  • monthly_storage – monthly storage in bytes
  • monthly_download – monthly download in bytes
  • daily_download – daily download in bytes
  • alert_to_emails – list of emails to receive alerts
  • alert_to_admins – send alerts to admins.
Returns:

request response

create_user_proprietary_license(user, name, description, url)[source]

Create a license associated with an user.

Parameters:
  • user – User name
  • name – license name
  • description – license description
  • url – license url
Returns:

request response

create_user_team(user, name, members, allow_repo_creation=True, business_unit=None)[source]

Create a new team for an user

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • org – organization name
  • name – team name
  • members – list of members to be associated to the team
  • allow_repo_creation – team members are allowed to create and update repositories.
  • business_unit – a default business unit can be associated to a team and will be the default business unit for all repositories that are created by this team. A business unit can only be associated with a team if its members are allowed to create repositories.
Returns:

request response

create_version(subject, repo, package, version, description=None, released=None, github_release_notes_file=None, github_use_tag_release_notes=None, vcs_tag=None)[source]

Creates a new version in the specified package (user has to be owner of the package)

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – version name
  • description – version description
  • released – release date ISO8601
  • github_release_notes_file – file path for release notes e.g. RELEASE.txt
  • github_use_tag_release_notes – True when contain release notes file
  • vcs_tag – tag name in VCS
Returns:

request response

create_version_release_notes_bintray(subject, repo, package, version, syntax, content)[source]
Create release notes for a package by subject.

Release notes “content” has to be passed to the command

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version
  • syntax – content syntax
  • content – release notes content
Returns:

request response

create_version_release_notes_github(subject, repo, package, version, github_repo, github_release_notes_file)[source]
Create release notes for a specific version by subject. Release notes “content”

will be copied from the provided GitHub release notes if using “github”.

Security: Authenticated user with ‘publish’ permission, or version read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version
  • github_repo – GitHub repository name
  • github_release_notes_file – GitHub release notes file path
Returns:

request response

debian_upload(subject, repo, package, version, remote_file_path, local_file_path, deb_distribution, deb_component, deb_architecture, publish=True, override=False, passphrase=None)[source]

Upload Debian artifacts to the specified repository path, with package information.

When artifacts are uploaded to a Debian repository using the Automatic index layout, the Debian distribution information is required and must be specified.
Parameters:
  • subject – username or organization
  • repo – repository name
  • package – package name
  • version – package version
  • remote_file_path – file name to be used on Bintray
  • local_file_path – file path to be uploaded
  • deb_distribution – Debian package distribution e.g. wheezy
  • deb_component – Debian package component e.g. main
  • deb_architecture – Debian package architecture e.g. i386,amd64
  • publish – publish after uploading
  • override – override remote file
  • passphrase – GPG passphrase
Returns:

Request response

delete_access_key_org(org, access_key_id)[source]

Delete an access key associated with an organization.

Security: Authenticated user with ‘admin’ permission.
Parameters:
  • org – organization name
  • access_key_id – access key id
Returns:

request response

delete_access_key_user(user, access_key_id)[source]

Delete an access key associated with an user.

Security: Authenticated user with ‘admin’ permission.
Parameters:
  • user – user name
  • access_key_id – access key id
Returns:

request response

delete_attributes(subject, repo, package, version=None, attributes=None)[source]

Delete attributes associated with the specified repo, package or version.

If no attribute names are specified, delete all attributes.

Security: Authenticated user with ‘publish’ permission for private repositories, or
version/package read/write entitlement for the corresponding calls.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version (optional)
  • attributes – attributes to be deleted [{“name”:”att1”, “values”:[“val1”], “type”: “string”}]
Returns:

request response

delete_content(subject, repo, file_path)[source]

Delete content from the specified repository path,

Currently supports only deletion of files. For OSS, this action is limited for 180 days from the content’s publish date.

Security: Authenticated user with ‘publish’ permission, or read/write entitlement for a repository path

Parameters:
  • subject – username or organization
  • repo – repository name
  • file_path – file to be deleted
Returns:

request response

delete_entitlement(subject, entitlement_id, repo=None, package=None, version=None, product=None)[source]
Delete an entitlement by its id and scope. Scope can be a product, a repository,

a package or a version.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • entitlement_id – entitlement to be deleted
  • repo – repository name
  • package – package name
  • version – package version
  • product – product name (only for Enterprise Account)
Returns:

entitlements list

delete_eula(subject, product, eula)[source]

Delete the specified EULA under the specified subject and product.

This resource is only available to Bintray Enterprise users.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • product – product name
  • eula – eula name to be removed
Returns:

request response

delete_file_attributes(subject, repo, file_path, attributes)[source]

Remove attributes associated with the specified Artifact.

By default, delete all attributes related to the specified Artifact. The ‘names’ parameter is optional, and is used to remove specific attributes only.

Security: Authenticated user with ‘publish’ permission, or write entitlement for
repository path.
Parameters:
  • subject – repository owner
  • repo – repository name
  • file_path – file to be checked
  • attributes – attributes to be deleted
Returns:

request response

delete_geo_restrictions(subject, repo)[source]

Remove all the countries from the ‘white_list’ and ‘black_list’.

This feature is limited to users with Enterprise account.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • repo – repository name
Returns:

request response

delete_ip_restrictions(subject, repo)[source]

Removes all restrictions, black and white.

Parameters:
  • subject – repository owner
  • repo – repository name
Returns:

request response

delete_org_proprietary_license(org, custom_license_name)[source]
Delete a license associated with an organization.
For organization, caller must be an admin of the organization.
Parameters:
  • org – Organization name
  • custom_license_name – License name to be deleted
Returns:

request answer

delete_org_team(org, team)[source]

Delete a team associated with an organization

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • org – organization name
  • team – team name
Returns:

request response

delete_package(subject, repo, package)[source]

Delete the specified package

Security: Authenticated user with ‘publish’ permission, or repository
ead/write entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
Returns:

request response

delete_package_release_notes(subject, repo, package)[source]

Deletes release notes for a specific package by subject.

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
Returns:

response request

delete_product(subject, product)[source]

Delete the specified product and all its sub-elements (such as EULAs).

Security: Authenticated user with ‘admin’ permission.
Parameters:
  • subject – repository owner
  • product – product name
Returns:

request response

delete_product_readme(subject, product)[source]

Deletes the readme for all of a product’s underlying packages.

Security: Authenticated user with ‘publish’ permission.
Parameters:
  • subject – repository owner
  • product – product name
Returns:

request response

delete_repository(subject, repo)[source]

Delete the specified repository under the specified subject

Parameters:
  • subject – subject name
  • repo – repo name
Returns:

request response

delete_team_permission(subject, repo, team)[source]

Delete the permission defined for a team on the specified repository

This resource is only available to Bintray Premium users.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • repo – repository name
  • team – team name
Returns:

request response

delete_usage_threshold_business_unit(org, business_unit)[source]

Delete usage threshold for business unit

Security: Authenticated user with organization ‘admin’ permission.
Parameters:
  • org – organization name
  • business_unit – business unit name
Returns:

request response

delete_usage_threshold_org(org)[source]

Delete organization usage threshold

Security: Authenticated user with organization ‘admin’ permission.
Parameters:org – organization name
Returns:request response
delete_usage_threshold_repository(org, repo)[source]

Delete repository usage threshold

Security: Authenticated user with organization ‘admin’ permission.
Parameters:
  • org – organization name
  • repo – repository name
Returns:

request response

delete_user_proprietary_license(user, custom_license_name)[source]

Delete a license associated with an user.

Parameters:
  • user – User name
  • custom_license_name – License to be deleted
Returns:

request answer

delete_user_team(user, team)[source]

Delete a team associated with an user

This resource is only available to Bintray Premium users.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • user – user name
  • team – team name
Returns:

request response

delete_version(subject, repo, package, version)[source]

Delete the specified version

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.

param subject: repository owner :param repo: repository name :param package: package name :param version: version to be deleted :return: request response

delete_webhook(subject, repo, package)[source]

Delete a user’s webhook associated with the specified package.

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
Returns:

request response

discard_uploaded_content(subject, repo, package, version, passphrase=None)[source]

Asynchronously discard all unpublished content for a user’s package version.

Parameters:
  • subject – username or organization
  • repo – repository name
  • package – package name
  • version – package version
  • passphrase – GPG passphrase
Returns:

the number of discarded files.

download_content(subject, repo, remote_file_path, local_file_path)[source]

Download content from the specified repository path.

Parameters:
  • subject – username or organization
  • repo – repository name
  • remote_file_path – file name to be downloaded from Bintray
  • local_file_path – file name to be stored in local storage
download_package_download_log_file(subject, repo, package, remote_log_name, local_log_name)[source]

Download the package download log file specified by log_name

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • remote_log_name – log to be downloaded
  • local_log_name – log to be saved in local storage
Returns:

response request

dynamic_download(subject, repo, remote_file_path, local_file_path, bt_package=None)[source]

Download a file based on a dynamic file_path .

This resource is only available for Bintray Premium repositories.

Currently, only the $latest token is supported, which is useful for downloading the latest file published under a specified package.

Package name can be supplied as a:
The bt_package query parameter The bt_package matrix parameter The X-Bintray-Package request header

A successful call will return a 302 redirect to a generated signed URL (with 15 second expiry) to the resolved file path.

Parameters:
  • subject – username or organization
  • repo – repository name
  • remote_file_path – file name to be downloaded from Bintray
  • local_file_path – file name to be stored in local storage
  • bt_package – query parameter
file_in_download_list(subject, repo, file_path, add_or_remove)[source]

Add or remove a file from/to the ‘Download List’.

Security: Authenticated user with ‘publish’ permission,
or version read/write entitlement.
Parameters:
  • subject – File subject to filter
  • repo – File repo filter
  • file_path – File path to be added or removed
  • add_or_remove – True to add in Download list. False to remove.
Returns:

Request response.

get_access_key_org(org, access_key_id)[source]

Get an access key associated with an organization, by its id.

Security: Authenticated user with ‘admin’ permission.
Parameters:
  • org – organization name
  • access_key_id – access key id
Returns:

list of keys

get_access_key_user(user, access_key_id)[source]

Get an access key associated with an user, by its id.

Security: Authenticated user with ‘admin’ permission.
Parameters:
  • user – user name
  • access_key_id – access key id
Returns:

list of keys

get_access_keys_org(org)[source]

Get a list of access keys associated with an organization

Security: Authenticated user with ‘admin’ permission.
Parameters:org – organization name
Returns:list of keys
get_access_keys_user(user)[source]

Get a list of access keys associated with an user

Security: Authenticated user with ‘admin’ permission.
Parameters:user – user name
Returns:list of keys
get_all_products_signed_eulas(subject, from_date=None, to_date=None, username=None, eula_name=None)[source]
Get a list of users who signed eula with sign date, version signed and eula name for
each product owned by the given subject.
Parameters:
  • subject – repository owner
  • from_date – date to filter by, ISO8601 format (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
  • to_date – date to filter by, ISO8601 format (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
  • username – filter by username
  • eula_name – filter by Eula name
Returns:

a list of EULAs

get_all_team_permissions(subject, repo)[source]

Get the permissions defined for teams on the specified repository

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • repo – repository name
Returns:

request response

get_attributes(subject, repo, package, version=None, attributes=None)[source]

Get attributes associated with the specified package or version.

If no attribute names are specified, return all attributes.

Note: Dates are defined in ISO8601 format.

Security: Authenticated user with ‘read’ permission for private repositories,
or version/package read entitlement for the corresponding calls.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version (optional)
  • attributes – attributes to be listed
Returns:

a list of attributes

get_daily_downloads(subject, repo, package, version=None, from_date=None, to_date=None)[source]

Get number of downloads per day, for the passed time range, per package or per version.

Security: Authenticated user with ‘publish’ permission for private repositories,
or package read/write entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version (Optional)
  • from_date – initial date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
  • to_date – end date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
Returns:

download details

get_downloads_by_country(subject, repo, package, version=None, from_date=None, to_date=None)[source]

Get total number of downloads, for the passed time range, per package or per version.

Security: Authenticated user with ‘publish’ permission for private repositories,
or package read/write entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version (Optional)
  • from_date – initial date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
  • to_date – end date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
Returns:

download details

get_entitlement(subject, entitlement_id, repo=None, package=None, version=None, product=None)[source]
Get an entitlement by its id and scope. Scope can be a product, a repository, a package

or a version.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • entitlement_id – entitlement to be acquired
  • repo – repository name
  • package – package name
  • version – package version
  • product – product name (only for Enterprise Account)
Returns:

entitlements list

get_entitlements(subject, repo=None, package=None, version=None, product=None)[source]

Get the entitlements defined on the specified product, repository, package or version.

Security: Authenticated user with ‘admin’ permission.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version
  • product – product name (only for Enterprise Account)
Returns:

entitlements list

get_eula(subject, product, eula)[source]

Returns the specified product EULA.

This resource is only available to Bintray Enterprise users.

Security: Authenticated user with ‘read’ permission for private repositories, or
repository read entitlement.
Parameters:
  • subject – repository owner
  • product – product name
  • eula – EULA name
Returns:

Dictionary with EULA details

get_eulas(subject, product)[source]

Get a list of EULAs for the specified product.

This resource is only available to Bintray Enterprise users.

Security: Authenticated user with ‘read’ permission for private repositories, or
repository read entitlement.
Parameters:
  • subject – repository owner
  • product – product name
Returns:

List of EULAs

get_file_attributes(subject, repo, file_path)[source]

Returns all the attributes related to Artifact.

This resource can be consumed by both authenticated and anonymous users.

Security: Authenticated user with ‘read’ permission, or repository read entitlement for
repository path.
Parameters:
  • subject – repository owner
  • repo – repository name
  • file_path – file to be checked
Returns:

a list of attributes

get_followers(user, start_pos=None)[source]

Get followers of the specified repository owner

Security: Authenticated user is required
Parameters:
  • user – user name to be searched
  • start_pos – initial index position
Returns:

follower list

get_geo_restrictions(subject, repo)[source]

Get the list of countries which are defined in the ‘black_list’ or in the ‘white_list’.

This feature is limited to users with Enterprise account.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • repo – repository name
Returns:

request response

get_ip_restrictions(subject, repo)[source]

Gets whitelisted and blacklisted CIDRs.

Parameters:
  • subject – repository owner
  • repo – repository name
Returns:

request response

get_list_package_download_log_files(subject, repo, package)[source]

Retrieve a list of available download log files for a package

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
Returns:

response request

get_org_gpg_public_key(org)[source]

Get the organization GPG public key.

The response Content-Type format is ‘application/pgp-keys’.
Parameters:org – Organization name
Returns:response Content-Type format as ‘application/pgp-keys’.
get_org_proprietary_licenses(org)[source]

Get a list of custom, proprietary licenses associated with an organization

Parameters:org – Organization name
Returns:Licenses list
get_org_team(org, team)[source]

Get details of a team associated with an organization

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • org – organization name
  • team – team name
Returns:

team details

get_org_teams(org)[source]

Get a list of teams associated with an organization

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Security: Authenticated user with ‘admin’ permission.

Parameters:org – organization name
Returns:team list
get_organization(organization)[source]

Get information about a specified organization.

“type” inside the “members” list is available only to organization admins “teams” list is available only to Premium organization admins

Security: Authenticated user is required

Parameters:organization – organization name to be searched
Returns:organization information
get_oss_licenses()[source]

Returns a list of all the OSS licenses.

Returns:List with OSS licenses
get_package(subject, repo, package, attribute_values=True)[source]

Get general information about a specified package with package name.

Security: Non-authenticated user.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • attribute_values – show attribute values
Returns:

package details

get_package_files(subject, repo, package, include_unpublished=False)[source]

Get all files in a given package.

When called by a user with publishing rights on the package, includes unpublished files in the list. By default only published files are shown.
Parameters:
  • subject – username or organization
  • repo – repository name
  • package – package name
  • include_unpublished – Show not published files
Returns:

List with all files

get_package_for_file(subject, repo, file_path)[source]

Get general information about the package a repository file is associated with.

Security: Non-authenticated user.
Parameters:
  • subject – repository owner
  • repo – repository name
  • file_path – file path to be searched
Returns:

package details

get_package_release_notes(subject, repo, package)[source]
Get the release notes for a specific package by subject; Either Bintray
release notes or GitHub release notes.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
Returns:

returns the release notes for a specific package by subject

get_packages(subject, repo, start_pos=None, start_name=None)[source]

Get a list of packages in the specified repository.

Security: Authenticated user with ‘read’ permission, or repository read entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • start_pos – starting position filter
  • start_name – name prefix filter
Returns:

list of packages

get_product(subject, product)[source]

Get details for the specified product.

Security: Authenticated user with ‘read’ permission for private repositories, or
repository read entitlement.
Parameters:
  • subject – repository owner
  • product – product name
Returns:

details of a product

get_product_signed_eulas(subject, product, from_date=None, to_date=None, username=None, eula_name=None)[source]

Get a list of users who signed eula per product with sign date, version signed and eula.

Parameters:
  • subject – repository owner
  • product – product name
  • from_date – date to filter by, ISO8601 format (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
  • to_date – date to filter by, ISO8601 format (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
  • username – filter by username
  • eula_name – filter by Eula name
Returns:

A list of EULAs

get_products(subject)[source]

Get a list of products for the specified subject.

Security: Authenticated user with ‘read’ permission for private repositories, or
repository read entitlement.
Parameters:subject – repository owner
Returns:a list of products associated to the subject
get_readme(subject, repo, package)[source]
Returns the readme for the specified package by subject.

Either Bintray readme or GitHub readme.

Security: Authenticated user with ‘read’ permission for private repositories,
or package read entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
Returns:

request response

get_repositories(subject)[source]

Get a list of repos writable by subject (personal or organizational)

Security: Authenticated user with ‘read’ permission for private repositories,
or repository read entitlement.
Parameters:subject – subject name
Returns:A list of repositories
get_repository(subject, repo)[source]

Get general information about a repository of the specified user

Security: Authenticated user with ‘read’ permission for private repositories,
or repository read entitlement.
Parameters:
  • subject – Subject name
  • repo – Repository name
Returns:

Repository information

get_stream_api(subject)[source]

Get a stream of events generated by activity for the specified subject.

Security: Authenticated subject admin.
Parameters:subject – repository owner
Returns:response request
get_team_permissions(subject, repo, team)[source]

Get the permissions defined for a team on the specified repository

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • repo – repository name
  • team – team name
Returns:

request response

get_total_downloads(subject, repo, package, version=None, from_date=None, to_date=None)[source]

Get total number of downloads, for the passed time range, per package or per version.

Security: Authenticated user with ‘publish’ permission for private repositories,
or package read/write entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version (Optional)
  • from_date – initial date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
  • to_date – end date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
Returns:

download details

get_usage_report_for_package(subject, repo, package=None, start_pos=50, from_date=None, to_date=None)[source]
Get current storage usage report. Report can be requested for the specified repository,

optionally for a specific package.

Security: Authenticated user with ‘admin’ permission for repo, or ‘publish’ permission
for specific package.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • start_pos – index position
  • from_date – initial date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
  • to_date – end date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
Returns:

download details

get_usage_report_for_repository(subject, repo, from_date=None, to_date=None)[source]
Get monthly download and storage usage report, according to the specified date range

for a specific subject repository.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • repo – repository name
  • from_date – initial date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
  • to_date – end date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
Returns:

download details

get_usage_report_for_subject(subject, from_date=None, to_date=None)[source]
Get monthly download and storage usage report, according to the specified date range

for a subject.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • from_date – initial date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
  • to_date – end date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
Returns:

download details

get_usage_report_grouped_by_business_unit(subject, business_unit=None, from_date=None, to_date=None)[source]
Get monthly download and storage usage report, according to the specified date range

and grouped by business unit. Report can be requested for a subject or for a specific subject business unit.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • business_unit – business unit name
  • from_date – initial date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
  • to_date – end date range ISO8601 (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
Returns:

download details

get_usage_threshold_business_unit(org, business_unit)[source]

Get business unit usage threshold

Security: Authenticated user with organization ‘admin’ permission.
Parameters:
  • org – organization name
  • business_unit – business unit name
Returns:

request response

get_usage_threshold_org(org)[source]

Get organization usage threshold

Security: Authenticated user with organization ‘admin’ permission.
Parameters:org – organization name
Returns:request response
get_usage_threshold_repository(org, repo)[source]

Get repository organization usage threshold

Security: Authenticated user with organization ‘admin’ permission.
Parameters:
  • org – organization name
  • repo – repo name
Returns:

request response

get_user(user)[source]

Get information about a specified user

Security: Get information about a specified user
Parameters:user – user name
Returns:user information
get_user_gpg_public_key(user)[source]

Get the subject GPG public key.

The response Content-Type format is ‘application/pgp-keys’.
Parameters:org – Organization name
Returns:response Content-Type format as ‘application/pgp-keys’.
get_user_proprietary_licenses(user)[source]

Get a list of custom, proprietary licenses associated with an user

Parameters:user – User name
Returns:Licenses list
get_user_team(user, team)[source]

Get details of a team associated with an user

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • user – user name
  • team – team name
Returns:

team details

get_user_teams(user)[source]

Get a list of teams associated with an user

This resource is only available to Bintray Premium users.

Security: Authenticated user with ‘admin’ permission.

Parameters:user – user name
Returns:team list
get_version(subject, repo, package, version='_latest', attribute_values=True)[source]
Get general information about a specified version, or query for the latest version that
has at least one file published to it.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version
  • attribute_values – show attributes
Returns:

request response + package version information

get_version_files(subject, repo, package, version, include_unpublished=False)[source]

Get all files in a given version.

Returns an array of results, where elements are similar to the result of getting package files.

When called by a user with publishing rights on the package, includes unpublished files in the list.

By default only published files are shown.

Security: Authenticated user with ‘read’ permission for private repositories, or version read entitlement.

Parameters:
  • subject – username or organization
  • repo – repository name
  • package – package name
  • version – package version
  • include_unpublished – Show not published files
Returns:

List with all files

get_version_release_notes(subject, repo, package, version)[source]

Get release notes for a specific version by subject

Security: Authenticated user with ‘read’ permission for private repositories, or version
read entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version
Returns:

release notes

get_webhooks(subject, repo=None)[source]
Get all the webhooks registered for the specified subject, optionally for a specific

repository.

failure_count is the number of times a callback has failed. A callback will be auto-deactivated after 7 subsequent failures. A successful callback resets the count.

Parameters:
  • subject – repository owner
  • repo – repository name
Returns:

list with web hooks

gpg_sign_file(subject, repo, file_path, key_subject=None, passphrase=None, key_path=None)[source]

GPG sign the specified repository file.

GPG signing information may be needed
Parameters:
  • subject – username or organization
  • repo – repository name
  • file_path – file path to be signed
  • key_subject – Alternative Bintray subject for the GPG public key
  • passphrase – Optional private key passphrase, if required
  • key_path – Optional private key, if not stored in Bintray
Returns:

request response

gpg_sign_version(subject, repo, package, version, key_subject=None, passphrase=None, key_path=None)[source]

GPG sign all files associated with the specified version.

GPG signing information may be needed

Security: Authenticated user with ‘publish’ permission.

Parameters:
  • subject – username or organization
  • repo – repository name
  • package – package name
  • version – package version
  • key_subject – Alternative Bintray subject for the GPG public key
  • passphrase – Optional private key passphrase, if required
  • key_path – Optional private key, if not stored in Bintray
Returns:

request response

Link the package source_package into the repo repository.

Caller must be an admin of the organization owning the repository.
Parameters:
  • subject – target subject name
  • repo – target subject repository
  • source_subject – source subject
  • source_repo – source repository
  • source_package – source package name
  • path_prefix – path to include the files from
Returns:

request response

maven_upload(subject, repo, package, remote_file_path, local_file_path, publish=True, passphrase=None)[source]

Upload Maven artifacts to the specified repository path, with package information.

Version information is resolved from the path, which is expected to follow the Maven layout.

You may supply a passphrase for signing uploaded files using the X-GPG-PASSPHRASE header

Parameters:
  • subject – username or organization
  • repo – repository name
  • package – package name
  • remote_file_path – file name to be used on Bintray
  • local_file_path – file path to be uploaded
  • publish – publish after uploading
  • passphrase – GPG passphrase
Returns:

Request response

publish_uploaded_content(subject, repo, package, version, passphrase=None)[source]

Asynchronously publishes all unpublished content for a user’s package version.

Parameters:
  • subject – username or organization
  • repo – repository name
  • package – package name
  • version – package version
  • passphrase – GPG passphrase
Returns:

the number of to-be-published files.

regenerate_subject_url_signing_key(subject)[source]

Re-generates Subject key for URL Signing.

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Note: regenerating the URL signing key will revoke all active signed URLs.

Parameters:subject – repository owner
Returns:request response
register_webhook(subject, repo, package, url, method)[source]

Register a webhook for receiving notifications on a new package release.

By default a user can register up to 10 webhook callbacks. The callback URL may contain the %r and %p tokens for repo and package name, respectively. method is the callback request method: can be in post, put or get. If not specified, post is used.

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • url – URL for callback
  • method – HTTP method for callback e.g. “post”
Returns:

request response

schedule_metadata_calculation(subject, repo, path=None)[source]

Schedule metadata (index) calculation for the specified repository.

For a Maven repository you need to specify the path in the repository for which the metadata should be calculated. For an RPM repository, you need to specify the path according to the repository ‘YUM Metadata Folder Depth’ field, if different from zero. For other repository types the path is ignored.

Security: Authenticated user with ‘publish’ permission, or repository read/write entitlement.

Parameters:
  • subject – repository owner
  • repo – repository name
  • path – path in the repository
Returns:

request response

search_attributes(subject, repo, package=None, attributes=None, attribute_values=True)[source]

Search for packages/versions inside a given repository matching a set of attributes.

The AND operator will be used when using multiple query clauses, for example attribute A equals X and attribute B is greater than Z When an array value is used, if the existing attribute value is a scalar match against one of the array values; if the existing attribute value is an array check that the existing array contains the query array.

Note: The values range is defined by the brackets direction and the comma position.

Security: Authenticated user with ‘publish’ permission for private repositories, or
version/package read/write entitlement for the corresponding calls.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version (optional)
  • attributes – attributes to be searched
  • attribute_values – True to search attribute values
Returns:

Returns an array of results

search_entitlement_by_access_key(access_key=None, scope=None, product=None, deep=False)[source]

Search for entitlements for a specific access key in the specified scope.

The minimal scope is a subject. You can optionally add a sub-scope of product, repo, package and version.

If deep equals true (default is false), will return all entitlements under the given scope, for example, if scope is repository, existing package and version entitlements under the given repository will be returned.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • access_key – specific access key to be searched
  • scope – specified scope to be used in the search
  • product – products name associated to the access key
  • deep – return all entitlements under the given scope
Returns:

entitlement found

search_entitlement_by_tag(tag=None, scope=None, product=None, deep=False)[source]

Search for entitlements for a specific tag in the specified scope.

The minimal scope is a subject. You can optionally add a sub-scope of product, repo, package and version.

If deep equals true (default is false), will return all entitlements under the given scope, for example, if scope is repository, existing package and version entitlements under the given repository will be returned.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • tag – specific tag to be searched
  • scope – specified scope to be used in the search
  • product – products name associated to the access key
  • deep – return all entitlements under the given scope
Returns:

entitlement found

search_file_attributes(subject, repo, attributes)[source]
Returns all artifacts in the specified repository that at least one of their attributes

correspond to names and values specified in the JSON payload.

Note: The values range is defined by the brackets direction and the comma position.

Security: Authenticated user with ‘read’ permission, or repository read
entitlement for repository path.
Parameters:
  • subject – repository owner
  • repo – repository name
  • attributes – attributes to be searched
Returns:

request response

search_file_by_checksum(sha1, subject=None, repo=None, start_pos=None, created_after=None)[source]

Search for a file by its sha1 checksum.

May take an optional subject and/or repo name to search in.

Returns an array of results, where elements are similar to the result of getting package files. Search results will not contain private files.

Security: Authentication is not required

Parameters:
  • sha1 – File SHA-1
  • subject – File subject to filter
  • repo – File repo filter
  • start_pos – Start position name to filter
  • created_after – Creation date to filter
Returns:

Package found. Otherwise, error.

search_file_by_name(name, subject=None, repo=None, start_pos=None, created_after=None)[source]

Search for a file by its name. name can take the * and ? wildcard characters.

May take an optional subject and/or repo name to search in and/or created_after search from the ‘dateCreatedAfter’ until today. The ‘dateCreatedAfter’ is defined in the following ISO8601 format (yyyy-MM- dd’T’HH:mm:ss.SSSZ). Returns an array of results, where elements are similar to the result of getting package files. Search results will not contain private files.

Security: Authentication is not required

Parameters:
  • name – File to be searched
  • subject – File subject to filter
  • repo – File repo filter
  • start_pos – Start position name to filter
  • created_after – Creation date to filter
Returns:

Package found. Otherwise, error.

search_maven_package(group_id=None, artifact_id=None, query=None, subject=None, repo=None)[source]

Search for a Maven package using Maven groupId and artifactId

Security: Non-authenticated user.
Parameters:
  • group_id – maven group id
  • artifact_id – maven artifact id
  • query – wildcard query
  • subject – repository owner
  • repo – repository name
Returns:

package details

search_package(package=None, desc=None, subject=None, repo=None)[source]

Search for a package.

Security: Non-authenticated user.
Parameters:
  • subject – repository owner to filter
  • repo – repository name to filter
  • package – package name to filter
  • desc – desc name to filter
Returns:

an array of results

search_repository(name=None, description=None)[source]

Search for a repository.

At least one of the name and desc search fields need to be specified.

Returns an array of results, where elements are similar to the result of getting a single repository.

Search results will not contain private repositories.

Security: Authenticated user is required

Parameters:
  • name – repository name
  • description – repository name
Returns:

request response

search_user(name)[source]

Search for a user.

Security: Authenticated user is required
Parameters:name – name to be searched
Returns:Returns an array of results, where elements are similar to the result of getting a single user.
set_attributes(subject, repo, package, version=None, attributes=None)[source]
Associate attributes with the specified package or version, overriding all previous

attributes.

Optionally, specify an attribute type. Otherwise, type will be inferred from the attribute’s value. If a type cannot be inferred, string type will be used. Non-homogeneous arrays are not accepted. Attributes names beginning with an underscore (“_”) will only be visible for users with publish rights. Attribute types can be one of the following: string, date, number, boolean, version version currently behaves like string. This will change with future Bintray versions.

Security: Authenticated user with ‘publish’ permission for private repositories, or
version/package read/write entitlement for the corresponding calls.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version (optional)
  • attributes – attributes to be configured [{“name”:”att1”, “values”:[“val1”], “type”: “string”}]
Returns:

request response

set_file_attributes(subject, repo, file_path, attributes)[source]

Set attributes associated with the specified Artifact.

Overriding all previous attributes.

Security: Authenticated user with ‘publish’ permission, or write entitlement for
repository path.
Parameters:
  • subject – repository owner
  • repo – repository name
  • file_path – file to be checked
  • attributes – attributes to be configured
Returns:

request response

set_ip_restrictions(subject, repo, white_cidrs=None, black_cidrs=None)[source]

Update ip restrictions with the given white list and black list of CIDRs.

Parameters:
  • subject – repository owner
  • repo – repository name
  • white_cidrs – white list for CIDRs
  • black_cidrs – black list for CIDRs
Returns:

request response

set_team_permissions(subject, repo, team, permission)[source]

Set the permissions defined for a team on the specified repository.

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • repo – repository name
  • team – team name
  • permission – permission type e.g. “read”, “write”
Returns:

request response

sync_version_artifacts_to_maven_central(subject, repo, package, version, username, password, close='1')[source]
Sync version files to a oss.sonatype.org staging repository to publish these files to

Maven Central.

Once Sonatype oss credentials have been set in subject “Accounts” tab, user can send this rest call without specifying username and password (or use different username/password by specifying them in JSON body)

By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off and release the version manually. This is achieved by passing 0 in the ‘close’ field of the JSON passed to the call.

Security: Authenticated user with ‘publish’ permission.

Parameters:
  • subject – username or organization
  • repo – repository name
  • package – package name
  • version – package version
  • username – Sonatype OSS user token
  • password – Sonatype OSS user password
  • close – staging repository mode
Returns:

request response

test_webhook(subject, repo, package, version, url, method)[source]

Test a webhook callback for the specified package release.

A webhook post request is authenticated with an HMAC-SHA256 authentication header of the package name keyed by the registering subject’s API key, and base64-encoded.

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.
Parameters:
  • subject – repositoy owner
  • repo – repository name
  • package – package name
  • version – package version
  • url – URL for callback
  • method – HTTP method for callback
Returns:

request response

Unlink the package source_package from the repo repository.

Caller must be an admin of the organization owning the repository.
Parameters:
  • subject – target subject name
  • repo – target subject repository
  • source_subject – source subject
  • source_repo – source repository
  • source_package – source package name
Returns:

request response

update_access_key_org(org, access_key_id, url=None, cache_for_secs=None, expiry=None, white_cidrs=None, black_cidrs=None)[source]

Update an existing access key identified by an access key id, for an organization.

Security: Authenticated user with ‘admin’ permission.
Parameters:
  • org – organization name
  • access_key_id – access key to be updated
  • expiry – after that will be automatically revoked. (Unix epoch time in milliseconds)
  • url – URL for existence_check (callback)
  • cache_for_secs – specified period for caching result. minimum is 60 seconds.
  • white_cidrs – will allow access only for those IPs that exist in that address range
  • black_cidrs – will block access for all IPs that exist in the specified range.
Returns:

request response

update_access_key_user(user, access_key_id, url=None, cache_for_secs=None, expiry=None, white_cidrs=None, black_cidrs=None)[source]

Update an existing access key identified by an access key id, for an user.

Security: Authenticated user with ‘admin’ permission.
Parameters:
  • user – user name
  • access_key_id – access key to be updated
  • expiry – after that will be automatically revoked. (Unix epoch time in milliseconds)
  • url – URL for existence_check (callback)
  • cache_for_secs – specified period for caching result. minimum is 60 seconds.
  • white_cidrs – will allow access only for those IPs that exist in that address range
  • black_cidrs – will block access for all IPs that exist in the specified range.
Returns:

request response

update_attributes(subject, repo, package, version=None, attributes=None)[source]

Update attributes associated with the specified package or version.

Attributes may have a null value. Optionally, specify an attribute type. Otherwise, type will be inferred from the attribute’s value. If a type cannot be inferred, string type will be used. Non-homogeneous arrays are not accepted. Attribute types can be one of the following: string, date, number, boolean, version version currently behaves like string. This will change with future Bintray versions.

Security: Authenticated user with ‘publish’ permission for private repositories, or
version/package read/write entitlement for the corresponding calls.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – package version (optional)
  • attributes – attributes to be configured [{“name”:”att1”, “values”:[“val1”], “type”: “string”}]
Returns:

request response

update_entitlement(subject, entitlement_id, repo=None, package=None, version=None, access=None, access_keys=None, tags=None, product=None)[source]
Update the information of the specified entitlement of a specified scope. Scope can be a

product, a repository with an optional path, a package or a version.

When specifying an optional path value for repository scope, path needs to be relative and refer to a directory or a file in the repository.

Access mode can be either rw (read-write: implies download, upload and delete) or r (read: implies download).

When specifying a scope with product, access mode can only be r (read: implies download). Tags can be added for search purposes.

An entitlement id will be auto-generated if not specified.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • entitlement_id – entitlement id to be updated
  • repo – repository name
  • package – package name
  • version – package version
  • product – product name (only for Enterprise Account)
  • access – entitlement access more (r/w)
  • access_keys – list of access keys
  • tags – associated tags
Returns:

entitlements list

update_eula(subject, product, eula, syntax, content, versions, default=False)[source]

Update a EULA under a specified subject and product.

A new EULA will apply to all new versions if the ‘default’ parameter is specified.

This resource is only available to Bintray Enterprise users.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • product – product name
  • eula – EULA name
  • syntax – EULA syntax [markdown/asciidoc/plain_text default markdown]
  • content – EULA content
  • versions – product versions to use this new EULA
  • default – True if all product versions should use same EULA.
Returns:

request response

update_file_attributes(subject, repo, file_path, attributes)[source]

Update the Artifact with new attributes without removing the older Artifact’s attributes

Security: Authenticated user with ‘publish’ permission, or write entitlement for
repository path.
Parameters:
  • subject – repository owner
  • repo – repository name
  • file_path – file to be checked
  • attributes – attributes to be configured
Returns:

request response

update_geo_restrictions(subject, repo, white_list=[], black_list=[])[source]

Update the ‘black_list’ or ‘white_list’ with the related countries code.

This feature is limited to users with Enterprise account.

The update can be done on one list only.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • subject – repository owner
  • repo – repository name
  • white_list – Countries in white list e.g. [“US”, “CA”]
  • black_list – Countries in black list e.g. [“RU”, “BR”]
Returns:

request response

update_ip_restrictions(subject, repo, add_white_cidrs=None, rm_white_cidrs=None, add_black_cidrs=None, rm_black_cidrs=None)[source]

Add or remove CIDRs from black/white list restrictions.

Parameters:
  • subject – repository owner
  • repo – repository name
  • add_white_cidrs – CIDRs to be added in the white list
  • rm_white_cidrs – CIDRs to be removed from the white list
  • add_black_cidrs – CIDRs to be added in the black list
  • rm_black_cidrs – CIDRs to be removed from the black list
Returns:

request response

update_org_proprietary_license(org, custom_license_name, description=None, url=None)[source]
Update a license associated with an organization.
Caller must be an admin of the organization.
Parameters:
  • org – Organization name
  • custom_license_name – License to be updated
  • description – license description
  • url – license url
Returns:

request answer

update_org_team(org, team, members=None, allow_repo_creation=None, business_unit=None)[source]

Update a team associated with an organization

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • org – organization name
  • team – team name
  • members – list of members to be associated to the team
  • allow_repo_creation – team members are allowed to create and update repositories.
  • business_unit – a default business unit can be associated to a team and will be the default business unit for all repositories that are created by this team. A business unit can only be associated with a team if its members are allowed to create repositories.
Returns:

request response

update_package(subject, repo, package, licenses=None, vcs_url=None, custom_licenses=None, desc=None, labels=None, website_url=None, issue_tracker_url=None, github_repo=None, github_release_notes_file=None, public_download_numbers=None, public_stats=None)[source]

Update the information of the specified package.

Security: Authenticated user with ‘publish’ permission, or repository read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • desc – package description
  • labels – package lables (tags)
  • licenses – list of licenses (mandatory for OSS packages)
  • custom_licenses – custom licenses (available only for Premium accounts)
  • vcs_url – VCS url (mandatory for OSS packages)
  • website_url – website url
  • issue_tracker_url – issue tracker url
  • github_repo – Github repository
  • github_release_notes_file – release notes on Github
  • public_download_numbers – display download number
  • public_stats – stats are public (available only for Premium accounts)
Returns:

request response

update_product(subject, product, display_name=None, desc=None, website=None, vcs=None, packages=None)[source]

Update an existing product.

Security: Authenticated user with ‘admin’ permission.
Parameters:
  • subject – repository owner
  • product – product name
  • display_name – product name to be displayed
  • desc – product description
  • website – product website url
  • vcs – product VCS url
  • packages – list of packages associated to the product
Returns:

request response

update_repository(subject, repo, business_unit=None, description=None, labels=None, gpg_sign_metadata=None, gpg_sign_files=None, gpg_use_owner_key=None, version_update_max_days=None)[source]

Update a repository under the specified subject

Parameters:
  • subject – repository owner
  • repo – repository name
  • description – repository description
  • labels – repository labels (tags)
  • gpg_sign_metadata – if set to true then the repo’s metadata will be automatically signed with Bintray GPG key.
  • gpg_sign_files – if set to true then the repo’s files will be automatically signed with Bintray GPG key.
  • gpg_use_owner_key – if set to true then the repo’s metadata and files will be signed automatically with the owner’s GPG key. this flag cannot be set true simultaneously with either of the bintray key falgs (files or metadata). this flag can be set true only if the repo’s owner supplied a private (and public) GPG key on his bintray profile.
  • business_unit – can be associated to repositories allowing you to monitor overall usage per business unit.
  • version_update_max_days – Number of days after the version is published in which an organization member can upload, override or delete files in the version, delete the version or its package. After this period these actions are not available to the member. This does not apply to the Admin of the repository who can make changes to the version at any time after it is published
Returns:

Request response

update_usage_threshold_business_unit(org, business_unit, monthly_storage=None, monthly_download=None, daily_download=None, alert_to_emails=None, alert_to_admins=None)[source]

Update usage threshold for business unit

Security: Authenticated user with organization ‘admin’ permission.
Parameters:
  • org – organization name
  • business_unit – business unit name
  • monthly_storage – monthly storage in bytes
  • monthly_download – monthly download in bytes
  • daily_download – daily download in bytes
  • alert_to_emails – list of emails to receive alerts
  • alert_to_admins – send alerts to admins.
Returns:

request response

update_usage_threshold_org(org, monthly_storage=None, monthly_download=None, daily_download=None, alert_to_emails=None, alert_to_admins=None)[source]

Update organization usage threshold

Security: Authenticated user with organization ‘admin’ permission.
Parameters:
  • org – organization name
  • monthly_storage – monthly storage in bytes
  • monthly_download – monthly download in bytes
  • daily_download – daily download in bytes
  • alert_to_emails – list of emails to receive alerts
  • alert_to_admins – send alerts to admins.
Returns:

request response

update_usage_threshold_repository(org, repo, monthly_storage=None, monthly_download=None, daily_download=None, alert_to_emails=None, alert_to_admins=None)[source]

Update repository usage threshold

Security: Authenticated user with organization ‘admin’ permission.
Parameters:
  • org – organization name
  • repo – repository name
  • monthly_storage – monthly storage in bytes
  • monthly_download – monthly download in bytes
  • daily_download – daily download in bytes
  • alert_to_emails – list of emails to receive alerts
  • alert_to_admins – send alerts to admins.
Returns:

request response

update_user_proprietary_license(user, custom_license_name, description=None, url=None)[source]

Update a license associated with an user.

Parameters:
  • user – User name
  • custom_license_name – License to be updated
  • description – license description
  • url – license url
Returns:

request answer

update_user_team(user, team, members=None, allow_repo_creation=None, business_unit=None)[source]

Update a team associated with an user

This resource is only available to Bintray Premium users. For organization, caller must be an admin of the organization.

Security: Authenticated user with ‘admin’ permission.

Parameters:
  • user – user name
  • team – team name
  • members – list of members to be associated to the team
  • allow_repo_creation – team members are allowed to create and update repositories.
  • business_unit – a default business unit can be associated to a team and will be the default business unit for all repositories that are created by this team. A business unit can only be associated with a team if its members are allowed to create repositories.
Returns:

request response

update_version(subject, repo, package, version, description=None, github_release_notes_file=None, github_use_tag_release_notes=None, vcs_tag=None)[source]

Update the information of the specified version

Security: Authenticated user with ‘publish’ permission, or package read/write
entitlement.
Parameters:
  • subject – repository owner
  • repo – repository name
  • package – package name
  • version – version name to be updated
  • description – version description
  • github_release_notes_file – file path for release notes e.g. RELEASE.txt
  • github_use_tag_release_notes – True when contain release notes file
  • vcs_tag – tag name in VCS
Returns:

request response

upload_content(subject, repo, package, version, remote_file_path, local_file_path, publish=True, override=False, explode=False)[source]

Upload content to the specified repository path, with package and version information.

Parameters:
  • subject – username or organization
  • repo – repository name
  • package – package name
  • version – package version
  • remote_file_path – file name to be used on Bintray
  • local_file_path – file path to be uploaded
  • publish – publish after uploading
  • override – override remote file
  • explode – explode remote file
Returns:

Request response

url_signing(subject, repo, file_path, json_data, encrypt=False)[source]

Generates an anonymous, signed download URL with an expiry date.

Caller must be an owner of the repository or a publisher in the organization owning the repository.

Encrypted download is possible - encryption will be done using AES 256 CBC, see below documentation.

This resource is only available to Bintray Premium users.

Parameters:
  • subject – username or organization
  • repo – repository name
  • file_path – signed path
  • json_data – URL data
  • encrypt – encrypted download
version_for_file(subject, repo, file_path)[source]

Get general information about the version a repository file is associated with.

Security: Non-authenticated user.
Parameters:
  • subject – repository owner
  • repo – repository name
  • file_path – associated file path
Returns:

request response

bintray.logger module

class bintray.logger.Logger[source]

Bases: object

logger

bintray.requester module

class bintray.requester.Requester(username=None, api_key=None)[source]

Bases: object

delete(url, params=None)[source]

Forward DELETE method

Parameters:
  • url – URL address
  • params – URL parameters
Returns:

Request response

download(url, params=None, add_status_code=True)[source]

Just like GET method, but with content

Parameters:
  • url – URL Address
  • params – URL parameters
  • add_status_code – add JSON return code
Returns:

JSON response and content

get(url, params=None)[source]

Forward GET method

Parameters:
  • url – Web address
  • params – URL params
Returns:

JSON answer

patch(url, json=None, params=None)[source]

Forward PATCH method

Parameters:
  • url – URL address
  • params – URL parameters
  • json – Data to be patched
Returns:

Request response

post(url, json=None, params=None, headers=None)[source]

Forward POST method

Parameters:
  • url – URL address
  • params – URL parameters
  • json – Data to be posted
  • headers – Request headers
Returns:

Request response

put(url, params=None, data=None, json=None, headers=None)[source]

Forward PUT method

Parameters:
  • url – URL address
  • params – URL params
  • data – Data content
  • json – JSON content
  • headers – Request headers
Returns:

JSON

bintray.utils module

bintray.utils.bool_to_number(value)[source]

Convert boolean result into numeric string

Parameters:value – Any boolean value
Returns:“1” when True. Otherwise, “0”

Module contents