API

Just another Python API for Travis CI (API).

A module which provides the gateway to the Travis CI API. All interaction starts with this module’s class-es.

Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Project link:
https://github.com/funilrys/PyTravisCI
Project documentation:
https://pytravisci.readthedocs.io/en/latest/

License

MIT License

Copyright (c) 2019, 2020, 2021, 2022 Nissar Chababy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
class PyTravisCI.travis_ci.TravisCI(*, access_token: Optional[str] = None, access_point: Optional[str] = 'https://api.travis-ci.org')[source]

The gateway to the interaction with the Travis CI API.

Parameters:
  • access_token (str) – The access token to use to authenticate ourselves.
  • access_point (str) – The access point to communicate with.
get_access_point() → str[source]

Provides the currently set access point.

get_active_from_github_id(github_id: Union[str, int], *, params: Optional[dict] = None) → PyTravisCI.resource_types.active.Active[source]

Provides the list of all active builds.

Official Travis CI API documentation:
Parameters:
  • github_id – Documentation missing. The GitHub user or organization ID to get the active builds for.
  • params – The query parameters to append to the URL.
get_active_from_login(login: str, *, provider: str = 'github', params: Optional[dict] = None) → PyTravisCI.resource_types.active.Active[source]

Provides the list of all active builds for the given login in the given provider.

Official Travis CI API documentation:
Parameters:
  • login – Documentation missing. The Login of to user to fetch the data for.
  • provider – Documentation missing.
  • params – The query parameters to append to the URL.
get_broadcasts(*, params: Optional[dict] = None) → PyTravisCI.resource_types.broadcasts.Broadcasts[source]

Provides the list of broadcasts of the current user.

Official Travis CI API documentation:
Parameters:params – The query parameters to append to the URL.
get_build(build_id: Union[int, str], *, params: Optional[dict] = None) → PyTravisCI.resource_types.build.Build[source]

Provides the build information from its ID.

Official Travis CI API documentation:
Parameters:
  • build_id – Value uniquely identifying the build.
  • params – The query parameters to append to the URL.
get_builds(*, params: Optional[dict] = None) → PyTravisCI.resource_types.builds.Builds[source]

Provides the list of builds of the current user.

Official Travis CI API documentation:
Parameters:params – The query parameters to append to the URL.
get_cron(cron_id: Union[str, int], *, params: Optional[dict] = None) → PyTravisCI.resource_types.cron.Cron[source]

Provides a cron from its given ID.

Official Travis CI API documentation:
Parameters:
  • cron_id – Value uniquely identifying the cron.
  • params – The query parameters to append to the URL.
get_job(job_id: Union[str, int], *, params: Optional[dict] = None) → PyTravisCI.resource_types.job.Job[source]

Provides a job from its given ID.

Official Travis CI API documentation:
Parameters:
  • job_id – Value uniquely identifying the job.
  • params – The query parameters to append to the URL.
get_jobs(*, params: Optional[dict] = None) → PyTravisCI.resource_types.jobs.Jobs[source]

Provides the list of jobs of the current user.

Official Travis CI API documentation:
Parameters:params – The query parameters to append to the URL.
get_organization(organization_id: Union[str, int], *, params: Optional[dict] = None) → PyTravisCI.resource_types.organization.Organization[source]

Provides an organization from its given ID.

Official Travis CI API documentation:
Parameters:
  • organization_id – Value uniquely identifying the organization.
  • params – The query parameters to append to the URL.
get_organizations(*, params: Optional[dict] = None) → PyTravisCI.resource_types.organizations.Organizations[source]

Provides the list of organizations of the current user.

Official Travis CI API documentation:
Parameters:params – The query parameters to append to the URL.
get_repositories(*, params: Optional[dict] = None) → PyTravisCI.resource_types.repositories.Repositories[source]

Provides the list of repositories of the current user.

Official Travis CI API documentation:
Parameters:params – The query parameters to append to the URL.
get_repositories_from_github_id(github_id: Union[str, int], *, params: Optional[dict] = None) → PyTravisCI.resource_types.repositories.Repositories[source]

Provides the list of repositories of the given GitHub ID.

Official Travis CI API documentation:
Parameters:
  • github_id – Documentation missing. The GitHub user or organization ID to get the repositories for.
  • params – The query parameters to append to the URL.
get_repositories_from_login(login: str, *, provider: str = 'github', params: Optional[dict] = None) → PyTravisCI.resource_types.repositories.Repositories[source]

Provides the list of repositories for the given login in the given provider.

Official Travis CI API documentation:
Parameters:
  • login – Documentation missing. The Login of to user to fetch the data for.
  • provider – Documentation missing.
  • params – The query parameters to append to the URL.
get_repository(repository_id_or_slug: Union[str, int], *, params: Optional[dict] = None) → PyTravisCI.resource_types.repository.Repository[source]

Provides the repository from its given ID or slug.

Official Travis CI API documentation:
Parameters:
  • repository_id_or_slug – Value uniquely identifying the repository.
  • params – The query parameters to append to the URL.
get_repository_from_provider(provider: str, repository_id_or_slug: Union[str, int], *, params: Optional[dict] = None) → PyTravisCI.resource_types.repository.Repository[source]

Provides the repository from its given provider, ID or slug.

Official Travis CI API documentation:
Parameters:
  • provider (str) – Documentation missing.
  • repository_id_or_slug – Value uniquely identifying the repository.
  • params – The query parameters to append to the URL.
get_user(*, params: Optional[dict] = None) → PyTravisCI.resource_types.user.User[source]

Provides the information of the current user.

Official Travis CI API documentation:
Parameters:params – The query parameters to append to the URL.
get_user_from_id(user_id: Union[str, int], *, params: Optional[dict] = None) → PyTravisCI.resource_types.user.User[source]

Provides the information of a user from its ID.

Official Travis CI API documentation:
Parameters:
  • user_id – Value uniquely identifying the user.
  • params – The query parameters to append to the URL.
lint(subject: Union[_io.TextIOWrapper, bytes, str]) → PyTravisCI.resource_types.lint.Lint[source]

Lints the given subject.

Official Travis CI API documentation:
Parameters:subject – A string, file stream or bytes.
Raises:TypeError – When then given subject is not correct.
set_access_point(value: str) → None[source]

Sets the access point to communicate with.

set_access_token(value: str) → None[source]

Sets the access token.