Skip to main content

My Anime List Api Client and Auth.

Project description

MalApi

Instructions

Example

#!/bin/env python3
from pprint import pprint
from pathlib import Path

from mal_api.client import Client
from mal_api.auth import Auth

MAL_CLIENT_ID     = "MAL_CLIENT_ID"
MAL_CLIENT_SECRET = "MAL_CLIENT_SECRECT"
MAL_REDIRECT_URI  = "http://127.0.0.1:8000/callback"

def main():
	if not MAL_CLIENT_ID or not MAL_CLIENT_SECRET or not MAL_REDIRECT_URI:
		raise Exception("Environment Variables not loaded")

	auth = Auth(
			clientId=MAL_CLIENT_ID,
			clientSecret=MAL_CLIENT_SECRET,
			redirectUri=MAL_REDIRECT_URI,
			cacheFile=Path.joinpath(Path.home(), ".cache/malCache.json"),
	)

	auth.authenticate()

	client = Client(auth=auth)

	pprint(client.getUserData())
	pprint(client.getUserAnimeList())

if __name__ == "__main__":
	main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

myanimelist_api-0.1.4.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

myanimelist_api-0.1.4-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file myanimelist_api-0.1.4.tar.gz.

File metadata

  • Download URL: myanimelist_api-0.1.4.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for myanimelist_api-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d89083a06971ec044616be326051d49bacb4e815a0d1b095248a090079488638
MD5 e9c67faef08c0dd61bcf952c1fca6c7f
BLAKE2b-256 671f2b03c8457bfef42ef041ca9754b1e3d6e34ffc22aac54cc5e3d17c1ca6a5

See more details on using hashes here.

File details

Details for the file myanimelist_api-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for myanimelist_api-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7acd70398b58af4bc7b5b2a8a00a919d89d8b1a865e9b84a4652f3320af9cf07
MD5 1ff54d11c25a06cc562defc216211bcd
BLAKE2b-256 b44a230a0b0ca9641ed13f05b57d9d60145d4922e347d524ed2762f9427a7e1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page