Commit ab32be36 authored by Ana Guerrero López's avatar Ana Guerrero López

New upstream version 6.6

parent 15168ee0
#### Issue description
*write the description here*
#### Version of IMDbPY, Python and OS
- **Python:** `python3 -V` or, if you are using Python 2, `python -V`
- **IMDbPY:** `python3 -c 'import imdb ; print(imdb.VERSION)'` or, if you are using Python 2, `python -c 'import imdb ; print(imdb.VERSION)'`
- **OS:** `python -c 'import platform ; print(platform.uname())'`
#### Steps to reproduce the issue
*if possible, provide a minimal code to reproduce the problem*
```
#!python
# your code here
```
#### What's the expected result?
-
#### What's the actual result?
-
#### Additional details
-
*.pyc
*.pyo
*.egg-info
*.mo
*.so
.pytest_cache/
build/
_build/
__pycache__
dist/
.idea
.vscode
.cache
.tox
.coverage
prof
syntax: glob
.cache
.tox
__pycache__
build
dist
.cache
.tox
__pycache__
*.egg-info
*.mo
*.pyc
*.pyo
*.so
*.pyd
*~
*.swp
setuptools-*.egg
c3dba80881f0a810b3bf93051a56190b297e7a50 4.6
c8b07121469a2173a587b1a34beb4f1fecd640b6 4.7
ba221c9050599463b4b78c89a8bdada7d7aef173 4.8
e807ba790392d406018af0f98d5dad5117721a4d 4.8.1
b02c61369b27e0d5af0a755a8a2fc3355c08bb67 4.8.2
7f39f8ac4838b45fbf59f4167796dd17cd15c437 4.9
398c01b961076362958c27584d85fbdfa921ac63 5.0
cb1e19b508d03499e8f34bd066d8b930aca6aa2d 5.1
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
install:
- python setup.py install
script:
- py.test
notifications:
email:
on_success: never
on_failure: always
Metadata-Version: 1.1
Name: IMDbPY
Version: 5.1
Summary: Python package to access the IMDb's database
Home-page: http://imdbpy.sf.net/
Author: Davide Alberani
Author-email: da@erlug.linux.it
License: GPL
Download-URL: http://imdbpy.sf.net/?page=download
Description: IMDbPY is a Python package useful to retrieve and
manage the data of the IMDb movie database about movies, people,
characters and companies.
Platform-independent and written in pure Python (and few C lines),
it can retrieve data from both the IMDb's web server and a local copy
of the whole database.
IMDbPY package can be very easily used by programmers and developers
to provide access to the IMDb's data to their programs.
Some simple example scripts - useful for the end users - are included
in this package; other IMDbPY-based programs are available at the
home page: http://imdbpy.sf.net/
Keywords: imdb,movie,people,database,cinema,film,person,cast,actor,actress,director,sql,character,company,package,plain text data files,keywords,top250,bottom100,xml
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Environment :: Handhelds/PDA's
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Natural Language :: English
Classifier: Natural Language :: Italian
Classifier: Natural Language :: Turkish
Classifier: Programming Language :: Python
Classifier: Programming Language :: C
Classifier: Operating System :: OS Independent
Classifier: Topic :: Database :: Front-Ends
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
MANIFEST.in
ez_setup.py
setup.cfg
setup.py
./bin/get_character.py
./bin/get_company.py
./bin/get_first_character.py
./bin/get_first_company.py
./bin/get_first_movie.py
./bin/get_first_person.py
./bin/get_keyword.py
./bin/get_movie.py
./bin/get_person.py
./bin/get_top_bottom_movies.py
./bin/imdbpy2sql.py
./bin/search_character.py
./bin/search_company.py
./bin/search_keyword.py
./bin/search_movie.py
./bin/search_person.py
IMDbPY.egg-info/PKG-INFO
IMDbPY.egg-info/SOURCES.txt
IMDbPY.egg-info/dependency_links.txt
IMDbPY.egg-info/requires.txt
IMDbPY.egg-info/top_level.txt
docs/AUTHOR.txt
docs/CONTRIBUTORS.txt
docs/CREDITS.txt
docs/Changelog.txt
docs/DISCLAIMER.txt
docs/FAQS.txt
docs/GPL.txt
docs/INSTALL.txt
docs/LICENSE.txt
docs/README.adult
docs/README.companies
docs/README.currentRole
docs/README.devel
docs/README.http
docs/README.info2xml
docs/README.keywords
docs/README.local
docs/README.locale
docs/README.logging
docs/README.mobile
docs/README.newparsers
docs/README.package
docs/README.redesign
docs/README.series
docs/README.sqldb
docs/README.txt
docs/README.unicode
docs/README.users
docs/TODO.txt
docs/imdbpy.cfg
docs/imdbpy48.dtd
docs/imdbpyPowered.png
docs/imdbpy_new_logo.png
docs/imdbpyico.png
docs/imdbpyico.xpm
docs/imdbpyico16x16.ico
docs/imdbpyico32x32.ico
docs/imdbpywin.bmp
docs/goodies/README.txt
docs/goodies/applydiffs.sh
docs/goodies/download_applydiffs.py
docs/goodies/reduce.sh
imdb/Character.py
imdb/Company.py
imdb/Movie.py
imdb/Person.py
imdb/__init__.py
imdb/_compat.py
imdb/_exceptions.py
imdb/_logging.py
imdb/helpers.py
imdb/linguistics.py
imdb/utils.py
imdb/locale/__init__.py
imdb/locale/__init__.pyc
imdb/locale/generatepot.py
imdb/locale/imdbpy-ar.po
imdb/locale/imdbpy-bg.po
imdb/locale/imdbpy-de.po
imdb/locale/imdbpy-en.po
imdb/locale/imdbpy-es.po
imdb/locale/imdbpy-fr.po
imdb/locale/imdbpy-it.po
imdb/locale/imdbpy-pt_BR.po
imdb/locale/imdbpy-tr.po
imdb/locale/imdbpy.pot
imdb/locale/msgfmt.py
imdb/locale/msgfmt.pyc
imdb/locale/rebuildmo.py
imdb/locale/rebuildmo.pyc
imdb/locale/ar/LC_MESSAGES/imdbpy.mo
imdb/locale/bg/LC_MESSAGES/imdbpy.mo
imdb/locale/de/LC_MESSAGES/imdbpy.mo
imdb/locale/en/LC_MESSAGES/imdbpy.mo
imdb/locale/es/LC_MESSAGES/imdbpy.mo
imdb/locale/fr/LC_MESSAGES/imdbpy.mo
imdb/locale/it/LC_MESSAGES/imdbpy.mo
imdb/locale/pt_BR/LC_MESSAGES/imdbpy.mo
imdb/locale/tr/LC_MESSAGES/imdbpy.mo
imdb/parser/__init__.py
imdb/parser/http/__init__.py
imdb/parser/http/characterParser.py
imdb/parser/http/companyParser.py
imdb/parser/http/movieParser.py
imdb/parser/http/personParser.py
imdb/parser/http/searchCharacterParser.py
imdb/parser/http/searchCompanyParser.py
imdb/parser/http/searchKeywordParser.py
imdb/parser/http/searchMovieParser.py
imdb/parser/http/searchPersonParser.py
imdb/parser/http/topBottomParser.py
imdb/parser/http/utils.py
imdb/parser/http/bsouplxml/__init__.py
imdb/parser/http/bsouplxml/_bsoup.py
imdb/parser/http/bsouplxml/bsoupxpath.py
imdb/parser/http/bsouplxml/etree.py
imdb/parser/http/bsouplxml/html.py
imdb/parser/mobile/__init__.py
imdb/parser/sql/__init__.py
imdb/parser/sql/alchemyadapter.py
imdb/parser/sql/cutils.c
imdb/parser/sql/dbschema.py
imdb/parser/sql/objectadapter.py
\ No newline at end of file
SQLObject
FormEncode
SQLAlchemy
sqlalchemy-migrate
lxml
This diff is collapsed.
......@@ -4,21 +4,7 @@
# Manifest template for creating the Distutils source distribution.
#
# Comment out the "recursive-include docs" entry if you don't want
# to install the documentation.
recursive-include docs *
recursive-include imdb/locale *
global-exclude *~
prune CVS
prune .svn
prune .hg
global-exclude CVS
global-exclude .svn
# Try to force the inclusion of ez_setup.py.
include ez_setup.py
# Uncomment the following line if you don't want to install the logo images.
# exclude docs/*.png docs/*.xpm docs/*.bmp
global-exclude __pycache__
.PHONY: help clean clean-build clean-pyc clean-docs lint test test-all coverage docs dist
help:
@echo "clean - clean everything"
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-docs - remove Sphinx documentation artifacts"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "test-all - run tests on every Python version with tox"
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate Sphinx HTML documentation, including API docs"
@echo "dist - package"
clean: clean-build clean-pyc clean-docs
clean-build:
rm -fr build/
rm -fr dist/
rm -fr *.egg-info
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
clean-docs:
make -C docs clean
lint:
python setup.py flake8
test:
pytest
test-all:
tox
coverage:
pytest --cov-report term-missing --cov=imdb tests
docs:
$(MAKE) -C docs clean
$(MAKE) -C docs html
dist: clean
python setup.py check -r -s
python setup.py sdist
python setup.py bdist_wheel
Metadata-Version: 1.1
Name: IMDbPY
Version: 5.1
Summary: Python package to access the IMDb's database
Home-page: http://imdbpy.sf.net/
Author: Davide Alberani
Author-email: da@erlug.linux.it
License: GPL
Download-URL: http://imdbpy.sf.net/?page=download
Description: IMDbPY is a Python package useful to retrieve and
manage the data of the IMDb movie database about movies, people,
characters and companies.
Platform-independent and written in pure Python (and few C lines),
it can retrieve data from both the IMDb's web server and a local copy
of the whole database.
IMDbPY package can be very easily used by programmers and developers
to provide access to the IMDb's data to their programs.
Some simple example scripts - useful for the end users - are included
in this package; other IMDbPY-based programs are available at the
home page: http://imdbpy.sf.net/
Keywords: imdb,movie,people,database,cinema,film,person,cast,actor,actress,director,sql,character,company,package,plain text data files,keywords,top250,bottom100,xml
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Environment :: Handhelds/PDA's
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Natural Language :: English
Classifier: Natural Language :: Italian
Classifier: Natural Language :: Turkish
Classifier: Programming Language :: Python
Classifier: Programming Language :: C
Classifier: Operating System :: OS Independent
Classifier: Topic :: Database :: Front-Ends
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
.. image:: https://travis-ci.org/alberanid/imdbpy.svg?branch=master
:target: https://travis-ci.org/alberanid/imdbpy
**IMDbPY** is a Python package for retrieving and managing the data
of the `IMDb`_ movie database about movies, people and companies.
:Homepage: https://imdbpy.sourceforge.io/
:PyPI: https://pypi.org/project/IMDbPY/
:Repository: https://github.com/alberanid/imdbpy
:Documentation: https://imdbpy.readthedocs.io/
:Support: https://imdbpy.sourceforge.io/support.html
.. admonition:: Revamp notice
:class: note
Starting on November 2017, many things were improved and simplified:
- moved the package to Python 3 (compatible with Python 2.7)
- removed dependencies: SQLObject, C compiler, BeautifulSoup
- removed the "mobile" and "httpThin" parsers
- introduced a test suite (`please help with it!`_)
Main features
-------------
- written in Python 3 (compatible with Python 2.7)
- platform-independent
- can retrieve data from both the IMDb's web server, or a local copy
of the database
- simple and complete API
- released under the terms of the GPL 2 license
IMDbPY powers many other software and has been used in various research papers.
`Curious about that`_?
Installation
------------
Whenever possible, please use the latest version from the repository::
pip install git+https://github.com/alberanid/imdbpy
But if you want, you can also install the latest release from PyPI::
pip install imdbpy
Example
-------
Here's an example that demonstrates how to use IMDbPY:
.. code-block:: python
from imdb import IMDb
# create an instance of the IMDb class
ia = IMDb()
# get a movie
movie = ia.get_movie('0133093')
# print the names of the directors of the movie
print('Directors:')
for director in movie['directors']:
print(director['name'])
# print the genres of the movie
print('Genres:')
for genre in movie['genres']:
print(genre)
# search for a person name
people = ia.search_person('Mel Gibson')
for person in people:
print(person.personID, person['name'])
.. _IMDb: https://www.imdb.com/
.. _please help with it!: http://imdbpy.readthedocs.io/en/latest/devel/test.html
.. _Curious about that: https://imdbpy.sourceforge.io/ecosystem.html
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
get_character.py
Usage: get_character "characterID"
Usage: get_character "character_id"
Show some info about the character with the given characterID (e.g. '0000001'
Show some info about the character with the given character_id (e.g. '0000001'
for "Jesse James", using 'http' or 'mobile').
Notice that characterID, using 'sql', are not the same IDs used on the web.
Notice that character_id, using 'sql', are not the same IDs used on the web.
"""
import sys
......@@ -15,33 +16,32 @@ import sys
try:
import imdb
except ImportError:
print 'You bad boy! You need to install the IMDbPY package!'
print('You bad boy! You need to install the IMDbPY package!')
sys.exit(1)
if len(sys.argv) != 2:
print 'Only one argument is required:'
print ' %s "characterID"' % sys.argv[0]
print('Only one argument is required:')
print(' %s "character_id"' % sys.argv[0])
sys.exit(2)
characterID = sys.argv[1]
character_id = sys.argv[1]
i = imdb.IMDb()
out_encoding = sys.stdout.encoding or sys.getdefaultencoding()
try:
# Get a character object with the data about the character identified by
# the given characterID.
character = i.get_character(characterID)
except imdb.IMDbError, e:
print "Probably you're not connected to Internet. Complete error report:"
print e
# the given character_id.
character = i.get_character(character_id)
except imdb.IMDbError as e:
print("Probably you're not connected to Internet. Complete error report:")
print(e)
sys.exit(3)
if not character:
print 'It seems that there\'s no character with characterID "%s"' % characterID
print(("It seems that there's no character"
' with character_id "%s"' % character_id))
sys.exit(4)
# XXX: this is the easier way to print the main info about a character;
......@@ -51,6 +51,4 @@ if not character:
# to access the data stored in a character object, so look below; the
# commented lines show some ways to retrieve information from a
# character object.
print character.summary().encode(out_encoding, 'replace')
print(character.summary())
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
get_company.py
Usage: get_company "companyID"
Usage: get_company "company_id"
Show some info about the company with the given companyID (e.g. '0071509'
Show some info about the company with the given company_id (e.g. '0071509'
for "Columbia Pictures [us]", using 'http' or 'mobile').
Notice that companyID, using 'sql', are not the same IDs used on the web.
Notice that company_id, using 'sql', are not the same IDs used on the web.
"""
import sys
......@@ -15,33 +16,31 @@ import sys
try:
import imdb
except ImportError:
print 'You bad boy! You need to install the IMDbPY package!'
print('You bad boy! You need to install the IMDbPY package!')
sys.exit(1)
if len(sys.argv) != 2:
print 'Only one argument is required:'
print ' %s "companyID"' % sys.argv[0]
print('Only one argument is required:')
print(' %s "company_id"' % sys.argv[0])
sys.exit(2)
companyID = sys.argv[1]
company_id = sys.argv[1]
i = imdb.IMDb()
out_encoding = sys.stdout.encoding or sys.getdefaultencoding()
try:
# Get a company object with the data about the company identified by
# the given companyID.
company = i.get_company(companyID)
except imdb.IMDbError, e:
print "Probably you're not connected to Internet. Complete error report:"
print e
# the given company_id.
company = i.get_company(company_id)
except imdb.IMDbError as e:
print("Probably you're not connected to Internet. Complete error report:")
print(e)
sys.exit(3)
if not company:
print 'It seems that there\'s no company with companyID "%s"' % companyID
print('It seems that there\'s no company with company_id "%s"' % company_id)
sys.exit(4)
# XXX: this is the easier way to print the main info about a company;
......@@ -51,6 +50,4 @@ if not company:
# to access the data stored in a company object, so look below; the
# commented lines show some ways to retrieve information from a
# company object.
print company.summary().encode(out_encoding, 'replace')
print(company.summary())
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
get_first_character.py
......@@ -13,13 +14,13 @@ import sys
try:
import imdb
except ImportError:
print 'You bad boy! You need to install the IMDbPY package!'
print('You bad boy! You need to install the IMDbPY package!')
sys.exit(1)
if len(sys.argv) != 2:
print 'Only one argument is required:'
print ' %s "character name"' % sys.argv[0]
print('Only one argument is required:')
print(' %s "character name"' % sys.argv[0])
sys.exit(2)
name = sys.argv[1]
......@@ -27,24 +28,20 @@ name = sys.argv[1]
i = imdb.IMDb()
in_encoding = sys.stdin.encoding or sys.getdefaultencoding()
out_encoding = sys.stdout.encoding or sys.getdefaultencoding()
name = unicode(name, in_encoding, 'replace')
try:
# Do the search, and get the results (a list of character objects).
results = i.search_character(name)
except imdb.IMDbError, e:
print "Probably you're not connected to Internet. Complete error report:"
print e
except imdb.IMDbError as e:
print("Probably you're not connected to Internet. Complete error report:")
print(e)
sys.exit(3)
if not results:
print 'No matches for "%s", sorry.' % name.encode(out_encoding, 'replace')
print('No matches for "%s", sorry.' % name)
sys.exit(0)
# Print only the first result.
print ' Best match for "%s"' % name.encode(out_encoding, 'replace')
print(' Best match for "%s"' % name)
# This is a character instance.
character = results[0]
......@@ -53,7 +50,4 @@ character = results[0]
# name; retrieve main information:
i.update(character)