Skip to main content

Microsoft Team Foundation Server Python Library is a Microsoft TFS API Python client that can work with Microsoft TFS workitems

Project description

PyTfsClient library (TFS API Python client)

Microsoft Team Foundation Server Python Library is a Microsoft TFS API Python client that can work with Microsoft TFS workitems.

Installing

Feel free to use command "pip install pytfsclient"

Basic usage

  1. Install pytfsclient package
  2. Import package
import pytfsclient
from pytfsclient.tfs_client_factory import TfsClientFactory
  1. Create and configure Base TFS Client
base_client = TfsClientFactory.create('https://tfs-server/tfs/', 'DefaultCollection/MyProject')
### IF authentificate with PAT
base_client.authentificate_with_pat('<personal access token>')
### OR with user name and password
base_client.authentificate_with_password('username', 'userpassword')
  1. Get facade your need

    3.1 If you want to manage workitems

    client = TfsClientFactory.get_workitem_client(base_client)
    

    3.2 If you want to manage projects, teams, team members

    client = TfsClientFactory.get_project_client(base_client)
    
  2. Manage TFS items

    4.1 Managing workitems

    wi = client.get_single_workitem(10500)
    print('Item: Id={}, Title={}, State={}'.format(wi.id, wi.title, wi['System.State']))
    wi['Custom.Field'] = 'Value'
    wi.update()
    print('Item custom field: {}'.format(wi['Custom.Field']))
    
    workitems = client.get_workitems([1, 2, 3])
    for wi in workitems:
        print('Item: id={}, Title={}'.format(wi.id, wi.title))
    

Docs

TODO:

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

pytfsclient-0.9.4.tar.gz (14.0 kB view hashes)

Uploaded Source

Built Distribution

pytfsclient-0.9.4-py3-none-any.whl (16.8 kB view hashes)

Uploaded Python 3

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