'Scrapy requires a few configuration settings in order to run:
http://doc.scrapy.org/en/1.1/topics/commands.html#configuration-settings
This method ensures they are correctly written to the filesystem
in a location where Scrapy knows to look for them.
Returns True if the file was created, or False if the file already
exists (in which case it was not modified.)'

def ensure_scrapy_cfg(self):

    cfg_file = path('~/.config/scrapy.cfg').expand()
    if cfg_file.isfile():
        return False
    cfg_file.parent.makedirs_p()
    content = dedent('\n                                                [settings]\n                                                default    =    pa11ycrawler.settings\n\n                                                [deploy]\n                                                project    =    pa11ycrawler\n                                ')
    cfg_file.write_text(content)
    return True
