Skip to content

Writing part must be in a submodule writer #17

Closed

Description

@mgautierfr

From the user point of view :

  • zim module contains things to read a zim
  • zim.writer module contains things to create a zim.

Class names must not include the Zim :

  • ZimArticle -> zim.writer.Article
  • ZimCreator -> zim.writer.Creator
  • ZimFileReader -> zim.File, zim.Reader or zim.FileReader (I'm not sure what is best)
  • zimFileArticle -> zim.Article
  • ...

Activity

  1. jdcaballerov commented on Apr 28, 2020

    @jdcaballerov
    Contributor

    Naming was discussed and defined for libzim here: #2 (comment)

    Having a package hierarchy in Cython is basically doing two extensions. That means that is not as in normal python as creating a dir and putting the files.

    Taking into account that the CI / CD supports many options (static, dynamic, from source, with cython, without, etc) this modification at this point could break it.

    if going from

    from libzim import ZimFileReader, ZimCreator

    to

    from libzim import ZimFileReader
    from libzim.writer import ZimCreator

    is definitively desired , then creating a new package could be easier for you with the existent code under the branch reader https://github.com/openzim/python-libzim/tree/reader

  2. pirate commented on Apr 28, 2020

    @pirate
    Contributor

    Adding another layer of hierarchy to the extension is pretty easy in theory (1-2hr maybe?), but I think it can be done as a separate task:

    ext_modules = cythonize([
            Extension(
                "libzim",
                sources=["libzim/**/*.pyx","libzim/**/*.cxx"],
    -           include_dirs=["libzim"],
    +           include_dirs=["libzim/reader", "libzim/writer"],
                libraries=["zim"],
                ...
            )
        ],
        compiler_directives={'language_level' : "3"},
    )

    + some rejiggering of .gitignore and Manifest.in

  3. added a commit that references this issue on May 5, 2020
    2fd3a98
  4. added 3 commits that reference this issue on Oct 28, 2026
    1788f45
    c69ae22
    798190f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions