Example #1
0
    return (
        "acquisition/retained_installers" in filepath
        and config.PLAY_STORE_APP_ID in filepath
        and not filepath.endswith("/")
        and report_download_condition(export_from, filepath)
    )


def report_download_condition(export_from, file_name):
    return export_from is None or get_play_store_report_date(
        file_name
    ) >= export_from - timedelta(days=30)


def get_play_store_report_date(name):
    try:
        return datetime.strptime(
            next((part for part in name.split("_") if part.isdigit())), "%Y%m"
        )
    except StopIteration:
        logger.info(
            f"File {name} do not have assumed format."
            "Update get_play_store_report_date function to properly extract date"
        )
        raise ValueError


if __name__ == "__main__":
    func.run_script("Play Store", run)

Example #2
0
import logging
from datetime import datetime, timedelta

from exporter import config
from exporter.utils import func
from exporter.app_follow import export

logger = logging.getLogger(__name__)


def run(export_from, export_to):
    exporter = export.AppFollowExport()
    logger.info("Getting ASO Search data")
    export.AppFollowAsoSearchExecutor(exporter).execute()
    logger.info("Getting Keywords data")
    export.AppFollowKeywordExecutor(exporter).execute(export_from, export_to)
    logger.info("Getting Rating data")
    export.AppFollowRatingExecutor(exporter).execute(export_from, export_to)


if __name__ == "__main__":
    func.run_script("App Follow", run)

Example #3
0
        exporter = export.AppStoreExport()
        exporter.proccessed_data(data)
        exporter.write_exports()
        exporter.writer.upload_files()


def build_arguments(export_from, export_to):
    options = {
        "username": config.APP_STORE_USERNAME,
        "password": config.APP_STORE_PASSWORD,
        "export_from": export_from.strftime(config.DATE_FORMAT),
        "export_to": export_to.strftime(config.DATE_FORMAT),
        "raw_output": APP_STORE_RAW_DATA_FILE,
        "certificates": config.SEARCH_ADS_CERTIFICATES,
        "app_id": config.APP_STORE_APP_ID,
        "search_ads_only": 1 if config.SEARCH_ADS_ONLY else 0,
    }
    return """--username '{username}' \
              --password '{password}' \
              --id '{app_id}' \
              --from '{export_from}' \
              --to '{export_to}' \
              --output '{raw_output}' \
              --certificates '{certificates}' \
              --search_ads_only '{search_ads_only}'
           """.format(**options)


if __name__ == "__main__":
    func.run_script("App Store and Search Ads", run)
Example #4
0
import logging
from datetime import datetime, timedelta

from exporter import config
from exporter.utils import func
from exporter.apps_flyer import export

logger = logging.getLogger(__name__)


def run(export_from, export_to):
    exporter = export.AppsFlyerExport()
    executor = export.AppsFlyerExecutor(exporter)
    executor.execute(export_from, export_to)


if __name__ == "__main__":
    func.run_script("Apps Flyer", run)

Example #5
0
from exporter.sensortower import export_versions
from exporter.sensortower import export_current_keywords

logger = logging.getLogger(__name__)


@decorators.retry(Exception, tries=config.TASK_TRIES, logger=logger)
def run(export_from, export_to):
    exporter = export.SensorTowerExport()
    logger.info("Getting ratings reports")
    export_ratings.export_ratings(exporter, export_from, export_to)
    logger.info("Getting reviews reports")
    export_reviews.export_reviews(exporter, export_from, export_to)
    logger.info("Getting rankings reports")
    export_rankings.export_rankings(exporter, export_from, export_to)
    logger.info("Getting versions reports")
    export_versions.export_versions(exporter)
    logger.info("Getting featured apps reports")
    export_featured_apps.export_featured_apps(exporter, export_from, export_to)
    logger.info("Getting featured creatives reports")
    export_featured_creatives.export_featured_creatives(
        exporter, export_from, export_to)
    logger.info("Getting featured today reports")
    export_featured_today.export_featured_today(exporter, export_from,
                                                export_to)
    logger.info(f"Sensortower API calls count: {exporter.request_counter}")


if __name__ == "__main__":
    func.run_script("Sensor Tower", run)