Exploring the Possibilities of Standalone App for use in Micro-Econ Program in Bangladesh.
I am an economist working on projects in the Bangladeshi garment industry. I am looking to develop an application that can be used by people observing factory workers. The application would be used by observers to record the interactions of certain workers. I am pretty experienced with Python (mostly from a data point of view), but I have never developed an application.
I am seeking to understand Pythonista particularly along the following dimensions:
I see from the homepage here that it is possible to export code in a format that allows for the application to be standalone (i.e. not accessed through the Pythonista interface). Is this right? How easy is this? Does my iPad care that the app did not come from the app store? Could I put this app on other devices? Forgive my ignorance.
Is it possible to store data generated by the user? If so, would this be done in a comma separated format? Where should one create such text files to be accessed by the application? Once created how would one read the data into the memory on restarting the application ready for manipulation etc.?
When developing an application is it best to think of pythonista as a prototype environment rather than the ultimate operating environment?
Apologies for the broad nature of these questions. Of course I don't expect anyone to reply in full, but even some keywords for me to do more research on would be really useful.
Brief description of the application: Say there are 10 workers being observed, each worker is assigned a button. When an interaction occurs the observer presses the button relating to the worker, and a pop up appears asking the user to select from options that relate to the nature of the interaction. Possibly upon doing so further pop ups appear to ask for additional information. All data are stored, presumably in csv format, which can be accessed and modified by the app at later dates, and then the data downloaded/uploaded to dropbox at regular intervals.
Thanks for any help you can give.
This sounds like a really cool project!! I would be happy to help you to achieve it.
- Using Apple's Xcode to compile a Pythonista script into a standalone iOS app that can go into Apple's App Store appears to be fairly straightforward. The resulting app runs on iOS devices but does not run on devices not running iOS (e.g. Android). The Pythonista Forum community can advise you on building an App Store app if you can create a Pythonista script that meets your needs. My recommendation would be that you put a single free app into Apple's App Store that has two simultaneous purposes: a) education about your group's mission in Bangladesh and b) recording the observance of workers. Everyone who downloaded the app could access the educational content (a) but only people in your group with a valid userid and password would be able to unlock the recorded observances capabilities (b). You could start with something simple and build up to something more complicated over time.
- Pythonista allows you to write results into the local file system of the device that it is running on. My encouragement would be to consider the JSON format which is more modern, less tricky to code against, closer to the Python data structures, and more self documenting than CSV. However, Python and Pythonista have full support for both JSON and CSV so you can do either one. Reading (json.load()) and writing (json.dump()) is very straightforward so this will not be a hurdle. Similar commands for CSV are only slightly more complicated.
- My advise would be to start in Pythonista and build something that suits your purposes. If you find that Pythonista is blocking your forward progress then you can rewrite using other languages but my sense is that Pythonista will be sufficient for delivering the desired functionality.
Given your knowledge of the data end of Python, a good starting point would be to create a tuple or dict that describes the possible actions of a worker that you want to capture. A bit of the hierarchy of the actions to be obesrved would allow us to create a prototype solution that will help further refine the application ideas. I hope this helps.
bee18 last edited by
I see the problem would be creating the UI since Pythonista doesn't provide API to use standard iOS' UI widgets.
Thanks so much for your initial answer and the subsequent comment. I think at this point I will have to play around with pythonista for a few days, just to get a feel for what I am doing.
If either of the users who replied to this wish to elaborate on exactly what bee's comment means for me, and the availability of Hydrogen, that would be much appreciated. I am still learning the basic way to talk about applications.
bee's comment means that Pythonista's graphics modules (see: scene and canvas) do not provide access to the native iOS graphical user interface elements such as buttons, lists, menus, etc. My reply to his comment means that enterprising developers like bashedcrab have gotten beyond this limitation and created graphical user interface elements in Python that could deliver the required functionality. The Python source code for Hydrogen can be accessed from bashedcrab's GitHub site: https://gist.github.com/BashedCrab
bee18 last edited by
I haven't tried Hydrogen. I believe it's a good UI framework. But is it complete? Does it have grid, for example? How does the look-and-feel compare to the native UI? Is it well tested? Is it still actively developed? To whom may I ask for support? How about the license? Etc, etc…
Maybe it's alright if you build a small custom application with minimal technical support. But if I need to build a serious enterprise application, I don't want to spend most of the development time to write custom UI codes. I want a reliable and well tested UI framework and it's nothing else but the native UI of the OS.
But I don't know the scale of the app rcreedon want to build. Maybe Hydrogen is good enough, or maybe not. Only rcreedon knows the answer. :)
So I don't think what I am doing is a 'serious enterprise application' which is good news. I run various projects for a research institute based at yale university out here in the wilds of Dhaka, and the teams are small. The problem is I am a social scientist not a computer scientist. I am a total noob at anything other than data management.
So, I'm not sure how much you guys are into helping me, but I have started to write what seems to me to be the beginnings of the application. I have played around in Pythonista and mostly found it baffling. I have therefore more or less resorted to pseudo-code in an attempt to think through what I want to do, and to work out if it is achievable.
I have only really touched on the very beginnings, for example I have not yet created the data containers. I have paused because I think the usefulness of doing this is somewhat unclear, so I wanted to get some feedback. If this psuedo-code approach is so useless as to be, well, useless, then I shall not bother and I will try a more ground up approach to learning Pythonista, if it is useful to describe what I am trying to do, and if I am able to get feedback on that, then I shall continue.
Totally understand if this is too much to ask a forum, but as ever any help at all will be gratefully received....
Link to gist here:
Actually you know what, I can do better than that. I am having difficulty with the scene module, but I can write this to be more meaningful with console I think, and then possibly transfer the ideas across....
Sorry for the s#!t post earlier. I had a rethink and developed a better structure using console. I think this gives a much better idea of the sort of thing I am doing. Ultimately I could live with doing this in the console, but really to make this look like a real app rather than a computer dialogue would be much nicer.
Any hints/tips/collaborations welcome :-)
I added some questions in the gist comments.
Thanks so much. I am going to work on this today. I have added some comments/clarifications. I guess at the risk of overloading this forum with useless info we can move our discussion there. Alternatively my email is *** If you let me know once you have read this I will delete the post to avoid python spam ;-)