Files
pyteamsnap/README.md
2022-05-22 16:34:15 -05:00

7.0 KiB

Contributors Forks Stargazers Issues LinkedIn


Logo

pyteamsnap

Unofficial TeamSnap API wrapper for python.
· Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

An unoffical python wrapper for the TeamSnap API. A work in progress.

(back to top)

Built With

(back to top)

Getting Started

Prerequisites

Installation

  1. Get OAuth 2 Credentials from TeamSnap at https://auth.teamsnap.com/ (TeamSnap Documentation)
  2. Install pyteamsnap
    pip install git+https://github.com/anthonyscorrea/pyteamsnap
    

(back to top)

Usage Example

from pyteamsnap.api import TeamSnap, Me, Event, EventLineupEntry, Member
client = TeamSnap(token=TOKEN)

# get authenticated user
me = Me(client)

# get a list of team_ids for the user
managed_team_ids = me.data['managed_teams']

# get a list of events for managed team
managed_team_id = me.data['managed_teams'][0]
events = Event.search(client, team_id=managed_team_id)

# get an object with the object id of EVENT_ID 
event = Event.get(client, id=EVENT_ID)

# get some information about the event
start_date = event.data['start_date']

# create a new member
member = Member.new(client)
member.data['first_name'] = 'Ferguson'
member.post()

# update a Member with id of MEMBER_ID
member = Member.get(client, id=MEMBER_ID)
member.data['last_name'] = 'Jenkins'
member.put()

# delete a Member
member.delete()

# perform a bulk load
list_of_ts_objects = client.bulk_load(team_id = TEAM_ID, types = [Event, Member], event__id=EVENT_ID)

(back to top)

Roadmap

Implemented objects

  • Me
  • User
  • Event
  • Team
  • Availability
  • Member
  • Location
  • Opponent
  • EventLineupEntry
  • EventLineup
  • AvailabilitySummary

Implemented Queries

  • search
  • bulk_load

Implemented Actions

  • create
  • read
  • update
  • destroy

Implemented objects, but not tested.

  • Statistics
  • MemberStatistics

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Your Name - @anthonyscorrea - a@correa.co

Project Link: https://github.com/anthonyscorrea/pyteamsnap

(back to top)