Using amazon alexa echo in my application - python

I am working on a group project which entails generating many reports. We were thinking of using amazon echo. We would ask alexa to fetch the reports from a particular tine period or something like that.
We plan on doing so using Python.
It is possible using ASK(Alexa Skills Kit) SDK to achieve this goal ? Like, can alexa tap into our application and fetch all that we want. We do not want to use anything else other than Amazon echo.

I think it's possible you need to create a custom skill for that, there are somethings that you might want to consider though,
How long is the report: it will work fine if reports are small and giving you some brief overview or some numbers. you don't wanna listen to long report on that robotic voice.
Name of reports: sometimes Alexa will not understand or misunderstood the name you're trying to say if it's complex one.
meaning of tap into your application: In Alexa skill you can write custom logic just like you write for a software so If there's API to fetch reports then It can be done. The skill will call API and pass the data that you say to that skill, data like to date, from date etc.

Related

Project to have an API to get a list of prices and name along with python

I am novice to the API field and want to learn the basics of API. I am also learning python. Can I use python along with API to achieve the goal provided below?
My ULTIMATE goal is to identify the price of a product from all the Big retailers and compare the price list.
Also kindly advise what are the tools, programing language that I need to have/learn apart from python and API.
[
{
name: xxx,
id: xxx,
price: xxx,
Shop Name: xxx
},
{
name: xxx,
id: xxx,
price: xxx,
Shop Name: xxx
},
]
There are 3 major steps with 2 main 'programs'
step 1
create a basic server
the two good frameworks I have experience in python are Django and Flask. Another that I don't have experience in but have heard good things about is fastAPI
Going through a tutorial for any to get a basic 'hello world' API endpoint running would be a good first step.
note
For this purpose, it won't make much of a difference if your api is REST, SOAP, or RPC. If none of these mean anything to you right now, that's ok. You'll learn more as you follow tutorials.
step 2
Create a webscraper to get prices for a product from a company site
Realistically, you'll probably want to create a list of all the companies / sites you'll want to include in your search for best prices.
It'll be best to try and get your webscraper functioning for a single site, and then expand it to each other site.
two decent tutorials for doing this are here
and here
After you're able to run your script and get best prices from a single site, expand it to be able to scrape all the sites in your list.
Each site will likely need it's own method, as the site layout and keywords to search for in the html/xml will be different per site.
Once you're able to run your script by giving it some product name and you get the best prices from an assortment of sellers, you're ready for step 3
step 3
put it all together
once you have a basic api endpoint, and your script to get best prices from sellers, all you need to do is format your script as a module in django or flask, then import and call the methods in your api endpoint.
In order to optimize (there are probably going to be a ton of sites in the list eventually), you'll want to look into threading and asynchronous tasks. Django is better for multithreading than flask if this is something you think you'll definitely want to implement
notes
the 2 major components of this are and api endpoint to serve your information, and a webscraper to gather the information.
Either of these pieces can be done in most programming languages
Python is a fine language for this, but I would personally recommend TypeScript and nextjs or a nodejs based framework for the api endpoint.
Another great option is Go, as Go inherently has amazing support for threading via Channels that would make calling python scripts at the same time and waiting for all to finish a fairly simple task
Python is still a great use case for webscraping, so if you go with a nodejs or Go based server, you'll want to have each site's webscraping in separate scripts, so that distinct programs can be called to run concurrently.
recap
you need a server and a webscraper. any language and framework is acceptable for either.

Is there a way to create an Alexa smart home group and pre-populate it based on discovered devices, programatically?

In the process of discovering devices via Alexa, I'd like to create and pre populate groups with devices. The devices being discovered have data pertaining to which room/group they belong to, so it would only seem natural to group these during discovery.
Is this something that's possible? I haven't found anything in their documentation to suggest that it is
Unfortunately you can't tell Alexa about groups in your discovery response.

An Email Report Application for Outlook

The sales folk in my start-up send and receive a bunch of mail on a daily basis from vendors. dealers and customers.
But they tend to lose track of these mails quite often...as to whether they have responded/followed-up or not. And they waste a lot of time on figuring this out.
Expecting them to use a Mail Tool like MailChimp is even more painful and a ticketing tool is not a good fit for the jobs.
Hence, I am trying to build an app that can create a report of the total Email IDs interacted with in a particular date range. The only goal is to create a report, in a csv file or to dump the data into Google spreadsheets.
The report for the period entered by the user would look as below:
Email ID - All emails lying in "sent items" AND "inbox" for particular date range
Name - If present
Status
The "Status" would be:
Received not responded by sales person
Sent but not responded by recipient
Responded by Sales Person
...and so on
I am vary of running the script directly on the mail server and am not sure if Outlook Exchange would allow something like this.
I would prefer if it could be an application that runs directly on the sales person's machine.
A few use Macs and the others Windows. I would be focussing on the Macs first.
The mail tool used is Outlook for Mac-2011 and the machines are either Lions or Snow Leopards.
Mail is on the Outlook Exchange
I must confess to be not much of a coder, but i blunder/Google my was through it.
I had some time on my hand with the holiday season coming up, hence thought of taking this project up.
I am moderately comfortable with Python.
But for this project, from what i have read, appears to be the job for AppleScripting.
Before starting my blunderings, i wanted to seek the advice of the SO community on the same:
Is AppleScripting the best bet here? If yes, could you share the best resource to read up the same. I have the copy of "AppleScript The Comprehensive Guide to Scripting and Automation on Mac OS X". But it is almsot 6 years old.
Could it be done somehow just using Python? - I wanted to dump the respective reports onto Google Spreadsheets, hence would be easier to get Python involved here.
Are there any similar applications that are already out there?
Or am i completely off track
Sorry for the ramble. But really Looking forward to some assistance on this
I liked:
AppleScript 1-2-3
and
AppleScript: The Definitive Guide
There also some good tutorials here: MacScripter
That being said, you should consider the cost/benefit of learning AppleScript to accomplish one task at your company. You may be better off simply hiring someone to write the script for you and focus on growing your business instead.

How can I store my atom data so my IRC bot can access it? Should I use SQL at all?

I want to add feeds such as ajaxian, smashingmagazine and store feeds starting today on my server, in order so that I can push the new items to my irc bot so it can echo them in my channel.
I will get ATOM data from this service: http://superfeedr.com/subscriber .. so I'm wondering which of the NoSQL storage mechanisms is ideal for storing ATOM data?
The atom data is xml, so they are documents, so perhaps something like CouchDB is suitable? Or MongoDb/Cassandra/Redis?
I'm aware that there are different kinds of no sql databases such as document oriented vs key/store, but as I don't have much experience I'd appreciate some insight from someone way more experienced. Thanks.
Additional things to consider
These won't be displayed on a website, or any publically viewable URL.
The only way to view them is to either a) wait for the bot to post new ones every hour or b) manually query the bot and give a time range or something like 0,20 and 20,40 through PM on IRC.
I won't really need to scale, I just have 15-20 people in the IRC chat room and only 1-3 people on average would probably query the bot at a given hour.
The bot will spit out new links every hour. The bot will never spit out old links.
I would say that you will have to use the database you are most comfortable with.
Also look at the CAP Theorem to clarify better what exactly you need.
Couple of minutes ago I replied to a similar question. So you can have a look.
I want to store external rss feed data - is this a good reason to use NoSQL?
No
If the content you're storing is natively XML, and you have need to be able to run queries against it (say, using XPath), you might consider a native XML database such as eXist.
That said, it sounds like your needs are basic enough that any halfway-reasonable datastore will do.

I'm searching for a messaging platform (like XMPP) that allows tight integration with a web application

At the company I work for, we are building a cluster of web applications for collaboration. Things like accounting, billing, CRM etc.
We are using a RESTfull technique:
For database we use CouchDB
Different applications communicate with one another and with the database via http.
Besides, we have a single sign on solution, so that when you login in one application, you are automatically logged to the other.
For all apps we use Python (Pylons).
Now we need to add instant messaging to the stack.
We need to support both web and desktop clients. But just being able to chat is not enough.
We need to be able to achieve all of the following (and more similar things).
When somebody gets assigned to a task, they must receive a message. I guess this is possible with some system daemon.
There must be an option to automatically group people in groups by lots of different properties. For example, there must be groups divided both by geographical location, by company division, by job type (all the programers from different cities and different company divisions must form a group), so that one can send mass messages to a group of choice.
Rooms should be automatically created and destroyed. For example when several people visit the same invoice, a room for them must be automatically created (and they must auto-join). And when all leave the invoice, the room must be destroyed.
Authentication and authorization from our applications.
I can implement this using custom solutions like hookbox http://hookbox.org/docs/intro.html
but then I'll have lots of problems in supporting desktop clients.
I have no former experience with instant messaging. I've been reading about this lately. I've been looking mostly at things like ejabberd. But it has been a hard time and I can't find whether what I want is possible at all.
So I'd be happy if people with experience in this field could help me with some advice, articles, tales of what is possible etc.
Like frx suggested above, the StropheJS folks have an excellent book about web+xmpp coding but since you mentioned you have no experience in this type of coding I would suggest talking to some folks who have :) It will save you time in the long run - not that I'm saying don't try to implement what frx outlines, it could be a fun project :)
I know of one group who has implemented something similar and chatting with them would help solidify what you have in mind: http://andyet.net/ (I'm not affiliated with them at all except for the fact that the XMPP dev community is small and we tend to know each other :)
All goals could be achieved with ejabberd, strophe and little server side scripting
When someone gets assigned to task, server side script could easily authenticate to xmpp server and send message stanza to assigned JID. That its trivial task.
To group different people in groups, it is easily can be done from web chat app if those user properties are stored somewhere. Just join them in particular multi user chat room after authentication.
Ejabberd has option to automatically create and destroy rooms.
Ejabberd has various authorization methods including database and script auth
You could take look at StropheJS library, they have great book (paperback) released. Really recommend to read this book http://professionalxmpp.com/

Categories