# Path: packtools/file_utils.py
# def is_folder(source):
# def is_zipfile(source):
# def xml_files_list(path):
# def files_list(path):
# def read_file(path, encoding="utf-8", mode="r"):
# def read_from_zipfile(zip_path, filename):
# def xml_files_list_from_zipfile(zip_path):
# def files_list_from_zipfile(zip_path):
# def write_file(path, source, mode="w"):
# def create_zip_file(files, zip_name, zip_folder=None):
# def delete_folder(path):
# def create_temp_file(filename, content=None, mode='w'):
# def copy_file(source, target):
# def size(file_path):
# def get_prefix_by_xml_filename(xml_filename):
# def get_file_role(file_path, prefix, pdf_langs):
# def extract_issn_from_zip_uri(zip_uri):
# def is_valid_file(file_path, check_mimetype=False):
# def get_mimetype(file_path):
# def get_filename(file_path):


import logging
import os
from packtools import file_utils
from zipfile import ZipFile



logger = logging.getLogger(__name__)


class Package:
    def __init__(self, source, name):
        self._source = source
        self._xml = None
        self._assets = {}
        self._renditions = {}
        self._name = name

# Path: packtools/file_utils.py
# def is_folder(source):
# def is_zipfile(source):
# def xml_files_list(path):
# def files_list(path):
# def read_file(path, encoding="utf-8", mode="r"):
# def read_from_zipfile(zip_path, filename):
# def xml_files_list_from_zipfile(zip_path):
# def files_list_from_zipfile(zip_path):
# def write_file(path, source, mode="w"):
# def create_zip_file(files, zip_name, zip_folder=None):
# def delete_folder(path):
# def create_temp_file(filename, content=None, mode='w'):
# def copy_file(source, target):
# def size(file_path):
# def get_prefix_by_xml_filename(xml_filename):
# def get_file_role(file_path, prefix, pdf_langs):
# def extract_issn_from_zip_uri(zip_uri):
# def is_valid_file(file_path, check_mimetype=False):
# def get_mimetype(file_path):
# def get_filename(file_path):


# Path: packtools/sps/models/packages.py
import logging
import os
from packtools import file_utils
from zipfile import ZipFile




logger = logging.getLogger(__name__)


class Package:
    def __init__(self, source, name):
        self._source = source
        self._xml = None
        self._assets = {}
        self._renditions = {}
        self._name = name

        self.zip_file_path = file_utils.is_zipfile(source) and source