id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27,600 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/pdf/render/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
| 152 | Python | .py | 4 | 35.75 | 61 | 0.678322 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,601 | fonts.py | kovidgoyal_calibre/src/calibre/ebooks/pdf/render/fonts.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import re
from collections import Counter, OrderedDict
from itertools import groupby
from operator import itemgetter
from calibre import as_unicode
from calibre.ebooks.p... | 8,817 | Python | .py | 213 | 31.723005 | 159 | 0.586807 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,602 | graphics.py | kovidgoyal_calibre/src/calibre/ebooks/pdf/render/graphics.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from collections import namedtuple
from math import sqrt
from qt.core import QBrush, QImage, QPaintEngine, QPen, QPointF, Qt, QTransform
from calibre.ebooks.pdf.render.... | 14,644 | Python | .py | 403 | 26.263027 | 118 | 0.532627 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,603 | serialize.py | kovidgoyal_calibre/src/calibre/ebooks/pdf/render/serialize.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import hashlib
import numbers
from qt.core import QBuffer, QByteArray, QColor, QImage, QPainter, Qt, qRgba
from calibre.constants import __appname__, __version__
from c... | 18,601 | Python | .py | 435 | 32.896552 | 121 | 0.579044 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,604 | common.py | kovidgoyal_calibre/src/calibre/ebooks/pdf/render/common.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import codecs
import numbers
import zlib
from datetime import datetime
from io import BytesIO
from calibre.utils.logging import default_log
from calibre_extensions.speed... | 6,404 | Python | .py | 191 | 26.172775 | 92 | 0.563495 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,605 | oeb2html.py | kovidgoyal_calibre/src/calibre/ebooks/htmlz/oeb2html.py | __license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
'''
Transform OEB content into a single (more or less) HTML file.
'''
import os
import re
from functools import partial
from css_parser import replaceUrls
from lxml import html
from calibre impor... | 15,111 | Python | .py | 357 | 32.263305 | 128 | 0.571244 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,606 | input.py | kovidgoyal_calibre/src/calibre/ebooks/html/input.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
'''
Input plugin for HTML or OPF ebooks.
'''
import errno as gerrno
import os
import re
import sys
from calibre import replace_entities, unicode_path
from calibre.constan... | 10,158 | Python | .py | 250 | 30.212 | 132 | 0.565297 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,607 | meta.py | kovidgoyal_calibre/src/calibre/ebooks/html/meta.py | __license__ = 'GPL 3'
__copyright__ = '2010, Fabian Grassl <fg@jusmeum.de>'
__docformat__ = 'restructuredtext en'
class EasyMeta:
def __init__(self, meta):
self.meta = meta
def __iter__(self):
from calibre.ebooks.oeb.base import DC11_NS, barename, namespace
meta = self.meta
f... | 823 | Python | .py | 24 | 25.666667 | 76 | 0.568182 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,608 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/html/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
| 146 | Python | .py | 4 | 35 | 58 | 0.678571 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,609 | to_zip.py | kovidgoyal_calibre/src/calibre/ebooks/html/to_zip.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import glob
import os
import textwrap
from calibre.constants import numeric_version
from calibre.customize import FileTypePlugin
class HTML2ZIP(FileTypePlugin):
name ... | 6,166 | Python | .py | 129 | 37.286822 | 139 | 0.622632 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,610 | lzx.py | kovidgoyal_calibre/src/calibre/ebooks/lit/lzx.py | '''
LZX compression/decompression wrapper.
'''
__license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
from calibre_extensions import lzx as _lzx
__all__ = ['Compressor', 'Decompressor', 'LZXError']
LZXError = _lzx.LZXError
Compressor = _lzx.Compressor
class Decompressor:
... | 571 | Python | .py | 18 | 27.333333 | 66 | 0.667279 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,611 | writer.py | kovidgoyal_calibre/src/calibre/ebooks/lit/writer.py | '''
Basic support for writing LIT files.
'''
__license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
import copy
import functools
import io
import numbers
import os
import re
import time
import uuid
from itertools import chain, count
from operator import attrgetter
from struct impo... | 26,713 | Python | .py | 660 | 29.656061 | 127 | 0.543145 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,612 | mssha1.py | kovidgoyal_calibre/src/calibre/ebooks/lit/mssha1.py | """
Modified version of SHA-1 used in Microsoft LIT files.
Adapted from the PyPy pure-Python SHA-1 implementation.
"""
__license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
import copy
import struct
from polyglot.builtins import long_type
# ====================================... | 9,200 | Python | .py | 256 | 28.398438 | 74 | 0.548882 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,613 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/lit/__init__.py | __license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
class LitError(Exception):
pass
| 130 | Python | .py | 4 | 30 | 66 | 0.685484 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,614 | reader.py | kovidgoyal_calibre/src/calibre/ebooks/lit/reader.py | '''
Support for reading LIT files.
'''
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net> ' \
'and Marshall T. Vandegrift <llasram@gmail.com>'
import functools
import io
import os
import re
import struct
from lxml import etree
import calibre.ebooks.lit.mssha1 as mssha1
from ca... | 35,059 | Python | .py | 858 | 28.13986 | 88 | 0.510925 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,615 | opf.py | kovidgoyal_calibre/src/calibre/ebooks/lit/maps/opf.py | __license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
"""
Microsoft LIT OPF tag and attribute tables, copied from ConvertLIT.
"""
TAGS = [
None,
"package",
"dc:Title",
"dc:Creator",
None,
None,
None,
None,
None,
None,
None,
None,
... | 1,403 | Python | .py | 76 | 13.868421 | 67 | 0.554126 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,616 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/lit/maps/__init__.py | __license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
"""
Microsoft LIT tag and attribute tables.
"""
from calibre.ebooks.lit.maps.html import MAP as HTML_MAP
from calibre.ebooks.lit.maps.opf import MAP as OPF_MAP
OPF_MAP, HTML_MAP
| 273 | Python | .py | 8 | 32.75 | 66 | 0.744275 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,617 | html.py | kovidgoyal_calibre/src/calibre/ebooks/lit/maps/html.py | __license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
"""
Microsoft LIT HTML tag and attribute tables, copied from ConvertLIT.
"""
TAGS = [
None,
None,
None,
"a",
"acronym",
"address",
"applet",
"area",
"b",
"base",
"basefont",
"bdo... | 18,756 | Python | .py | 1,010 | 13.937624 | 68 | 0.542698 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,618 | palmdoc.py | kovidgoyal_calibre/src/calibre/ebooks/compression/palmdoc.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import io
from struct import pack
from calibre_extensions import cPalmdoc
def decompress_doc(data):
return cPalmdoc.decompress(data)
def compress_doc(data):
return cPalmdoc.compress(data) if data... | 2,681 | Python | .py | 75 | 23.72 | 86 | 0.486299 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,619 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/compression/__init__.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
| 121 | Python | .py | 3 | 39.333333 | 60 | 0.686441 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,620 | tcr.py | kovidgoyal_calibre/src/calibre/ebooks/compression/tcr.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import re
from polyglot.builtins import int_to_byte
class TCRCompressor:
'''
TCR compression takes the form header+code_dict+coded_text.
The header is always "!!8-Bit!!". The code dic... | 5,076 | Python | .py | 112 | 36.026786 | 108 | 0.606687 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,621 | txtml.py | kovidgoyal_calibre/src/calibre/ebooks/txt/txtml.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
'''
Transform OEB content into plain text
'''
import re
from lxml import etree
from polyglot.builtins import string_or_bytes
BLOCK_TAGS = [
'div',
'p',
'h1',
'h2',
'h3',
... | 8,635 | Python | .py | 218 | 28.293578 | 147 | 0.515047 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,622 | markdownml.py | kovidgoyal_calibre/src/calibre/ebooks/txt/markdownml.py | __license__ = 'GPL 3'
__copyright__ = '''2011, John Schember <john@nachtimwald.com>
2011, Leigh Parry <leighparry@blueyonder.co.uk>'''
__docformat__ = 'restructuredtext en'
'''
Transform OEB content into Textile formatted plain text
'''
import re
from functools import partial
from calibre.ebooks.htmlz.oeb2html import... | 10,604 | Python | .py | 250 | 30.192 | 102 | 0.501066 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,623 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/txt/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, John Schember john@nachtimwald.com'
__docformat__ = 'restructuredtext en'
'''
Used for txt output
'''
| 175 | Python | .py | 7 | 23.571429 | 58 | 0.684848 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,624 | textileml.py | kovidgoyal_calibre/src/calibre/ebooks/txt/textileml.py | __license__ = 'GPL 3'
__copyright__ = '2011, Leigh Parry <leighparry@blueyonder.co.uk>'
__docformat__ = 'restructuredtext en'
'''
Transform OEB content into Textile formatted plain text
'''
import re
from functools import partial
from calibre.ebooks import unit_convert
from calibre.ebooks.htmlz.oeb2html import OEB2HT... | 19,453 | Python | .py | 462 | 29.378788 | 119 | 0.469362 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,625 | newlines.py | kovidgoyal_calibre/src/calibre/ebooks/txt/newlines.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
class TxtNewlines:
NEWLINE_TYPES = {
'system' : os.linesep,
'unix' : '\n',
'old_mac' : '\r',
... | 726 | Python | .py | 20 | 26.8 | 79 | 0.519369 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,626 | processor.py | kovidgoyal_calibre/src/calibre/ebooks/txt/processor.py | __license__ = 'GPL v3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
'''
Read content from txt file.
'''
import os
import re
from calibre import isbytestring, prepare_string_for_xml
from calibre.ebooks.conversion.preprocess import DocAnalysis
from calibre.ebook... | 12,751 | Python | .py | 310 | 33.767742 | 149 | 0.60359 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,627 | krcodepoints.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/krcodepoints.py | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2010 Hiroshi Miura <miurahr@linux.com>'
__docformat__ = 'restructuredtext en'
'''
Unicode code point dictionary.
Based on Unicode.org Unihan database.
'''
CODEPOINTS = {
'x34':[
'Qiu ','Tian ','','','Kua ','Wu ','Yin ','','','','','','Si ','... | 406,322 | Python | .py | 5,248 | 68.660442 | 151 | 0.255793 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,628 | vncodepoints.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/vncodepoints.py | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2010 Hiroshi Miura <miurahr@linux.com>'
__docformat__ = 'restructuredtext en'
'''
Unicode code point dictionary.
Based on Unicode.org Unihan database.
'''
CODEPOINTS = {
'x34':[
'Qiu ','Tian ','','','Kua ','Wu ','Yin ','','','','','','Si ','... | 406,340 | Python | .py | 5,248 | 68.663872 | 149 | 0.255827 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,629 | zhcodepoints.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/zhcodepoints.py | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2010 Hiroshi Miura <miurahr@linux.com>'
__docformat__ = 'restructuredtext en'
'''
Unicode code point dictionary.
Based on Unicode.org Unihan database.
'''
CODEPOINTS = {
'x34':[
'Qiu ','Tian ','','','Kua ','Wu ','Yin ','','','','','','Si ','... | 405,804 | Python | .py | 5,248 | 68.561738 | 150 | 0.254843 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,630 | jacodepoints.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/jacodepoints.py | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2010 Hiroshi Miura <miurahr@linux.com>'
__docformat__ = 'restructuredtext en'
'''
Unicode code point dictionary.
Based on Unicode.org Unihan database.
'''
CODEPOINTS = {
'x34':[
'Qiu ','Tian ','','','Kua ','Wu ','Yin ','','','','','','Si ','... | 406,489 | Python | .py | 5,248 | 68.692264 | 147 | 0.256113 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,631 | unicodepoints.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/unicodepoints.py | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
'''
Unicode code point dictionary.
Based on Text::Unidecode's xAB.pm lists. This combines all xAB.pm files into
a single dictionary.
'''
CODEPOINTS = {
'x20': [
' ', ... | 187,224 | Python | .py | 1,793 | 101.004462 | 209 | 0.369163 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,632 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/__init__.py | __license__ = 'GPL 3'
__copyright__ = '2010, Hiroshi Miura <miurahr@linux.com>'
__docformat__ = 'restructuredtext en'
__all__ = ["Unihandecoder"]
'''
Decode unicode text to an ASCII representation of the text.
Translate unicode characters to ASCII.
Inspired from John Schember's unidecode library which was created as ... | 1,669 | Python | .py | 40 | 34.3 | 79 | 0.657407 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,633 | vndecoder.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/vndecoder.py | __license__ = 'GPL 3'
__copyright__ = '2010, Hiroshi Miura <miurahr@linux.com>'
__docformat__ = 'restructuredtext en'
'''
Decode unicode text to an ASCII representation of the text in Vietnamese.
'''
from calibre.ebooks.unihandecode.unicodepoints import CODEPOINTS
from calibre.ebooks.unihandecode.unidecoder import U... | 561 | Python | .py | 14 | 36.857143 | 75 | 0.77037 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,634 | unidecoder.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/unidecoder.py | __license__ = 'GPL 3'
__copyright__ = '2010, Hiroshi Miura <miurahr@linux.com>'
__docformat__ = 'restructuredtext en'
'''
Decode unicode text to an ASCII representation of the text in Chinese.
Transliterate unicode characters to ASCII based on chinese pronounce.
Derived from John Schember's unidecode library. Which w... | 3,953 | Python | .py | 83 | 42.819277 | 83 | 0.74077 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,635 | jadecoder.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/jadecoder.py | __license__ = 'GPL 3'
__copyright__ = '2010, Hiroshi Miura <miurahr@linux.com>'
__docformat__ = 'restructuredtext en'
'''
Decode unicode text to an ASCII representation of the text for Japanese.
Translate unicode string to ASCII roman string.
API is based on the python unidecode,
which is based on Ruby gem (http://r... | 1,302 | Python | .py | 31 | 37.677419 | 89 | 0.731959 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,636 | krdecoder.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/krdecoder.py | __license__ = 'GPL 3'
__copyright__ = '2010, Hiroshi Miura <miurahr@linux.com>'
__docformat__ = 'restructuredtext en'
'''
Decode unicode text to an ASCII representation of the text in Korean.
Based on unidecoder.
'''
from calibre.ebooks.unihandecode.krcodepoints import CODEPOINTS as HANCODES
from calibre.ebooks.unih... | 578 | Python | .py | 15 | 35.466667 | 75 | 0.771583 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,637 | h2a.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/pykakasi/h2a.py | # h2a.py
#
# Copyright 2011 Hiroshi Miura <miurahr@linux.com>
#
# Original copyright:
# * KAKASI (Kanji Kana Simple inversion program)
# * $Id: jj2.c,v 1.7 2001-04-12 05:57:34 rug Exp $
# * Copyright (C) 1992
# * Hironobu Takahashi (takahasi@tiny.or.jp)
# *
# * This program is free software; you can redistribute it an... | 7,059 | Python | .py | 161 | 35.795031 | 72 | 0.511993 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,638 | j2h.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/pykakasi/j2h.py | # j2h.py
#
# Copyright 2011 Hiroshi Miura <miurahr@linux.com>
#
# Original Copyright:
# * KAKASI (Kanji Kana Simple inversion program)
# * $Id: jj2.c,v 1.7 2001-04-12 05:57:34 rug Exp $
# * Copyright (C) 1992
# * Hironobu Takahashi (takahasi@tiny.or.jp)
# *
# * This program is free software; you can redistribute it a... | 2,901 | Python | .py | 70 | 32.728571 | 110 | 0.507282 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,639 | k2a.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/pykakasi/k2a.py | # k2a.py
#
# Copyright 2011 Hiroshi Miura <miurahr@linux.com>
#
# Original copyright:
# * KAKASI (Kanji Kana Simple inversion program)
# * $Id: jj2.c,v 1.7 2001-04-12 05:57:34 rug Exp $
# * Copyright (C) 1992
# * Hironobu Takahashi (takahasi@tiny.or.jp)
# *
# * This program is free software; you can redistribute it an... | 1,333 | Python | .py | 38 | 30.184211 | 72 | 0.65035 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,640 | jisyo.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/pykakasi/jisyo.py | # jisyo.py
#
# Copyright 2011 Hiroshi Miura <miurahr@linux.com>
from zlib import decompress
class jisyo :
kanwadict = None
itaijidict = None
kanadict = None
jisyo_table = {}
# this class is Borg
_shared_state = {}
def __new__(cls, *p, **k):
self = object.__new__(cls, *p, **k)
... | 1,476 | Python | .py | 40 | 27.875 | 95 | 0.599159 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,641 | kakasi.py | kovidgoyal_calibre/src/calibre/ebooks/unihandecode/pykakasi/kakasi.py | # kakasi.py
#
# Copyright 2011 Hiroshi Miura <miurahr@linux.com>
#
# Original Copyright:
# * KAKASI (Kanji Kana Simple inversion program)
# * $Id: jj2.c,v 1.7 2001-04-12 05:57:34 rug Exp $
# * Copyright (C) 1992
# * Hironobu Takahashi (takahasi@tiny.or.jp)
# *
# * This program is free software; you can redistribute i... | 3,075 | Python | .py | 87 | 22.563218 | 72 | 0.467271 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,642 | config.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/config.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import ast
import json
import os
from calibre import sanitize_file_name
from calibre.customize.conversion import OptionRecommendation
from calibre.customize.ui import avail... | 12,133 | Python | .py | 266 | 37.342105 | 138 | 0.617056 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,643 | plumber.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plumber.py | __license__ = 'GPL 3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import json
import os
import pprint
import re
import shutil
import sys
from functools import partial
from calibre import extract, filesystem_encoding, get_types_map, isbytestring, walk
from calibre.c... | 60,196 | Python | .py | 1,175 | 40.378723 | 137 | 0.629732 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,644 | cli.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/cli.py | __license__ = 'GPL 3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
'''
Command line interface to conversion sub-system
'''
import numbers
import os
import sys
from collections import OrderedDict
from optparse import Option, OptionGroup
from calibre import patheq
fr... | 17,092 | Python | .py | 381 | 33.745407 | 106 | 0.577277 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,645 | utils.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/utils.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import re
from math import ceil
from calibre.ebooks.conversion.preprocess import Dehyphenator, DocAnalysis
from calibre.utils.logging import default_log
from calibre.utils.... | 46,093 | Python | .py | 777 | 45.649936 | 159 | 0.544559 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,646 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/__init__.py | __license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from polyglot.builtins import native_string_type
class ConversionUserFeedBack(Exception):
def __init__(self, title, msg, level='info', det_msg=''):
''' Show a simple message to the u... | 999 | Python | .py | 20 | 43.8 | 104 | 0.671811 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,647 | preprocess.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/preprocess.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import json
import re
from math import ceil
from calibre import as_unicode, entity_regex, xml_replace_entities
from calibre import xml_entity_to_unicode as convert_entities... | 25,371 | Python | .py | 538 | 36.195167 | 150 | 0.547376 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,648 | search_replace.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/search_replace.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
import regex
REGEX_FLAGS = regex.VERSION1 | regex.WORD | regex.FULLCASE | regex.MULTILINE | regex.UNICODE
regex_cache = {}
def compile_regular_expression(text, flags=REGEX_FLAGS):
key = flags, text
ans = regex_ca... | 434 | Python | .py | 11 | 35.727273 | 92 | 0.721823 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,649 | fb2_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/fb2_input.py | __license__ = 'GPL v3'
__copyright__ = '2008, Anatoly Shipitsin <norguhtar at gmail.com>'
"""
Convert .fb2 files to .lrf
"""
import os
import re
from calibre import guess_type
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
from calibre.utils.resources import get_path as P
from polyg... | 7,553 | Python | .py | 169 | 33.159763 | 122 | 0.541825 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,650 | txt_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/txt_input.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre import walk, xml_replace_entities
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
MD_EXTENSIONS = {
'abbr': _('Abbreviations'),
'adm... | 16,859 | Python | .py | 324 | 39.074074 | 157 | 0.576795 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,651 | recipe_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/recipe_input.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from calibre import walk
from calibre.constants import numeric_version
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
class Re... | 8,691 | Python | .py | 168 | 37.369048 | 132 | 0.569043 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,652 | lit_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/lit_input.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.customize.conversion import InputFormatPlugin
class LITInput(InputFormatPlugin):
name = 'LIT Input'
author = 'Marshall T. Vandegrift'
... | 2,653 | Python | .py | 54 | 34.037037 | 107 | 0.538996 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,653 | lit_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/lit_output.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.customize.conversion import OutputFormatPlugin
class LITOutput(OutputFormatPlugin):
name = 'LIT Output'
author = 'Marshall T. Vandegrift'
file_t... | 1,221 | Python | .py | 28 | 36.428571 | 73 | 0.686655 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,654 | pml_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/pml_output.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import io
import os
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
from calibre.ptempfile import TemporaryDirectory
class PMLOutput(OutputFormatPlugin):
na... | 2,922 | Python | .py | 58 | 38.965517 | 88 | 0.618112 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,655 | snb_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/snb_output.py | __license__ = 'GPL 3'
__copyright__ = '2010, Li Fanxi <lifanxi@freemindworld.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.constants import __appname__, __version__
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
from calibre.ptempfile import TemporaryDirectory
... | 12,347 | Python | .py | 238 | 36.823529 | 107 | 0.549541 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,656 | html_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/html_output.py | __license__ = 'GPL 3'
__copyright__ = '2010, Fabian Grassl <fg@jusmeum.de>'
__docformat__ = 'restructuredtext en'
import os
import re
import shutil
from os.path import abspath, basename, dirname, exists
from os.path import relpath as _relpath
from calibre import CurrentDir
from calibre.customize.conversion import Opt... | 9,516 | Python | .py | 189 | 36.772487 | 117 | 0.570213 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,657 | chm_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/chm_input.py | ''' CHM File decoding support '''
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>,' \
' and Alex Bramley <a.bramley at gmail.com>.'
import os
from calibre.constants import filesystem_encoding
from calibre.customize.conversion import InputFormatPlugin
from calibre.... | 8,696 | Python | .py | 189 | 33.873016 | 114 | 0.5639 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,658 | djvu_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/djvu_input.py | __license__ = 'GPL 3'
__copyright__ = '2011, Anthon van der Neut <anthon@mnt.org>'
__docformat__ = 'restructuredtext en'
import os
from io import BytesIO
from calibre.customize.conversion import InputFormatPlugin
class DJVUInput(InputFormatPlugin):
name = 'DJVU Input'
author = 'Anthon van der N... | 2,333 | Python | .py | 52 | 36.288462 | 96 | 0.632321 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,659 | pdf_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/pdf_output.py | __license__ = 'GPL 3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
'''
Convert OEB ebook format to PDF.
'''
import glob
import os
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
from calibre.ptempfile import TemporaryDirectory
f... | 13,443 | Python | .py | 231 | 45.761905 | 137 | 0.618723 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,660 | rtf_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/rtf_input.py | __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import glob
import os
import re
import textwrap
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
from calibre.utils.resources import get_path as P
from polyglot.builtins import as_bytes, iteritems
b... | 11,564 | Python | .py | 284 | 29.577465 | 105 | 0.539516 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,661 | pdb_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/pdb_input.py | __license__ = 'GPL v3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import InputFormatPlugin
class PDBInput(InputFormatPlugin):
name = 'PDB Input'
author = 'John Schember'
description = _('Co... | 1,186 | Python | .py | 24 | 41.666667 | 113 | 0.659427 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,662 | tcr_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/tcr_output.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
class TCROutput(OutputFormatPlugin):
name = 'TCR Output'
author = 'John Schember'
file_typ... | 1,684 | Python | .py | 39 | 34.666667 | 97 | 0.642157 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,663 | docx_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/docx_input.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
class DOCXInput(InputFormatPlugin):
name = 'DOCX Input'
author = 'Kovid Goyal'
description = _('Convert... | 1,551 | Python | .py | 25 | 53.8 | 132 | 0.681159 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,664 | pml_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/pml_input.py | __license__ = 'GPL v3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import glob
import os
import shutil
from calibre.customize.conversion import InputFormatPlugin
from calibre.ptempfile import TemporaryDirectory
class PMLInput(InputFormatPlugin):
name ... | 6,108 | Python | .py | 132 | 34.143939 | 122 | 0.559442 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,665 | mobi_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/mobi_input.py | __license__ = 'GPL 3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import InputFormatPlugin
class MOBIInput(InputFormatPlugin):
name = 'MOBI Input'
author = 'Kovid Goyal'
description = _('Convert... | 2,304 | Python | .py | 53 | 32.45283 | 72 | 0.571875 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,666 | epub_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/epub_input.py | __license__ = 'GPL 3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import posixpath
import re
from itertools import cycle
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
ADOBE_OBFUSCATION = 'http://ns.adobe.com/pdf/enc#RC... | 18,851 | Python | .py | 395 | 34.470886 | 134 | 0.548077 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,667 | tcr_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/tcr_input.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
from io import BytesIO
from calibre.customize.conversion import InputFormatPlugin
class TCRInput(InputFormatPlugin):
name = 'TCR Input'
author = 'John Schember'
descripti... | 1,112 | Python | .py | 25 | 37.12 | 72 | 0.66171 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,668 | rb_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/rb_output.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
class RBOutput(OutputFormatPlugin):
name = 'RB Output'
author = 'John Schember'
file_type ... | 1,256 | Python | .py | 30 | 33.666667 | 97 | 0.647446 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,669 | snb_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/snb_input.py | __license__ = 'GPL 3'
__copyright__ = '2010, Li Fanxi <lifanxi@freemindworld.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import InputFormatPlugin
from calibre.ptempfile import TemporaryDirectory
from calibre.utils.filenames import ascii_filename
HTML_TEMPLATE = '<html><hea... | 4,961 | Python | .py | 102 | 34.637255 | 176 | 0.517861 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,670 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
| 149 | Python | .py | 4 | 35 | 58 | 0.678571 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,671 | lrf_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/lrf_output.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import sys
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
class LRFOptions:
def __init__(self, output, opts, oeb):
... | 7,529 | Python | .py | 169 | 34.071006 | 93 | 0.594491 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,672 | html_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/html_input.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import re
import tempfile
from contextlib import suppress
from functools import partial
from urllib.parse import quote
from calibre.constants import filesystem_en... | 14,366 | Python | .py | 313 | 34.025559 | 138 | 0.57897 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,673 | fb2_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/fb2_output.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
class FB2Output(OutputFormatPlugin):
name = 'FB2 Output'
author = 'John Schember'
file_typ... | 7,235 | Python | .py | 186 | 29.650538 | 134 | 0.570718 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,674 | docx_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/docx_output.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
PAGE_SIZES = ['a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'b0', 'b1',
'b2', 'b3', 'b4', 'b5', 'b6', 'legal', 'lette... | 4,252 | Python | .py | 72 | 48.583333 | 144 | 0.642376 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,675 | rtf_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/rtf_output.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import OutputFormatPlugin
class RTFOutput(OutputFormatPlugin):
name = 'RTF Output'
author = 'John Schember'
file_type = 'rtf'
commit_n... | 1,089 | Python | .py | 27 | 32.444444 | 103 | 0.639734 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,676 | pdb_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/pdb_output.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
from calibre.ebooks.pdb import ALL_FORMAT_WRITERS, PDBError, get_writer
class PDBOutput(OutputFormatPlu... | 2,163 | Python | .py | 46 | 38.152174 | 111 | 0.644793 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,677 | oeb_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/oeb_output.py | __license__ = 'GPL 3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import re
from calibre import CurrentDir
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
class OEBOutput(OutputFormatPlugin):
name = 'OEB Output'
... | 5,360 | Python | .py | 109 | 33.449541 | 105 | 0.50478 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,678 | azw4_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/azw4_input.py | __license__ = 'GPL v3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import InputFormatPlugin
class AZW4Input(InputFormatPlugin):
name = 'AZW4 Input'
author = 'John Schember'
description = _('... | 769 | Python | .py | 19 | 34.421053 | 61 | 0.675202 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,679 | pdf_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/pdf_input.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
from polyglot.builtins import as_bytes
ENGINES = 'calibre', 'pdftohtml'
class PDFInput(InputFormatPlugi... | 4,603 | Python | .py | 82 | 45.731707 | 126 | 0.633681 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,680 | lrf_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/lrf_input.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import sys
from calibre.customize.conversion import InputFormatPlugin
from calibre.utils.resources import get_path as P
class LRFInput(InputFormatPlugin):
... | 3,084 | Python | .py | 72 | 32.277778 | 104 | 0.56 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,681 | comic_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/comic_input.py | __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
Based on ideas from comiclrf created by FangornUK.
'''
import codecs
import os
import shutil
import textwrap
from calibre import CurrentDir
from calibre.customize.conversion import InputFormatP... | 14,403 | Python | .py | 305 | 34.186885 | 108 | 0.549304 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,682 | htmlz_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/htmlz_output.py | __license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import io
import os
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
from calibre.ptempfile import TemporaryDirectory
class HTMLZOutput(OutputFormatPlugin):
... | 5,500 | Python | .py | 115 | 33.765217 | 105 | 0.550754 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,683 | odt_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/odt_input.py | __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
Convert an ODT file into a Open Ebook
'''
from calibre.customize.conversion import InputFormatPlugin
class ODTInput(InputFormatPlugin):
name = 'ODT Input'
author = 'Kovid ... | 628 | Python | .py | 17 | 32.294118 | 62 | 0.666116 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,684 | htmlz_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/htmlz_input.py | __license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre import guess_type
from calibre.customize.conversion import InputFormatPlugin
class HTMLZInput(InputFormatPlugin):
name = 'HTLZ Input'
author = 'John Sc... | 4,686 | Python | .py | 112 | 31.446429 | 98 | 0.577885 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,685 | epub_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/epub_output.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import re
import shutil
from calibre import CurrentDir
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
from calibre.ptempfile im... | 24,174 | Python | .py | 499 | 34.004008 | 122 | 0.534734 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,686 | txt_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/txt_output.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
import shutil
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
from calibre.ptempfile import TemporaryDirectory, TemporaryFile
NEWLINE_TYPES = ['system',... | 8,312 | Python | .py | 156 | 40.134615 | 103 | 0.596951 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,687 | mobi_output.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/mobi_output.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.customize.conversion import OptionRecommendation, OutputFormatPlugin
def remove_html_cover(oeb, log):
from calibre.ebooks.oeb.base import OEB_DOCS
if... | 14,807 | Python | .py | 289 | 39.394464 | 107 | 0.612796 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,688 | rb_input.py | kovidgoyal_calibre/src/calibre/ebooks/conversion/plugins/rb_input.py | __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import InputFormatPlugin
class RBInput(InputFormatPlugin):
name = 'RB Input'
author = 'John Schember'
description = _('Conver... | 665 | Python | .py | 17 | 33.352941 | 60 | 0.666667 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,689 | snbml.py | kovidgoyal_calibre/src/calibre/ebooks/snb/snbml.py | __license__ = 'GPL 3'
__copyright__ = '2010, Li Fanxi <lifanxi@freemindworld.com>'
__docformat__ = 'restructuredtext en'
'''
Transform OEB content into SNB format
'''
import os
import re
from lxml import etree
from polyglot.builtins import string_or_bytes
def ProcessFileName(fileName):
# Flat the path
fil... | 10,172 | Python | .py | 239 | 30.146444 | 111 | 0.509659 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,690 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/snb/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2010, Li Fanxi <lifanxi@freemindworld.com>'
__docformat__ = 'restructuredtext en'
'''
Used for snb output
'''
| 177 | Python | .py | 7 | 23.857143 | 60 | 0.676647 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,691 | snbfile.py | kovidgoyal_calibre/src/calibre/ebooks/snb/snbfile.py | __license__ = 'GPL v3'
__copyright__ = '2010, Li Fanxi <lifanxi@freemindworld.com>'
__docformat__ = 'restructuredtext en'
import bz2
import os
import struct
import sys
import zlib
from calibre import guess_type
class FileStream:
def IsBinary(self):
return self.attr & 0x41000000 != 0x41000000
class ... | 11,933 | Python | .py | 284 | 30.996479 | 133 | 0.574015 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,692 | sqlite.py | kovidgoyal_calibre/src/calibre/library/sqlite.py | __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
Wrapper for multi-threaded access to a single sqlite database connection. Serializes
all calls.
'''
import os
import sqlite3 as sqlite
import time
import traceback
import uuid
from datetime impo... | 12,487 | Python | .py | 344 | 26.610465 | 86 | 0.577947 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,693 | schema_upgrades.py | kovidgoyal_calibre/src/calibre/library/schema_upgrades.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from calibre.utils.date import DEFAULT_DATE, isoformat
from polyglot.builtins import itervalues
class SchemaUpgrade:
def __init__(self):
# Upgrade ... | 27,433 | Python | .py | 555 | 34.715315 | 147 | 0.5601 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,694 | add_to_library.py | kovidgoyal_calibre/src/calibre/library/add_to_library.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from hashlib import sha1
from calibre.ebooks import BOOK_EXTENSIONS
def find_folders_under(root, db, add_root=True, # {{{
follow_links=False, cancel_ca... | 4,666 | Python | .py | 136 | 24.852941 | 87 | 0.564724 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,695 | restore.py | kovidgoyal_calibre/src/calibre/library/restore.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import re
import shutil
import traceback
from operator import itemgetter
from threading import Thread
from calibre import isbytestring
from calibre.constants impo... | 11,541 | Python | .py | 249 | 33.690763 | 98 | 0.559613 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,696 | check_library.py | kovidgoyal_calibre/src/calibre/library/check_library.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import fnmatch
import os
import re
import traceback
from calibre import isbytestring
from calibre.constants import filesystem_encoding
from calibre.db.constants import COVE... | 11,015 | Python | .py | 222 | 35.599099 | 132 | 0.550595 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,697 | custom_columns.py | kovidgoyal_calibre/src/calibre/library/custom_columns.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import json
import numbers
import re
from functools import partial
from calibre import force_unicode, prints
from calibre.constants import preferred_encoding
from calibre.l... | 36,498 | Python | .py | 763 | 32.65924 | 130 | 0.502888 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,698 | coloring.py | kovidgoyal_calibre/src/calibre/library/coloring.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2011, Kovid Goyal <kovid at kovidgoyal.net>
import json
import re
from textwrap import dedent
from calibre.utils.localization import _
from polyglot.binary import as_hex_unicode, from_hex_bytes
color_row_key = '*row'
class Rule: # {{{
SIGNATURE = '# BasicCol... | 10,265 | Python | .py | 241 | 30.539419 | 106 | 0.472108 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,699 | save_to_disk.py | kovidgoyal_calibre/src/calibre/library/save_to_disk.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import re
import traceback
from calibre import prints, sanitize_file_name, strftime
from calibre.constants import DEBUG, iswindows, preferred_encoding
from calibr... | 18,888 | Python | .py | 408 | 37 | 130 | 0.613686 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |