Giter Site home page Giter Site logo

python-mal's Introduction

Build Status

python-mal

Provides programmatic access to MyAnimeList data.

Dependencies

  • python 2.7.*
  • BeautifulSoup 4
  • pytz
  • requests
  • lxml
  • nose (only if you want to run tests, though!)

Installation

After cloning the repository, navigate to the directory and run python setup.py install.

Getting Started

The myanimelist.session.Session class handles requests to MAL, so you'll want to create one first:

from myanimelist.session import Session
s = Session()

Then if you want to fetch an anime, say, Cowboy Bebop:

bebop = s.anime(1)
print bebop

Objects in python-mal are lazy-loading: they won't go out and fetch MAL info until you first-request it. So here, if you want to retrieve, say, the things related to Cowboy Bebop:

for how_related,items in bebop.related.iteritems():
  print how_related
  print "============="
  for item in items:
    print item
  print ""

You'll note that there's a pause while Cowboy Bebop's information is fetched from MAL.

Documentation

To find out more about what python-mal is capable of, visit the docs here.

Testing

Testing requires nose. To run the tests that come with python-mal:

  1. Navigate to the python-mal directory
  2. Create a textfile named credentials.txt and put your MAL username and password in it, separated by a comma, or set environment variables named MAL_USERNAME and MAL_PASSWORD with the appropriate values.
  3. Run nosetests.

Make sure you don't spam the tests too quickly! One of the tests involves POSTing invalid credentials to MAL, so you're likely to be IP-banned if you do this too much in too short a span of time.

python-mal's People

Contributors

shaldengeki avatar martynaszilinskas avatar

Watchers

James Cloos 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.