Skip to content

redsymbol/faws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

faws - the Futuristic AWS library for Python 3

faws is a Python 3 library for working with the API of Amazon Web Services. It is called "futuristic" because of how it extensively uses futures - introduced in Python 3.2 - to let you easily invoke the AWS API in parallel.

Faws differs from boto, the current gold standard, in several ways:

  • faws is concurrent and asynchronous by design
  • faws maps more directly with the AWS REST api, bringing key benefits
  • faws works with Python 3 (and only Python 3)
  • boto is much more mature; faws is more early-stage and experimental

Your interaction with faws will extensively use Python's new-ish futures functionality. This lets you leverage concurrency with very little development effort. Your latency-bound API calls over the network can execute in parallel, and your application will run that much faster.

faws is in an early, incomplete stage. While its novel ideas have exciting potential, until it matures, most people developing production software will be better served by using boto instead. See "Should I use boto or faws?" below for how you can decide.

Example

from faws import Agent
agent = Agent()
# The following is non-blocking.
# Returns an instance of concurrent.futures.Future
get_instances = agent.callf('DescribeInstances')
# Do something else for a while...
# Maybe make another high-latency API call
# Now collect the result
result = future.result()
for instance_id in result.tree().iter('instanceId'):
    print(instance_id.text)

Should I use boto or faws?

faws is currently in early development; boto is much more mature. Until faws is more fully developed, most production projects will be better served by using boto.

A few reasons you might want to use faws instead:

1. boto is currently Python 2 only; the next version, boto 3, will support both Python 2 and 3 (per the boto developer), but there is no timetable for its stable release yet. In contrast, faws is focused entirely on Python 3 (in particular, 3.2 and higher). If you want to write your application in Python 3 today, you must either find an unofficial port of boto, or use faws.

2. faws lets you extensively use futures, integrated strongly into its API. Futures are in the Python 3 standard library, in the concurrent.futures package. Since API calls across the network to AWS have significant latency, this alone allows you to create much more responsive applications.

3. The interface of faws maps much more closely and directly to the AWS API, allowing you to use the official API reference as documentation for much of faws. It's also structured to solve the "API lag" problem: when the AWS API is updated, you can often utilize its new features without being forced to upgrade faws.

Author

Created by Aaron Maxwell. To give feedback, bug reports, complaints, praise, etc., contact him at amax at redsymbol dot net .

Aaron is selectively available as a consultant for AWS/cloud migration and architecture projects; reach him at the same email address.

License

Copyright 2013 Aaron Maxwell. Licensed under GPL v.3. All other rights reserved.

About

Futuristic AWS library for Python 3 (work in progress)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published