advertools

repository·master·Indexed 23 days ago

https://github.com/eliasdabbas/advertools

A Python productivity and analysis package for digital marketers to scale online marketing tasks. It provides tools for SEM campaign generation, SEO crawling, SERP analysis, and text/content mining. Key features include ad creation and parsing, XML sitemap and robots.txt conversion to CSV, server log analysis, reverse DNS lookup, and specialized submodules for Twitter and YouTube.

Tokens
28K
Snippets
43
Records
157
Agent score
80%

What's inside advertools

  1. Extract structured elements from text lists with advertools.extract

    master

    The advertools.extract module provides functions to identify and extract specific structured entities from lists of text. This is useful for analyzing social media content or SEO text to find patterns like hashtags, mentions, or specific linguistic structures.

    Available entities for extraction include:

    • Hashtags
    • Mentions
    • Numbers
    • Questions
    • Emojis

    Note: As this is an automated documentation reference, specific function signatures and parameter details are defined within the advertools.extract module members.

  2. Use the YouTube data API in advertools

    master
    The advertools.youtube module provides a Python interface for interacting with the YouTube Data API. It is designed to handle large-scale data extraction by allowing you to perform multiple GET requests and consolidate the responses into a single pandas DataFrame. It supports all available GET methods from the YouTube API.
  3. Use emoji search and regex functionality in advertools.emoji

    master
    The advertools.emoji module provides tools for working with emojis in Python, including a full emoji database, a specialized emoji regular expression, and search functionality. You can use this module to identify, count, or extract emojis from text strings.
  4. Create UTM encoded URLs programmatically with advertools.url_builders

    master
    The advertools.url_builders module provides tools to programmatically generate URLs with UTM (Urchin Tracking Module) parameters for online marketing campaigns. This ensures consistent tracking across different marketing channels by automating the encoding of campaign parameters like utm_source, utm_medium, utm_campaign, etc.
  5. Core concepts of advertools design

    master

    advertools is designed around two main principles to make it easy for digital marketers to use:

    1. Independent Functions: The package is a collection of independent functions. There are no complex custom data structures to learn. If you understand basic Python and the marketing task at hand, you can use the functions.
    2. UNIX Philosophy:
      • Do one thing and do it well: Each function has a specific purpose (e.g., extracting hashtags, crawling websites, or downloading sitemaps).
      • Work together: While functions are independent, they are designed to be used in pipelines for SEO, SEM, and social media analysis.
      • Universal Interface (DataFrames): Most functions return a pandas.DataFrame or a file that can be loaded into one. This allows you to immediately use the results with other data science tools like pandas, Plotly, or machine learning libraries.
  6. Discover advertools functions using naming conventions

    master

    advertools uses a consistent prefix-based naming convention for its functions. You can use IDE autocomplete to discover available tools by typing these prefixes:

    | Prefix | Purpose | | :--- | : | | kw_ | Keyword-related functions | | ad_ | Ad-related functions | | url_ | URL tracking and generation | | extract_ | Extracting entities from social media (mentions, hashtags, emoji, etc.) | | emoji_ | Emoji-related functions and objects | | twitter | Module for querying the Twitter API into a DataFrame | | youtube | Module for querying the YouTube Data API into a DataFrame | | crawlytics | Module for analyzing crawl data (compare, links, redirects, etc.) | | serp_ | Get Search Engine Results Pages (Google and YouTube) into a DataFrame | | crawl | Core function for SEO crawling | | *_to_df | Convenience functions for converting log files, XML sitemaps, robots.txt, and URL lists to DataFrames |

  7. Calculate word frequency and weighted word counts

    master

    The advertools.word_frequency module provides tools for performing text analysis and mining on lists of text. It allows you to calculate word counts on both an absolute basis (raw frequency) and a weighted basis.

    Weighted analysis is particularly useful when your text data is accompanied by descriptive statistics such as pageviews, sales, bounces, or sessions. By using these metrics as weights, you can determine which words are most influential or frequent relative to the importance of the text they appear in.

  8. Access advertools CLI help documentation

    master

    You can access the general documentation for the advertools CLI using the advertools command or its shorthand adv. To see the help menu for a specific command, append --help or -h to that command.

    # Get general help
    advertools --help
    adv -h
    
    # Get help for a specific command (e.g., sitemaps or crawl)
    advertools sitemaps --help
    adv crawl -h