Skip to content

Instantly share code, notes, and snippets.

View codeSamuraii's full-sized avatar

Rémi Héneault codeSamuraii

  • Paris, France
View GitHub Profile
@codeSamuraii
codeSamuraii / django-q-cluster.sh
Last active March 24, 2021 16:49
Deploy Django-Q to an EC2 instance with Elastic Beanstalk
container_commands:
01_makemigrations:
command: "python manage.py makemigrations"
leader_only: true
02_migrate:
command: "python manage.py migrate"
leader_only: true
# Patch the current version, circular imports cause an ImportError (see https://github.com/Koed00/django-q/issues/331)
03_patch_django_q:
# Replace line 12 ('from django_q.cluster import worker, monitor') by 'from django_q.cluster import *'
@codeSamuraii
codeSamuraii / zoho_json_utils.py
Last active November 16, 2018 10:12
Parse Zoho Recruit JSON response into a Python dict
import json
import pandas as pd
# Input: Zoho JSON response as a string - Output : {'First Name': 'John', 'Last Name': 'Doe', 'Phone': ... }
# To be used like a generator (i.e `for candidate in parse_json_iter(zoho_response):`)
# `get_fields` allows you to specify fields to get, the others will be dismissed.
# `module` = 'Candidates', 'JobOpenings'... (haven't tried with others)
def parse_json_iter(raw_json_response: str, module: str = 'Candidates', get_fields: list = []):
"""Parse through a JSON response of candidates."""