boxoffice-api


Nameboxoffice-api JSON
Version 1.2 PyPI version JSON
download
home_pagehttps://github.com/Stink-Po/boxoffice_api
SummaryUnofficial Python API for Box Office Mojo
upload_time2023-10-28 18:34:13
maintainer
docs_urlNone
authorPourya Mohamadi
requires_python
license
keywords python movie movies boxoffice_api box office scraping
VCS
bugtrack_url
requirements beautifulsoup4 bs4 requests
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### **Unofficial Python API for Box Office Mojo**

**update Note**
you can now get a panda Dataframe as output

This Python package allows you to retrieve box office information from Box Office Mojo. It provides data on daily, weekly, monthly, seasonal, quarterly, and yearly box office performance for movies. Additionally, it can fetch additional movie details like posters, descriptions, directors, and more from OMDb API when an API key is provided.

**Installation**

You can install this package using pip:

    pip install boxoffice_api

### Usage

Here's how you can use this package to retrieve box office information:
if You want to have more information from Movies, you can get free API key From "https://www.omdbapi.com/"
free account have 1000 daily requests we highly recommend if you want to use this package for collecting data and don't want to use thing like movie posters etc . don't use the API key

    from boxoffice_api import BoxOffice 

**if you have API Key**  

    box_office = BoxOffice(api_key="your_api_key") # Get daily box office information for a specific date 

**if you want to use the package without API Key**

    box_office = BoxOffice()

**if you want to use the package without API key and get panda Dataframe as output**


    box_office = BoxOffice(outputformat="DF")



#### **Getting Information**
    daily_data = box_office.get_daily("2023-09-21") # Get weekend box office information for a specific year and week 
    weekend_data = box_office.get_weekend(year=2023, week=39) # Get weekly box office information for a specific year and week 
    weekly_data = box_office.get_weekly(year=2023, week=39) # Get monthly box office information for a specific year and month 
    monthly_data = box_office.get_monthly(year=2023, month=9) # Get seasonal box office information for a specific year and season 
    seasonal_data = box_office.get_season(year=2023, season="fall") # Get quarterly box office information for a specific quarter and year 
    quarterly_data = box_office.get_quarterly(quarterly=3, year=2023) # Get yearly box office information for a specific year 
    yearly_data = box_office.get_yearly(year=2023) # Access the data as a list of dictionaries for movie in daily_data: print(movie)

Please replace "your_api_key" with your actual OMDb API key if you want to fetch additional movie details.

### Documentation

BoxOffice(api_key=None): Initializes the BoxOffice class with an optional OMDb API key.

get_daily(date): Retrieve daily box office information for a specific date.

get_weekend(year, week): Retrieves weekend box office information for a specific year and week.

get_weekly(year, week): Retrieve weekly box office information for a specific year and week.

get_monthly(year, month): Retrieve monthly box office information for a specific year and month.

get_season(year, season): Retrieve seasonal box office information for a specific year and season.

get_quarterly(quarterly, year): Retrieves quarterly box office information for a specific quarter and year.

get_yearly(year): Retrieves yearly box office information for a specific year.

**Output Example:**

    print(daily_records[0])
    >>>
    {
        'rank': '1',
        'yesterday rank': '1',
        'title': 'Thor: Love and Thunder',
        'daily gross': '$14,354,321',
        'gross change daily': '-22.4%',
        'gross change week': '-55.8%',
        'theaters': '4,375',
        'per theaters avg gross': '$3,280',
        'gross to date': '$233,903,308',
        'number of days release': '10',
        'Distributor': 'Walt Disney Studios Motion Pictures'
    }

### Dependencies

This package relies on the following Python libraries:

    BeautifulSoup
    requests



Please make sure to install these dependencies before using the package.

### Note

When using an OMDb API key, you can access additional movie details such as movie posters, descriptions, directors, actors, and more.

The package may make multiple requests to fetch movie details, so be mindful of your API limits, especially if you have a free API key.

Ensure you have a stable internet connection when making requests to Box Office Mojo and OMDb API.

Author

This Python package was created by Pourya Mohamadi. Feel free to contact fresh.pourya@gmail.com

    


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Stink-Po/boxoffice_api",
    "name": "boxoffice-api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,movie,movies,boxoffice_api,box office,scraping",
    "author": "Pourya Mohamadi",
    "author_email": "fresh.pourya@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f9/2e/9282df50529d035f33a9b4364c7a5ece79488fc791945cc66d85925fb719/boxoffice_api-1.2.tar.gz",
    "platform": null,
    "description": "### **Unofficial Python API for Box Office Mojo**\r\n\r\n**update Note**\r\nyou can now get a panda Dataframe as output\r\n\r\nThis Python package allows you to retrieve box office information from Box Office Mojo. It provides data on daily, weekly, monthly, seasonal, quarterly, and yearly box office performance for movies. Additionally, it can fetch additional movie details like posters, descriptions, directors, and more from OMDb API when an API key is provided.\r\n\r\n**Installation**\r\n\r\nYou can install this package using pip:\r\n\r\n    pip install boxoffice_api\r\n\r\n### Usage\r\n\r\nHere's how you can use this package to retrieve box office information:\r\nif You want to have more information from Movies, you can get free API key From \"https://www.omdbapi.com/\"\r\nfree account have 1000 daily requests we highly recommend if you want to use this package for collecting data and don't want to use thing like movie posters etc . don't use the API key\r\n\r\n    from boxoffice_api import BoxOffice \r\n\r\n**if you have API Key**  \r\n\r\n    box_office = BoxOffice(api_key=\"your_api_key\") # Get daily box office information for a specific date \r\n\r\n**if you want to use the package without API Key**\r\n\r\n    box_office = BoxOffice()\r\n\r\n**if you want to use the package without API key and get panda Dataframe as output**\r\n\r\n\r\n    box_office = BoxOffice(outputformat=\"DF\")\r\n\r\n\r\n\r\n#### **Getting Information**\r\n    daily_data = box_office.get_daily(\"2023-09-21\") # Get weekend box office information for a specific year and week \r\n    weekend_data = box_office.get_weekend(year=2023, week=39) # Get weekly box office information for a specific year and week \r\n    weekly_data = box_office.get_weekly(year=2023, week=39) # Get monthly box office information for a specific year and month \r\n    monthly_data = box_office.get_monthly(year=2023, month=9) # Get seasonal box office information for a specific year and season \r\n    seasonal_data = box_office.get_season(year=2023, season=\"fall\") # Get quarterly box office information for a specific quarter and year \r\n    quarterly_data = box_office.get_quarterly(quarterly=3, year=2023) # Get yearly box office information for a specific year \r\n    yearly_data = box_office.get_yearly(year=2023) # Access the data as a list of dictionaries for movie in daily_data: print(movie)\r\n\r\nPlease replace \"your_api_key\" with your actual OMDb API key if you want to fetch additional movie details.\r\n\r\n### Documentation\r\n\r\nBoxOffice(api_key=None): Initializes the BoxOffice class with an optional OMDb API key.\r\n\r\nget_daily(date): Retrieve daily box office information for a specific date.\r\n\r\nget_weekend(year, week): Retrieves weekend box office information for a specific year and week.\r\n\r\nget_weekly(year, week): Retrieve weekly box office information for a specific year and week.\r\n\r\nget_monthly(year, month): Retrieve monthly box office information for a specific year and month.\r\n\r\nget_season(year, season): Retrieve seasonal box office information for a specific year and season.\r\n\r\nget_quarterly(quarterly, year): Retrieves quarterly box office information for a specific quarter and year.\r\n\r\nget_yearly(year): Retrieves yearly box office information for a specific year.\r\n\r\n**Output Example:**\r\n\r\n    print(daily_records[0])\r\n    >>>\r\n    {\r\n        'rank': '1',\r\n        'yesterday rank': '1',\r\n        'title': 'Thor: Love and Thunder',\r\n        'daily gross': '$14,354,321',\r\n        'gross change daily': '-22.4%',\r\n        'gross change week': '-55.8%',\r\n        'theaters': '4,375',\r\n        'per theaters avg gross': '$3,280',\r\n        'gross to date': '$233,903,308',\r\n        'number of days release': '10',\r\n        'Distributor': 'Walt Disney Studios Motion Pictures'\r\n    }\r\n\r\n### Dependencies\r\n\r\nThis package relies on the following Python libraries:\r\n\r\n    BeautifulSoup\r\n    requests\r\n\r\n\r\n\r\nPlease make sure to install these dependencies before using the package.\r\n\r\n### Note\r\n\r\nWhen using an OMDb API key, you can access additional movie details such as movie posters, descriptions, directors, actors, and more.\r\n\r\nThe package may make multiple requests to fetch movie details, so be mindful of your API limits, especially if you have a free API key.\r\n\r\nEnsure you have a stable internet connection when making requests to Box Office Mojo and OMDb API.\r\n\r\nAuthor\r\n\r\nThis Python package was created by Pourya Mohamadi. Feel free to contact fresh.pourya@gmail.com\r\n\r\n    \r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Unofficial Python API for Box Office Mojo",
    "version": "1.2",
    "project_urls": {
        "Homepage": "https://github.com/Stink-Po/boxoffice_api"
    },
    "split_keywords": [
        "python",
        "movie",
        "movies",
        "boxoffice_api",
        "box office",
        "scraping"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2ebd70c6badc4d441f4c7bce0caf1f1837129f09f1f2d2a72c7bf43aea730782",
                "md5": "b71bfc2aa413af8fdaa59473c15720d3",
                "sha256": "f6f2f2ee229d860e40bdcf2b9dde08b54c268a4b404d373f8d3e77fc9ca044e2"
            },
            "downloads": -1,
            "filename": "boxoffice_api-1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b71bfc2aa413af8fdaa59473c15720d3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6994,
            "upload_time": "2023-10-28T18:34:12",
            "upload_time_iso_8601": "2023-10-28T18:34:12.017958Z",
            "url": "https://files.pythonhosted.org/packages/2e/bd/70c6badc4d441f4c7bce0caf1f1837129f09f1f2d2a72c7bf43aea730782/boxoffice_api-1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f92e9282df50529d035f33a9b4364c7a5ece79488fc791945cc66d85925fb719",
                "md5": "b9d7c1e0521c69613377398ce92fde1c",
                "sha256": "b95cddd6f821a30692c09e3913309f8bb2258861f4457870c0fd501b6779f2be"
            },
            "downloads": -1,
            "filename": "boxoffice_api-1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b9d7c1e0521c69613377398ce92fde1c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6298,
            "upload_time": "2023-10-28T18:34:13",
            "upload_time_iso_8601": "2023-10-28T18:34:13.785326Z",
            "url": "https://files.pythonhosted.org/packages/f9/2e/9282df50529d035f33a9b4364c7a5ece79488fc791945cc66d85925fb719/boxoffice_api-1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-28 18:34:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Stink-Po",
    "github_project": "boxoffice_api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "beautifulsoup4",
            "specs": [
                [
                    "==",
                    "4.12.2"
                ]
            ]
        },
        {
            "name": "bs4",
            "specs": [
                [
                    "==",
                    "0.0.1"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.31.0"
                ]
            ]
        }
    ],
    "lcname": "boxoffice-api"
}
        
Elapsed time: 0.13095s