Coder Social home page Coder Social logo

adamayoung / tmdb Goto Github PK

View Code? Open in Web Editor NEW
101.0 5.0 29.0 1.21 MB

The Movie Database Swift Package

Home Page: https://adamayoung.github.io/TMDb/documentation/tmdb

License: Apache License 2.0

Swift 98.04% Markdown 1.56% Makefile 0.40%
swift swiftpm tmdb themoviedatabase movie actors films movies reviews tv

tmdb's Introduction

TMDb - The Movie Database

CI Integration CodeQL Documentation codecov

A Swift Package for The Movie Database (TMDb) https://www.themoviedb.org

Requirements

  • Swift 5.9+
  • OS
    • macOS 13+
    • iOS 16+
    • watchOS 9+
    • tvOS 16+
    • visionOS 1+
    • Windows
    • Linux

Installation

Add the TMDb package as a dependency to your Package.swift file, and add it as a dependency to your target.

// swift-tools-version:5.9

import PackageDescription

let package = Package(
  name: "MyProject",

  dependencies: [
    .package(url: "https://github.com/adamayoung/TMDb.git", from: "13.0.0")
  ],

  targets: [
    .target(name: "MyProject", dependencies: ["TMDb"])
  ]
)

Xcode project

Add the TMDb package to your Project's Package dependencies.

Setup

Get an API Key

Create an API key from The Movie Database web site https://www.themoviedb.org/documentation/api.

Quick Start

let tmdbClient = TMDbClient(apiKey: "<your-tmdb-api-key>")

let moviesToDiscover = try await tmdbClient.discover.movies().results
let fightClub = try await tmdbClient.movies.details(forMovie: 550)

Documentation

Documentation and examples of usage can be found at https://adamayoung.github.io/TMDb/documentation/tmdb/

Development

Prerequisites

Install homebrew and the follow formulae

brew install swiftlint swiftformat markdownlint xcbeautify

Before submitting a PR

Unit and Integration Tests

Ensure all new code is covered by unit tests. If any new methods are added to services that make calls to TMDb API endpoints, ensure there are integration tests covering these.

Coding Style

Coding style is enforced by swiftlint and swiftformat.

Use the following command to lint the codebase:

make lint

To format the codebase use:

make format

DocC Documentation

Ensure all public classes, structs, properties and methods are commented

The DocC documentation can be built and hosted locally by

make preview-docs

See DocC | Apple Developer Documentation for more details.

CI Checks

Before submitting a PR, ensure all CI checks will pass:

make ci

CI checks are made up of the follow tasks:

make lint
make lint-markddown
make test
make test-ios
make test-watchos
make test-tvos
make test-visionos
make test-linux
make integration-test
make build-release
make build-docs

In order to run integration tests the following environment variables need to be set.

  • TMDB_API_KEY - Your TMDb API key
  • TMDB_USERNAME - Your TMDb username
  • TMDB_PASSWORD - Your TMDB password

If these environment variables aren't set then integration tests are skipped when not using make.

Running unit tests on Linux requires Docker to be running.

References

License

This library is licensed under the Apache License 2.0. See LICENSE for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.