GithubHelp home page GithubHelp logo

adrianhrb / space_api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.61 MB

Repo dedicated to develop an API REST with Django for some things about space as missions or astronauts.

License: MIT License

Python 96.77% Just 3.23%
api api-rest astronauts django django-rest-framework moon python space

space_api's Introduction

Space Missions and Astronauts API REST πŸͺ

An API REST about space missions and astronauts

Image from Unplash

This project is an API REST with django (using django-rest-framework) about all Space missions and Astronauts that have been in space from 1957 to 2023. In this Readme you will find an explanation, some examples and the endpoints to make queries.

Note

The project is not deployed yet so you canΒ΄t use it whithout running the project on your local machine

Starting πŸš€

This section will help you to have a copy of the project in your local computer in case you want to work, change or test something

Installation and requirements πŸ”§

You can check requirements of the project on the requirements.txt file

Because the project will be done with Django-Python, we will need a Python Virtual Enviroment to install all dependencies. You can run in a terminal the following commands:

$ python -m venv .venv --prompt mysite
$ source .venv/bin/activate
$ pip install -r requirements.txt

If something goes wrong make sure you have Python installed or or else try to launch the command indicating the version of Python:

$ python3.X -m venv .venv --prompt mysite

Tip

In case of doubts you can see the documentation

Some functionalities will involve the use of sensitive information, so we will use a .env file for this purpose. This file must be out of version control so you will need to create one. In the project (mostly in the settings.py file) there will be calls to a config function of the prettyconf library, all these calls are the information that the .env file must contain.

To streamline some repetitive processes on terminal we are using Justfile, a handy way to run and save commands. For example, in case of make the migrations of an app in django, instead of using python manage.py makemigrations app we are using just makemigrations app

API endpoints πŸ“©

All endpoints are Insensitive Case, so looking for NASA or nasa will retrieve same JSON

Endpoints are build with __icontains method, so you can use urls whithout writting full names.

The API response is in JSON format. You have the following endpoints:

  • /api/missions/ -> Retrieve all missions from database
  • /api/missions/success/ -> Retrieve all successfull missions
  • /api/missions/unsuccess/ -> Retrieve all unsuccessfull missions
  • /api/missions/1(pk)/ -> Retrieve a single mission looking by Id, in this example, mission with id 1
  • /api/missions/company/Nasa(company_name) -> Retrieve all missions by company name, in this example, all missions made by company Nasa
  • /api/missions/name/Sputnik(mission_name) -> Retrieve all missions by mission name, in this example, all missiones named Sputnik
  • /api/missions/rocket/Falcon1(rocket_name) -> Retrieve all missions by rocket name, in this example, all missions made by Falcon rocker
  • /api/missions/location/Florida(location_name) -> Retrieve all missions by location name, in this example, all mission launched from Florida
  • /api/astronauts/ -> Retrieve all astronauts
  • /api/astronauts/1(pk) -> Retrieve a single astronaut by id, in this example, astronaut with id 1.
  • /api/astronauts/nationality/Soviet(nationality) -> Retrieve astronauts by their nationality, in this example, all the Soviet astronauts
  • /api/astronauts/name/Armstrong(name) -> Retrieve astronauts by theit name, in this example, all astronauts with surname Armstrong
  • /api/astronauts/mission/Gemini(name) -> Retrieve astronauts by mission name, in this example, all astronauts that went to the space in a mission with name Gemini

Important

Base url will be http://127.0.0.1:8000 if you are running project locally. This will be updated with the deployment.

Contribution πŸ–‡οΈ

Feel free to contribute to the project in any way you want <3. I will be happy to receive help from experienced people to correct mistakes and learn because this is one of my firsts API REST with django. 😊

License πŸ“„

The project is under MIT License - you can see LICENSE for more details


⌨️ with ❀️ by AdriÑn ✌️

space_api's People

Contributors

adrianhrb avatar

Watchers

 avatar

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.