" % (self.key, self.value)
56 |
57 |
58 | def init_db(transactional=False):
59 | engine = sqlalchemy.create_engine(CONNECTION_STRING)
60 | Base.metadata.create_all(engine)
61 | Session = sessionmaker(bind=engine)
62 | session = Session()
63 | return session
64 |
65 | if __name__ == "__main__":
66 | init_db()
67 |
--------------------------------------------------------------------------------
/index.tpl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IMDB API
5 |
15 |
16 |
17 | IMDB API
18 | by Stavros Korokithakis
19 |
20 | Well hello. I see you want to access IMDB programatically. Well, this is your chance.
21 | This service is updated every day from the
22 | IMDB data files and you
23 | can access it with the ?name= URL parameter. For example,
24 | this is the episode list (in JSON) for
25 | How I Met Your Mother.
26 |
27 |
28 | This service only supports shows, it does not have any movies.
29 |
30 |
31 | Instructions:
32 |
33 | - Use the "name" GET parameter followed by the urlencoded show name. If there
34 | are multiple shows with the same name, you can pass the "year" parameter as well
35 | to select a year. The script can now return JSONP, you can pass the "callback"
36 | parameter to get the data wrapped in a javascript function whose name is the
37 | value of the callback parameter (example).
38 | - The URL /js/ returns data as text/html and /json/ returns data as application/json.
39 | Both use exactly the same parameters.
40 | - You can use wildcards by using the percent sign, for example
41 | "how i met % mother" will work.
42 | - If there are multiple show names, you will get a list of the 15 first
43 | that match your string (example).
44 | - If the show was not found, you will get "null".
45 |
46 |
47 |
48 | - The source code for this service is
49 | available on GitHub.
50 |
51 | - I have also written a script that will rename your show's video files using
52 | this and other services, you can find it here:
53 | Episode renamer.
54 | - If you need to contact me, my email is can be found on my site.
55 | - My site is stavros.io.
56 |
57 |
58 |
59 | Have fun!
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------