Skip to content

AWS Lambda Python Microservice that transforms arbitrary XML/RSS to JSON

License

Notifications You must be signed in to change notification settings

uncompiled/chalice-transmogrify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chalice-transmogrify

Build Status Code Climate Issue Count Requirements Status

chalice-transmogrify is a service that transforms XML/RSS to JSON and is designed to run on AWS Lambda.

It's built on the chalice Serverless Microframework for Python.

Getting Started

Set up your environment

  • git clone https://github.com/uncompiled/chalice-transmogrify.git
  • cd chalice-transmogrify
  • pipenv install (recommended)

Configure AWS Credentials

chalice is specifically designed to work on AWS Lambda, so you will need an AWS account to use it.

If you have previously configured your machine to use boto3 (the AWS SDK for Python) or the AWS CLI, then you can skip this section.

Otherwise, you'll need to configure your AWS credentials.

Deploy to AWS Lambda

  • pipenv run chalice deploy

Endpoints

GET /convert

PARAMS:

  • url = urlencoded path to an RSS feed

Example Request

/convert?url=http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml

Example Response

{
    "rss": {
        "@xmlns:dc": "http://purl.org/dc/elements/1.1/",
        "@xmlns:media": "http://search.yahoo.com/mrss/",
        "@xmlns:atom": "http://www.w3.org/2005/Atom",
        "@xmlns:nyt": "http://www.nytimes.com/namespaces/rss/2.0",
        "@version": "2.0",
        "channel": {
            "title": "NYT > Home Page",
            "link": "http://www.nytimes.com/pages/index.html?partner=rss&emc=rss",
            "atom:link": {},
            "description": null,
            "language": "en-us",
            "copyright": "Copyright 2016  The New York Times Company",
            "lastBuildDate": "Tue, 31 May 2016 00:42:36 GMT",
            "image": {
                "title": "NYT > Home Page",
                "url": "https://static01.nyt.com/images/misc/NYT_logo_rss_250x40.png",
                "link": "http://www.nytimes.com/pages/index.html?partner=rss&emc=rss"
            },
            "item": [] // feed items
        }
    }
}

License

The MIT License (MIT)