{"id":16487164,"url":"https://github.com/phalt/swapi-python","last_synced_at":"2025-04-07T18:14:22.534Z","repository":{"id":24724020,"uuid":"28136077","full_name":"phalt/swapi-python","owner":"phalt","description":"The Python helper library for swapi.co","archived":false,"fork":false,"pushed_at":"2022-12-26T20:15:25.000Z","size":40,"stargazers_count":146,"open_issues_count":11,"forks_count":43,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-06T23:42:36.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"swapi.co","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phalt.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-17T12:19:36.000Z","updated_at":"2025-03-28T12:48:01.000Z","dependencies_parsed_at":"2023-01-14T01:29:48.639Z","dependency_job_id":null,"html_url":"https://github.com/phalt/swapi-python","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalt%2Fswapi-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalt%2Fswapi-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalt%2Fswapi-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalt%2Fswapi-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phalt","download_url":"https://codeload.github.com/phalt/swapi-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704571,"owners_count":20982298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T13:32:57.807Z","updated_at":"2025-04-07T18:14:22.511Z","avatar_url":"https://github.com/phalt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"===============================\nswapi-python\n===============================\n\n.. image:: https://badge.fury.io/py/swapi.png\n    :target: http://badge.fury.io/py/swapi\n\n.. image:: https://travis-ci.org/phalt/swapi-python.png?branch=master\n        :target: https://travis-ci.org/phalt/swapi-python\n\n.. image:: https://pypip.in/d/swapi/badge.png\n        :target: https://pypi.python.org/pypi/swapi\n\n\nA Python helper library for swapi.co - the Star Wars API\n\nNOTE: Tests will run against hosted API as opposed to data from github repo\n\n* Free software: BSD license\n* Documentation: https://swapi-python.readthedocs.org.\n\n============\nInstallation\n============\n\nAt the command line::\n\n    $ pip install swapi\n\nBasic Usage\n========\n\nTo use swapi-python in a project::\n\n    import swapi\n\nAll resources are accessible through the top-level ``get_resource()`` methods::\n\n    luke = swapi.get_person(1)\n    tatooine = swapi.get_planet(1)\n\nMethods\n=======\n\nThese are the top-level methods you can use to get resources from swapi.co. To learn more about the models and objects that are returned, see the ``models`` page.\n\nget_person(id)\n------------\n\nReturn a single ``Person`` resource.\n\nExample::\n\n    swapi.get_person(1)\n    \u003e\u003e\u003e \u003cPerson - Luke Skywalker\u003e\n\n\nget_planet(id)\n------------\n\nReturn a single ``Planet`` resource.\n\nExample::\n\n    swapi.get_planet(1)\n    \u003e\u003e\u003e \u003cPlanet - Tatooine\u003e\n\n\nget_starship(id)\n------------\n\nReturn a single ``Starship`` resource.\n\nExample::\n\n    swapi.get_starship(6)\n    \u003e\u003e\u003e \u003cStarship - Death Star\u003e\n\n\nget_vehicle(id)\n------------\n\nReturn a single ``Vehicle`` resource.\n\nExample::\n\n    swapi.get_vehicle(4)\n    \u003e\u003e\u003e \u003cVehicle - Sand Crawler\u003e\n\n\nget_film(id)\n------------\n\nReturn a single ``Film`` resource.\n\nExample::\n\n    swapi.get_film(1)\n    \u003e\u003e\u003e \u003cFilm - A New Hope\u003e\n\n\nget_all(\"resource\")\n------------\n\nReturn a ``QuerySet`` containing all the items in a single resource. See the ```models``` page for more information on the models used in swapi-python.\n\nExample::\n\n    swapi.get_all(\"films\")\n    \u003e\u003e\u003e \u003cFilmQuerySet - 6\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalt%2Fswapi-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphalt%2Fswapi-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalt%2Fswapi-python/lists"}