dejan


Namedejan JSON
Version 0.2.9.1 PyPI version JSON
download
home_pagehttps://github.com/dejanmarketing/dejan
SummaryA collection of utilities for various tasks, including SEO tools and data processing.
upload_time2024-08-05 01:42:06
maintainerNone
docs_urlNone
authorDejanSEO
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Dejan: SEO Machine Learning Utilities

Dejan is a growing collection of SEO-related machine learning utilities designed to assist with various tasks in the field of search engine optimization. This repository will be continuously updated with new tools and features aimed at helping SEO professionals streamline their workflows using advanced ML techniques.

### Installation

You can install the package using pip:

```bash
pip install dejan
```

### Current Utilities

#### roo

**Purpose:** Fetches and processes data from the Algoroo API, providing insights into search engine fluctuations.

**Search Engine Options:**

* 2: Google.com (Desktop)
* 3: Google.com.au (Desktop)
* 4: Google.com (Mobile)
* 5: Google.com.au (Mobile)

**Output:** The data can be returned either as a raw JSON object or as a pandas DataFrame for further analysis.

**Example Usage:**

```python
from dejan import roo

def main():
    # Mapping of search engines to their corresponding identifiers
    search_engines = {
        2: "google.com/desktop",
        3: "google.com.au/desktop",
        4: "google.com/mobile",
        5: "google.com.au/mobile"
    }
    
    # Choose the search engine by setting the appropriate identifier
    search_engine = 2  # Change this number to select a different search engine:
                       # 2: google.com/desktop
                       # 3: google.com.au/desktop
                       # 4: google.com/mobile
                       # 5: google.com.au/mobile
    
    # Fetch data as a pandas DataFrame
    roo_data = roo.get_roo(search_engine, as_dataframe=True)
    
    # Display the first few rows of the DataFrame
    print(f"Data for search engine {search_engine} ({search_engines[search_engine]}):")
    print(roo_data.head())

if __name__ == "__main__":
    main()

```

#### linkbert

**Purpose:** Uses the LinkBERT model to predict link tokens in the provided text, useful for analyzing link placement within content.

**Grouping Modes:**

* `subtoken`: Returns individual subword tokens classified as links.
* `token`: Merges any subtokens into whole tokens (words).
* `phrase`: Groups predictions into phrases, treating the entire phrase as a link if any part of it is classified as a link.

**Example Usage:**

```python
from dejan import linkbert

def main():
    # Initialize the LinkBERTInference model
    model = linkbert.LinkBERTInference()

    # Sample text for prediction
    text = "LinkBERT is a model developed by Dejan Marketing designed to predict natural link placement within web content."

    print("Input Text:")
    print(text)
    print("-" * 50)

    # Group by subtoken
    links_subtoken = model.predict_link_tokens(text, group="subtoken")
    print(f"Predicted link tokens (subtoken): {links_subtoken}")

    # Group by token
    links_token = model.predict_link_tokens(text, group="token")
    print(f"Predicted link tokens (token): {links_token}")

    # Group by phrase
    links_phrase = model.predict_link_tokens(text, group="phrase")
    print(f"Predicted link tokens (phrase): {links_phrase}")

if __name__ == "__main__":
    main()
```

#### dirtree

**Purpose:** Generates an ASCII representation of the directory tree structure from any given root directory, including all subdirectories and files.

**Usage:** This tool can be particularly useful for visualizing file structures in complex projects, making it easier to manage and navigate large SEO datasets.

**Example Usage:**

```python
from dejan import generate_ascii_tree

# Generate and print the directory tree for the current directory
generate_ascii_tree()
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dejanmarketing/dejan",
    "name": "dejan",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "DejanSEO",
    "author_email": "enquiries@dejanmarketing.com",
    "download_url": "https://files.pythonhosted.org/packages/b9/90/62ec598afd616cce4250443e9a6c359aab8de4a13fa3d6a5857f9d1a2e4e/dejan-0.2.9.1.tar.gz",
    "platform": null,
    "description": "## Dejan: SEO Machine Learning Utilities\r\n\r\nDejan is a growing collection of SEO-related machine learning utilities designed to assist with various tasks in the field of search engine optimization. This repository will be continuously updated with new tools and features aimed at helping SEO professionals streamline their workflows using advanced ML techniques.\r\n\r\n### Installation\r\n\r\nYou can install the package using pip:\r\n\r\n```bash\r\npip install dejan\r\n```\r\n\r\n### Current Utilities\r\n\r\n#### roo\r\n\r\n**Purpose:** Fetches and processes data from the Algoroo API, providing insights into search engine fluctuations.\r\n\r\n**Search Engine Options:**\r\n\r\n* 2: Google.com (Desktop)\r\n* 3: Google.com.au (Desktop)\r\n* 4: Google.com (Mobile)\r\n* 5: Google.com.au (Mobile)\r\n\r\n**Output:** The data can be returned either as a raw JSON object or as a pandas DataFrame for further analysis.\r\n\r\n**Example Usage:**\r\n\r\n```python\r\nfrom dejan import roo\r\n\r\ndef main():\r\n    # Mapping of search engines to their corresponding identifiers\r\n    search_engines = {\r\n        2: \"google.com/desktop\",\r\n        3: \"google.com.au/desktop\",\r\n        4: \"google.com/mobile\",\r\n        5: \"google.com.au/mobile\"\r\n    }\r\n    \r\n    # Choose the search engine by setting the appropriate identifier\r\n    search_engine = 2  # Change this number to select a different search engine:\r\n                       # 2: google.com/desktop\r\n                       # 3: google.com.au/desktop\r\n                       # 4: google.com/mobile\r\n                       # 5: google.com.au/mobile\r\n    \r\n    # Fetch data as a pandas DataFrame\r\n    roo_data = roo.get_roo(search_engine, as_dataframe=True)\r\n    \r\n    # Display the first few rows of the DataFrame\r\n    print(f\"Data for search engine {search_engine} ({search_engines[search_engine]}):\")\r\n    print(roo_data.head())\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n\r\n```\r\n\r\n#### linkbert\r\n\r\n**Purpose:** Uses the LinkBERT model to predict link tokens in the provided text, useful for analyzing link placement within content.\r\n\r\n**Grouping Modes:**\r\n\r\n* `subtoken`: Returns individual subword tokens classified as links.\r\n* `token`: Merges any subtokens into whole tokens (words).\r\n* `phrase`: Groups predictions into phrases, treating the entire phrase as a link if any part of it is classified as a link.\r\n\r\n**Example Usage:**\r\n\r\n```python\r\nfrom dejan import linkbert\r\n\r\ndef main():\r\n    # Initialize the LinkBERTInference model\r\n    model = linkbert.LinkBERTInference()\r\n\r\n    # Sample text for prediction\r\n    text = \"LinkBERT is a model developed by Dejan Marketing designed to predict natural link placement within web content.\"\r\n\r\n    print(\"Input Text:\")\r\n    print(text)\r\n    print(\"-\" * 50)\r\n\r\n    # Group by subtoken\r\n    links_subtoken = model.predict_link_tokens(text, group=\"subtoken\")\r\n    print(f\"Predicted link tokens (subtoken): {links_subtoken}\")\r\n\r\n    # Group by token\r\n    links_token = model.predict_link_tokens(text, group=\"token\")\r\n    print(f\"Predicted link tokens (token): {links_token}\")\r\n\r\n    # Group by phrase\r\n    links_phrase = model.predict_link_tokens(text, group=\"phrase\")\r\n    print(f\"Predicted link tokens (phrase): {links_phrase}\")\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n```\r\n\r\n#### dirtree\r\n\r\n**Purpose:** Generates an ASCII representation of the directory tree structure from any given root directory, including all subdirectories and files.\r\n\r\n**Usage:** This tool can be particularly useful for visualizing file structures in complex projects, making it easier to manage and navigate large SEO datasets.\r\n\r\n**Example Usage:**\r\n\r\n```python\r\nfrom dejan import generate_ascii_tree\r\n\r\n# Generate and print the directory tree for the current directory\r\ngenerate_ascii_tree()\r\n```\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A collection of utilities for various tasks, including SEO tools and data processing.",
    "version": "0.2.9.1",
    "project_urls": {
        "Homepage": "https://github.com/dejanmarketing/dejan"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b336c6a434cfe926b6024cc57d092c83ec38542d9dafceb1c0ccf77fd6e189c8",
                "md5": "cf8032fb45609dd329a392c9034d58d3",
                "sha256": "2689eebfb49dc837c038572eb0f2b2f6c9a92ceb2637e90d48140da8ff6a9609"
            },
            "downloads": -1,
            "filename": "dejan-0.2.9.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cf8032fb45609dd329a392c9034d58d3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 10041,
            "upload_time": "2024-08-05T01:42:05",
            "upload_time_iso_8601": "2024-08-05T01:42:05.373343Z",
            "url": "https://files.pythonhosted.org/packages/b3/36/c6a434cfe926b6024cc57d092c83ec38542d9dafceb1c0ccf77fd6e189c8/dejan-0.2.9.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b99062ec598afd616cce4250443e9a6c359aab8de4a13fa3d6a5857f9d1a2e4e",
                "md5": "455c5a05eb33df8daaa389bd104cd0d5",
                "sha256": "d17b4950153d79ab1fc59af1f8d9de4b23cff6efd536fb7607357cc3445f4723"
            },
            "downloads": -1,
            "filename": "dejan-0.2.9.1.tar.gz",
            "has_sig": false,
            "md5_digest": "455c5a05eb33df8daaa389bd104cd0d5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 9081,
            "upload_time": "2024-08-05T01:42:06",
            "upload_time_iso_8601": "2024-08-05T01:42:06.851295Z",
            "url": "https://files.pythonhosted.org/packages/b9/90/62ec598afd616cce4250443e9a6c359aab8de4a13fa3d6a5857f9d1a2e4e/dejan-0.2.9.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-05 01:42:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dejanmarketing",
    "github_project": "dejan",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "dejan"
}
        
Elapsed time: 0.28082s