Git Product home page Git Product logo

aghpb_api's Introduction

πŸ“š AGHPB API

Behold the anime girls holding programming books API!

Docker Badge

This is an API I made for the anime girls holding programming books github repo because I was bored. It's a rewrite of the old API but written in Python using the Fast API library instead. It scraps a local copy of the repo and thanks to that I was able to implement headers like Book-Date-Added (returns the date and time a book was added).

🌐 Publicly available instances

Country URL Hosted by Notes
πŸ‡¬πŸ‡§ https://api.devgoldy.xyz/aghpb/v1 me Official Instance
πŸ‡©πŸ‡ͺ https://api.ananas.moe/aghpb/v1 r3tr0ananas

πŸ’« API Wrappers

I was also even more bored so I decided to write an API wrapper in every mfing language I can possible, including those I've never really written in.

These are the languages I've written so far:

  • πŸ¦€ Rust - aghpb.rs
  • 🟦 TypeScript - aghpb.ts
  • ⚫ C - aghpb.c (not async, might blow up)
  • πŸ”₯ Mojo - Soonβ„’
  • πŸ”΅ Go - Soonβ„’
  • πŸŒ• Lua - aghpb.lua (not async)
  • β˜• Java - Soonβ„’ "fuck you java (maven included)"

πŸ› οΈ Wanna self-host?

If you would like to host your own instance of the aghpb API continue reading.

🐬 Docker Method (recommended)

Warning

The docker image currently only supports x86 architecture so if you are running anything else you may need to build the image yourself. For instructions on how to do that check out here.

The easiest method to host an instance is via our docker image. From now on in this section, I'm gonna assume you've had experience with Docker and you can at least complete the hello world tutorial.

Spinning up an aghpb API container in docker is pretty simple:

  1. First pull that mf
docker pull devgoldy/aghpb_api:latest
  1. Then launch a container with this command. -p binds the api to your localhost port 8000.
docker run -p 127.0.0.1:8000:8000/tcp devgoldy/aghpb_api:latest
  1. Now visit localhost:8000 in your browser and there you go! πŸ‘

if you want to host via docker-compose, this file might be useful to you

βš—οΈ Building your own docker image.

To build your own docker image it is necessary you follow the native method's steps, but only up to step number 3 is necessary.

Once that is done run the command below:

make docker-build

docker images should display the "devgoldy/aghpb_api" image.

Now you may jump to step 2 of the docker method.

🐍 Native Method (recommended for development)

Prerequisites:

  1. Clone the repo.
git clone https://github.com/THEGOLDENPRO/aghpb_api && cd aghpb_api
  1. Create env.
python -m venv env
source env/bin/activate # For windows it's --> cd env/Scripts && activate && cd ../../
  1. Install the API's dependencies.
make
  1. Pull the anime girls programming books.
make pull-repo
  1. Run that sh#t.
make run
  1. Visit localhost:8000 in your browser, then all should be good! 🌈

aghpb_api's People

Contributors

thegoldenpro avatar r3tr0ananas avatar

Stargazers

David ZΓ‘rate avatar Spidergod607 avatar Reisensei avatar Poseidon444 avatar 翻转岩石,ζ™¨ε…‰ζ΄’θ½ζˆ‘θΊ« avatar Cat Milk :3 avatar  avatar

Watchers

Lucian avatar  avatar

aghpb_api's Issues

Official instance just died

Thank you for creating and maintaining this project.

I wanted to bring to your attention that the official instance has just gone offline.

image

v1.4

  • Make rate limits configurable in env vars.
  • Info endpoint that returns:
    • How many books are available.
    • What version the API is on.
  • Allow caching for /get, /search and /categories endpoints. Improve caching for /get.
  • #7
  • add book-commit-hash header
  • remove submodules ~ significantly reduces image size
  • migrate to pyproject.toml
  • implement ftfy for the book author key.
  • DARK MODE!!! (not this release)
  • git repo auto update on API boot

Rate limiting

As the API is starting to get used a little more I think it's good practice soon we should start implementing rate-limiting systems.

The rate limits won't be too harsh, you most likely won't even notice it. I'm planning for rate limits on the /random and /get endpoints. Follow this git issue to find out the exact rate limit numbers as I will be mentioning that later in this issue.

Expose what version of the aghpb repository the API is currently based off.

With the /info endpoint we should expose to the users how up to date the clone of the anime girls holding programming books repo in the API is.

The API isn't always up to date with the repo as it uses its own copy, I usually go in and git pull manually occasionally or when I see new commits. Anyways beyond the point of this issue.

We should expose two keys to the /info JSON response, latest_commit_hash and latest_commit_date.

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.