boxoffice-api


Nameboxoffice-api JSON
Version 1.2.2 PyPI version JSON
download
home_pagehttps://github.com/Stink-Po/boxoffice_api
SummaryUnofficial Python API for Box Office Mojo
upload_time2024-10-19 04:42:33
maintainerNone
docs_urlNone
authorPourya Mohamadi
requires_pythonNone
licenseNone
keywords python movie movies boxoffice_api box office scraping
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### **Unofficial Python API for Box Office Mojo**
### **Please give package a start if you use it in your projects**
**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": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "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/e2/90/ca6346d7be19804430bae8a0b4a1dc23f7baca7464f39ddc85b6f316bc07/boxoffice_api-1.2.2.tar.gz",
    "platform": null,
    "description": "### **Unofficial Python API for Box Office Mojo**\r\n### **Please give package a start if you use it in your projects**\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": null,
    "summary": "Unofficial Python API for Box Office Mojo",
    "version": "1.2.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": "e31706120b5a6179a964a1f79b49cca0d44fae5be66f30d10e424b933d2e349c",
                "md5": "d5bc39a573c26679b90f0dabd841135c",
                "sha256": "72575c6d6b0317a87465bfb1ace2ca742202b6ec144a49ee5a92c37111d00c04"
            },
            "downloads": -1,
            "filename": "boxoffice_api-1.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d5bc39a573c26679b90f0dabd841135c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7315,
            "upload_time": "2024-10-19T04:42:31",
            "upload_time_iso_8601": "2024-10-19T04:42:31.835220Z",
            "url": "https://files.pythonhosted.org/packages/e3/17/06120b5a6179a964a1f79b49cca0d44fae5be66f30d10e424b933d2e349c/boxoffice_api-1.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e290ca6346d7be19804430bae8a0b4a1dc23f7baca7464f39ddc85b6f316bc07",
                "md5": "a58c02f036daa0690c6645af18e42972",
                "sha256": "356e728d05240e84d1a154ce19d67941b8e47d18b84fefe6a8268455be61afee"
            },
            "downloads": -1,
            "filename": "boxoffice_api-1.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a58c02f036daa0690c6645af18e42972",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6319,
            "upload_time": "2024-10-19T04:42:33",
            "upload_time_iso_8601": "2024-10-19T04:42:33.955759Z",
            "url": "https://files.pythonhosted.org/packages/e2/90/ca6346d7be19804430bae8a0b4a1dc23f7baca7464f39ddc85b6f316bc07/boxoffice_api-1.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-19 04:42:33",
    "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": [],
    "lcname": "boxoffice-api"
}
        
Elapsed time: 4.53701s