Code Monkey home page Code Monkey logo

ole-py's Introduction

ole-py

shieldsio-pypi-badge

Microsoft OLE file parser in pure Python. You can read more about OLE file at here.

Installation

pip install ole-py

Example

import ole

with ole.open('examples\\testfile.hwp') as f:
    print(f.list_streams())
    print('=' * 40)
    print(f.get_stream('PrvText').read().decode('utf-16le'))

Result:

('FileHeader', 'DocInfo', '\x05HwpSummaryInformation', 'PrvImage', 'PrvText', 'Scripts/JScriptVersion', 'Scripts/DefaultJScript', 'DocOptions/_LinkDoc', 'BodyText/Section0')
========================================
2018년 육군 전문특기병(어학병 포함) 모집 일정
<특기명><모집인원><접수기간><1차발표><면접일시><면접장소><최종발표><입영시기>
<영어어학병><55><2017-11-03><~><2017-11-14><2017-11-14><2017-12-07   2017-12-07><09:00
14:00><합동군사대학교   국방어학원><2017-12-22><18년 1~3월><66><2018-01-25><~><2018-02-08><2018-02-08><2018-03-08   2018-03-08><09:00  14:00><2018-03-23><18년 4~6월><64><2018-04-25><~><2018-05-09><2018-05-09><2018-06-07   2018-06-07><09:00  14:00><2018-06-22><18년 7~9월><65><2018-07-25><~><2018-08-09><2018-08-09><2018-09-06   2018-09-06><09:00  14:00><2018-09-21><18년 10~12월>
<프랑스어어학병><1><2018-05-24><~><2018-06-07><없음><2018-07-04><13:00><2018-07-27><18년 8월><1><2018-09-27><~><2018-10-11><없음><2018-11-06><13:00><2018-11-23><18년 12월>
<스페인어어학병><1><2018-04-25><~><2018-05-09><없음><2018-06-12><13:00><2018-06-22><18년 7월><1><2018-09-27><~><2018-10-11><없음><2018-11-07><13:00><2018-11-23><18년 12월>
<독일어어학병><1><2017-11-03><~><2017-11-14><없음><2017-12-04><13:00><2017-12-22><18년 1월><2><2018-05-24><~><2018-06-07><없음><2018-07-05><13:00><2018-07-27><18년 8월>
<일본어어학병><2><2017-11-03><~><>

License

MIT

ole-py's People

Contributors

hallazzang avatar hyuunnn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ole-py's Issues

import ole --> ModuleNotFoundError: No module named 'utils'

windows 10, python 3.6 64bit

pip install ole-py 로 설치

(olepytest3664) D:\PythonEnvs>pip install ole-py
Collecting ole-py
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/48/60/509a0d3979d5d53024ca05c5ca14bf0c440d14c063f5ec9d047280c7868f/ole_py-0.0.1-py3-none-any.whl
Installing collected packages: ole-py
Successfully installed ole-py-0.0.1

import ole 하면 ole.py 안의 import utils 에서 에러가 발생함.

(olepytest3664) D:\PythonEnvs>python
Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ole
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\PythonEnvs\olepytest3664\lib\site-packages\ole.py", line 3, in <module>
    from utils import *
ModuleNotFoundError: No module named 'utils'

lib\site-packages 폴더에 보면, ole.py 파일은 존재하지만, utils.py 파일이 없음.

 D:\PythonEnvs\olepytest3664\Lib\site-packages 디렉터리

2018-09-05  오후 10:47    <DIR>          .
2018-09-05  오후 10:47    <DIR>          ..
2018-09-05  오후 10:41               126 easy_install.py
2018-09-05  오후 10:45             9,655 ole.py
2018-09-05  오후 10:47    <DIR>          ole_py-0.0.1-py3.6.egg-info
2018-09-05  오후 10:42    <DIR>          pip
2018-09-05  오후 10:42    <DIR>          pip-9.0.1.dist-info
2018-09-05  오후 10:41    <DIR>          pkg_resources
2018-09-05  오후 10:41    <DIR>          setuptools
2018-09-05  오후 10:41    <DIR>          setuptools-28.8.0.dist-info

현재의 github 레포를 clone 하여 pip install . 해도 동일함.

Re-implement whole things

Current implementation is inefficient in many ways.
I should re-implement whole things from the ground up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.