celery + mongodb + RMQ + Flower service/app skeleton
Hi All, - - https://github.com/sivang/laten-fw After some extensive work with Celery over the last 2 years, I created this 'framework' skeleton with an example application, so anybody who wants to get up and running with Celery but gets confused from the tutorials and examples out there, can do so merely by running an ansible playbook. This was tested on Ubuntu 16.04 to 18.10 , and can be used out of the box to write and experiment with your own tasks. It can sure use more docs for the resulting setup, and operating it through flower and mongo-express. I have plans to turn this into something that can accept tasks over the wire, from document stores and offer some sorts of Web UI of its own. There's also slides at the root for a related talk I gave about my takeouts from working with the above setup for Audio file analysis and ETL (and this sort of example is also coming soon to a github near you..). Your feedback welcomed, -Sivan -- https://mail.python.org/mailman/listinfo/python-list
Re: more pythonic way
+1 with David Raymond, it's nice to use condensed style when it leaves things readable and logic. But if in doubt: "Explicit is better than implicit. Simple is better than complex." :) -Sivan On Mon, Feb 11, 2019 at 10:19 PM David Raymond wrote: > My non-expert vote is for > > if month is None: > month = datetime.date.today().month > > Because you're checking for your default value, not whether the boolean > version of what they did give you is True or False. It's explicit, it's not > reliant on any __bool__() function implementations or overrides, etc. > > > -Original Message- > From: Python-list [mailto:python-list-bounces+david.raymond= > tomtom@python.org] On Behalf Of Felix Lazaro Carbonell > Sent: Monday, February 11, 2019 2:30 PM > To: python-list@python.org > Subject: more pythonic way > > > > Hello to everyone: > > Could you please tell me wich way of writing this method is more pythonic: > > > > .. > > def find_monthly_expenses(month=None, year=None): > > month = month or datetime.date.today() > > .. > > > > Or it should better be: > > ... > > if not month: > > month = datetime.date.today() > > .. > > > > Cheers, > > Felix. > > > > -- > https://mail.python.org/mailman/listinfo/python-list > -- > https://mail.python.org/mailman/listinfo/python-list > -- Sivan Greenberg Co founder & CTO Vitakka Consulting -- https://mail.python.org/mailman/listinfo/python-list
Re: Scraping multiple web pages help
Hi there Drake, A quick google search revealed: - https://regulationsgov.github.io/developers/ This seems particulriy useful: - https://regulationsgov.github.io/developers/console/ And to fetch stuff from the API, there's Python requests that has a rather wonderful doc: - http://docs.python-requests.org/en/master/ HTH, -Sivan On Mon, Feb 18, 2019 at 8:22 PM Drake Gossi wrote: > Hello everyone, > > For a research project, I need to scrape a lot of comments from > regulations.gov > > > https://www.regulations.gov/docketBrowser?rpp=25&so=DESC&sb=commentDueDate&po=0&dct=PS&D=ED-2018-OCR-0064 > > But partly what's throwing me is the url addresses of the comments. They > aren't consistent. I mean, there's some consistency insofar as the numbers > that differentiate the pages all begin after that 0064 number in the url > listed above. But the differnetiating numbers aren't even all the same > amount of numbers. Some are 4 (say, 4019) whereas others are 5 (say, > 50343). But I dont think they go over 5. So this is a problem. I dont know > how to write the code to access the multiple pages. > > I should also mention I'm new to programing, so that's also a problem (if > you cant already tell by the way I'm describing my problem). > > > I should also mention that, I think, there's an API on regulations.gov, > but > I'm such a beginner that I dont evem really know where to find it, or even > what to do with it once I do. That's how helpless am right now. > > Any help anyone could offer would be much appreciated. > > D > -- > https://mail.python.org/mailman/listinfo/python-list > -- Sivan Greenberg Co founder & CTO Vitakka Consulting -- https://mail.python.org/mailman/listinfo/python-list