Skip to main content

Use the TeamCity REST API from Python

Project description

PyTeamCity

Latest Version Build Status

Python interface to the REST API of TeamCity

Installation

pip install pyteamcity

Examples

Connect to server

from pyteamcity import TeamCity

# This initialises the Client with the settings passed. <port> has to be an integer.
tc = TeamCity('account', 'password', 'server', <port>)

or specify no parameters and it will read settings from environment variables:

  • TEAMCITY_USER

  • TEAMCITY_PASSWORD

  • TEAMCITY_HOST

  • TEAMCITY_PORT (Defaults to 80 if not set)

from pyteamcity import TeamCity

# Initialises with environment variables: TEAMCITY_{USER,PASSWORD,HOST,PORT}
tc = TeamCity()

Getting data

tc.get_all_projects()
tc.get_project_by_project_id('MyProject')
tc.get_all_users()
tc.get_user_by_username('codyw')
tc.get_all_vcs_roots()
tc.get_all_build_types()
tc.get_changes_by_build_id(73450)
tc.get_build_statistics_by_build_id(73450)
tc.get_build_tags_by_build_id(73450)
tc.get_all_changes()
tc.get_change_by_change_id(16884)
tc.get_all_builds(start=0, count=3)
tc.get_build_by_build_id(73450)
tc.get_server_info()
tc.get_agents()
tc.get_all_plugins()

You can also look at sample.py or test_pyteamcity.py

Acknowledgements

This is a heavily-modified fork of https://github.com/yotamoron/teamcity-python-rest-client so many thanks are due to Yotam Oron

Changes

Unreleased

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

pyteamcity-0.0.1.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file pyteamcity-0.0.1.tar.gz.

File metadata

  • Download URL: pyteamcity-0.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyteamcity-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c78b088a70682002c88c983a5382705815813bd691b06dc43bdb1f9f5e64f727
MD5 c2f6837c23a1fbe018dba5c3509afead
BLAKE2b-256 eb1aadc40780c07494e4bc32815b41f5bb5174d9ae11405ae001c746c4bc67f3

See more details on using hashes here.

Supported by

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