Skip to content

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

License

Notifications You must be signed in to change notification settings

TopTuK/PyTfsClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TESTS

Run tests

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.

Installing

Feel free to use command "pip install pytfsclient"

Basic usage

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

    3.1 If you want to manage workitems

    workitem_client = ClientFactory.get_workitem_client(client_connection)

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

    project_client = ClientFactory.get_project_client(client_connection)
  2. Manage TFS items

    4.1 Managing workitems

    wi = workitem_client.get_single_workitem(100500)
    print('Item: Id={}, Title={}, State={}'.format(wi.id, wi.title, wi['System.State']))
    wi['Custom.Field'] = 'Value'
    wi.update_fields()
    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))

Coding style

https://google.github.io/styleguide/pyguide.html

Additional API

  • It can send mentions to another user (see MentionClient::send_mention)
  • It can get project identities (groups, teams, etc.) without Graph API.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages