Giter Club home page Giter Club logo

gian-sdk's Introduction

gollum LOTR SDK Design

This SDK will let developers search for information using THE ONE API. Developers can use this SDK to look up books, characters, quotes, and movies. The get method can get all or a specific object by id.

๐Ÿง™โ€โ™‚๏ธ Instructions:

These are the following steps to use this SDK:

โ–ซ๏ธ 1. Open your Comand Prompt

โ–ซ๏ธ 2. Go to the directory you would like to install the package.

โ–ซ๏ธ 3. Create a virtual environment: for Windows type:

py -m venv EnvironmentName

โ–ซ๏ธ 4. Activate the environment type:

EnvironmentName\Scripts\activate

โ–ซ๏ธ 5. Install requests in your environment: for Windows type:

pip install requests

โ–ซ๏ธ 6. Hurry! Now lets install the SDK package. type:

pip install Gian-lotr

โ–ซ๏ธ 7. Lets code some python type:

python

โ–ซ๏ธ 8. Cograts! Now lets import TestingClient type:

from Gian_lotr.rest import TestingClient

โ–ซ๏ธ 9. Lets create a client type:

client = TestingClient(location="lotr")

โ–ซ๏ธ 10. Let's see all the movies: type:

client.movie.get()

โ–ซ๏ธ 11. Lets find a movie by id type:

client.movie.get(object_id="5cd95395de30eff6ebccde56")

This SDK will let developers search for information using THE ONE API. Developers can use this SDK to look up books, characters, quotes, and movies. The get method can get all or a specific object by id.

๐ŸŒณ File Structure:

FolderInstalledGian-SDK\Lib\site-packages\Gian_lotr

Gian_lotr/
โ””โ”€โ”€ rest/
    โ””โ”€โ”€ book/
        โ”œโ”€โ”€ __init__.py
    โ””โ”€โ”€ character/
        โ”œโ”€โ”€ __init__.py
    โ””โ”€โ”€ movie/
        โ”œโ”€โ”€ __init__.py
    โ””โ”€โ”€ quote/
        โ”œโ”€โ”€ __init__.py
    โ””โ”€โ”€ __init__.py
       	

In the init for the rest folder, you will find a class() with a few methods. The purpose of this class is to create an object that can contain different information. This will come in handy when adding various API endpoints or filtering information. This file also contains an APIRequester class for different APIs and a PathBuilder class to create more complex Strings in the future.

The book, character, movie, and quote folder contain an init file as well. Each one creates an object of a different class.

๐Ÿน Details:

The first step is to create a client object with the name of the location of the API. At the moment "lotr" (https://the-one-api.dev/v2/) is the only API endpoint that is being used. However, this application is designed to add many APIs very easily.

Example: 

name of object           variable name 
  |      initialize class   |     name of API
            |               |      |
client = TestingClient(location="lotr")

Then what type of information is going to be retrieved such as a book or quote. After, add the get() or get(object_id="ID HERE") to find the right information.

Example: 

object      method 
  | location |          id
        |               |
client.movie.get(object_id="ID here") 

๐Ÿ—ก๏ธ Other Examples:

client.book.get(object_id ="5cf5805fb53e011a64671582")

client.book.get()

client.charater.get()

client.quote.get()

gian-sdk's People

Contributors

gkarloz 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.