Skip to main content

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()

Source: https://github.com/markfinger/assembla

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

assembla-1.1.1.tar.gz (10.7 kB view details)

Uploaded Source

File details

Details for the file assembla-1.1.1.tar.gz.

File metadata

  • Download URL: assembla-1.1.1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for assembla-1.1.1.tar.gz
Algorithm Hash digest
SHA256 2c6f71bfa85abb72e8d4cd8c56d52764917e9b7bbb090127153ae0aef1bf2ad9
MD5 a0bedc2615e74b7c62311c06b836f04e
BLAKE2b-256 c4d5fb0e5d9628be222ba712a5e281af6183985a1541aa149ae78df381a46093

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