Файловый менеджер - Редактировать - /home/digitalm/venv/lib/python3.7/site-packages/openpyxl/reader/__pycache__/excel.cpython-37.pyc
Назад
B �5�gE0 � @ s� d Z ddlmZmZ ddlmZ ddlZddlZddl m Z yddlmZ W n e k rd dZY nX dd lmZ dd lmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ d dl m!Z!m"Z" d dl#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z* ddl+m,Z,m-Z- ddl.m/Z/m0Z0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z; ddl<m=Z= d dl>m?Z? dZ@dd� ZAdd � ZBG d!d"� d"�ZCdedd#dfd$d%�ZDdS )&zRead an xlsx file into Python� )�ZipFile�ZIP_DEFLATED)�BytesION)�TableDefinition� )�KEEP_VBAF)�InvalidFileException)�ARC_CORE� ARC_CUSTOM�ARC_CONTENT_TYPES�ARC_WORKBOOK� ARC_THEME�COMMENTS_NS�SHARED_STRINGS�XLTM�XLTX�XLSM�XLSX)� MergedCell)�CommentSheet� )�read_string_table�read_rich_text)�WorkbookParser)�apply_stylesheet)�DocumentProperties)�CustomPropertyList)�Manifest�Override)�RelationshipList�get_dependents� get_rels_path)�ReadOnlyWorksheet)�WorksheetReader)� Chartsheet)�Table)�SpreadsheetDrawing)� fromstring)�find_images)z.xlsxz.xlsmz.xltxz.xltmc C sn t | d�}|s`tj�| �d �� }|tkr`|dkr8d}n |dkrFd}nd|d�t�f }t|��t| d �}|S ) a� Does a first check whether filename is a string or a file-like object. If it is a string representing a filename, a check is done for supported formats by checking the given file-extension. If the file-extension is not in SUPPORTED_FORMATS an InvalidFileException will raised. Otherwise the filename (resp. file-like object) will forwarded to zipfile.ZipFile returning a ZipFile-Instance. �read���z.xlsz�openpyxl does not support the old .xls file format, please use xlrd to read this file, or convert it to the more recent .xlsx file format.z.xlsbz|openpyxl does not support binary format .xlsb, please convert this file to .xlsx format if you want to open it with openpyxlzropenpyxl does not support %s file format, please check you can open it with Excel first. Supported formats are: %s�,�r) �hasattr�os�path�splitext�lower�SUPPORTED_FORMATS�joinr r )�filenameZis_file_likeZfile_format�msg�archive� r7 �K/home/digitalm-up/venv/lib/python3.7/site-packages/openpyxl/reader/excel.py�_validate_archiveB s r9 c C sj t tttg}x|D ]}| �|�}|r|S qW dd� | jD �}|t|�@ }|r^tdt |� � �S t d��d S )Nc S s h | ] }|j �qS r7 )�ContentType)�.0�pr7 r7 r8 � <setcomp>k s z&_find_workbook_part.<locals>.<setcomp>�/z$File contains no valid workbook part)r r r r �findZDefault�setr r �pop�IOError)�packageZworkbook_types�ct�part�defaultsZ workbook_typer7 r7 r8 �_find_workbook_partc s rG c @ sl e Zd ZdZdedddfdd�Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� Zdd� Z dd� ZdS )�ExcelReaderzQ Read an Excel package and dispatch the contents to the relevant modules FTc C s>