# Path: onix/scrapers.py
# def get_commit_from_timestamp(timestamp):
# def _write(data, destination_filename):
# def _scrape(url, entry, commit=None, destination_filename=None):
# def scrape_battle_formats_data(commit=None):
# def scrape_battle_pokedex(commit=None):
# def scrape_battle_aliases(commit=None):
# def scrape_battle_items(commit=None):
# def scrape_battle_movedex(commit=None):
# def scrape_formats(commit=None):
# 
# Path: onix/utilities.py
# def sanitize_string(input_string):
#     """
#     Strips all non-alphanumeric characters and puts everything in lowercase
# 
#     Args:
#         input_string (str) : string to be sanitized
# 
#     Returns:
#         str : the sanitized string
# 
#     Examples:
#         >>> from onix.utilities import sanitize_string
#         >>> print(sanitize_string('Hello World'))
#         helloworld
# 
#     """
#     return re.compile(r'[^A-Za-z0-9]').sub('', input_string).lower()


import json
import re
from collections import defaultdict
from future.utils import iteritems
from onix import scrapers
from onix.utilities import sanitize_string
"""Generate the config file that lists which Pokemon can change formes. While
we're at it, generate the species lookup dictionary that handles prettifying
species names, labelling forme-concatenations and combining appearance-only
formes"""






def generate_single_forme_species_lookup():
    """
    Generate the species lookup for single formes (that is, combine
    appearance-only formes)

    Returns:
        dict :
            Starting point for `species_lookup` dictionary (that is, without
            forme-concatenations)
    """
    try:
        pokedex = json.load(open('.psdata/pokedex.json'))
    except IOError:

# Path: onix/scrapers.py
# def get_commit_from_timestamp(timestamp):
# def _write(data, destination_filename):
# def _scrape(url, entry, commit=None, destination_filename=None):
# def scrape_battle_formats_data(commit=None):
# def scrape_battle_pokedex(commit=None):
# def scrape_battle_aliases(commit=None):
# def scrape_battle_items(commit=None):
# def scrape_battle_movedex(commit=None):
# def scrape_formats(commit=None):
# 
# Path: onix/utilities.py
# def sanitize_string(input_string):
#     """
#     Strips all non-alphanumeric characters and puts everything in lowercase
# 
#     Args:
#         input_string (str) : string to be sanitized
# 
#     Returns:
#         str : the sanitized string
# 
#     Examples:
#         >>> from onix.utilities import sanitize_string
#         >>> print(sanitize_string('Hello World'))
#         helloworld
# 
#     """
#     return re.compile(r'[^A-Za-z0-9]').sub('', input_string).lower()


# Path: onix/scripts/generate_forme_change_rules.py
import json
import re
from collections import defaultdict
from future.utils import iteritems
from onix import scrapers
from onix.utilities import sanitize_string

"""Generate the config file that lists which Pokemon can change formes. While
we're at it, generate the species lookup dictionary that handles prettifying
species names, labelling forme-concatenations and combining appearance-only
formes"""






def generate_single_forme_species_lookup():
    """
    Generate the species lookup for single formes (that is, combine
    appearance-only formes)

    Returns:
        dict :
            Starting point for `species_lookup` dictionary (that is, without
            forme-concatenations)
    """
    try:
        pokedex = json.load(open('.psdata/pokedex.json'))
    except IOError:

        pokedex = scrapers.scrape_battle_pokedex()