Python wrapper for the Assembla API
Project description
An easy to use wrapper around the Assembla API.
Basic Example
from assembla import API
assembla = API(auth=('Username', 'Password',))
print assembla.space(name='Big Project').ticket(number=201).status_name
Examples for Spaces
# Retrieve your available spaces
spaces = API.spaces()
# Select a specific space
space = API.space(name='Big Project')
# Retrieve the space's milestones
milestones = space.milestones()
# Retrieve a specific milestone from the space
milestone = space.milestone('Release Candidate 1')
# Retrieve all of the space's tickets
tickets = space.tickets()
# Retrieve the space's tickets which are awaiting testing
tickets = space.tickets(status_name='Test')
# Retrieve a specific ticket from the space
ticket = space.ticket(number=301)
# Retrieve all of the space's users
users = space.users()
# Retrieve a specific user from the space
user = space.user(name='John Smith')
Examples for Milestones
# Select a specific milestone
milestone = assembla.space(name='Big Project').milestone('Release Candidate 1')
# Retrieve the milestone's tickets
tickets = milestone.tickets()
# Retrieve a specific ticket from the milestone
ticket = milestone.ticket(number=301)
# Retrieve the milestone's users
users = milestone.users()
# Retrieve a specific user from the milestone
user = milestone.user(name='John Smith')
Examples for Users
# Select a specific user user = assembla.space(name='Big Project').user(name='John Smith') # Retrieve the user's tickets tickets = user.tickets() # Retrieve a specific ticket from the user ticket = user.ticket(status_name='Test')
Examples for Tickets
# Retrieve a specific ticket
ticket = space.ticket(number=201)
# Retrieve all tickets awaiting code review
tickets = space.tickets(status_name='Code Review')
# Retrieve all tickets assigned to an individual which are of a certain priority
# and awaiting testing
tickets = space.tickets(
assigned_to_id=user.id,
priority=1,
status_name='Test'
)
Model Reference
All models (Space, Milestone, User and Ticket) are returned with fields corresponding to the data from Assembla. Naming conventions generally follow Assembla’s API Reference. Where possible, values are coerced to native Python types.
Caching
Spaces have an in-memory caching system, which reduces the overheard on repeated requests to Assembla. By default, it is activated. You can deactivate it:
# Deactivate the cache for a space, all subsequent requests will return fresh data
space.cache.deactivate()
# Deactivate the cache for all spaces instantiated from `assembla`
assembla = API(auth=('Username', 'Password',), use_cache=False)
If you want to purge stale data from a space’s cache and begin refilling it:
# Purge stale data from the space's cache, any subsequent request will update the cache space.cache.purge()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
assembla-1.1.0.tar.gz
(10.7 kB
view details)
File details
Details for the file assembla-1.1.0.tar.gz.
File metadata
- Download URL: assembla-1.1.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fee6e71217cf3bed94ad8515b2f289d97965f81fcfd421da8bec883d0f1d00f0
|
|
| MD5 |
ad2960ef457a716e374f44d99912a591
|
|
| BLAKE2b-256 |
f8a867d98c82654d12c9899d66a9512f6e45cd8194e243c86298cad0f42e6862
|