Skip to content

Python installation results in split, arbitrary libraries #36

Closed
@barretobrock

Description

@barretobrock

Hi! Thanks for building this library out. I'd love to use it in some upcoming projects.

I thought I'd point out that the structure of this repo is such that installing as a python library (e.g., pip install reolink-api) results in a mixed bag of libraries (api, utils, Camera, etc...) that don't seem to be able to communicate with each other too well. For instance, running the following after a fresh install:
from Camera import Camera
results in a ModuleNotFoundError, as the util file isn't found and thus can't import from util import threaded.

If the structure of the library were to be changed to something like my suggestion below, it would likely function more like a regular python library and thus would avoid the problem of modules not being found:
(From the project root)

reolinkapi (this is currently the 'api' folder)
    - Camera.py
    - ConfigHandler.py
    - RtspClient.py
    - resthandle.py
    - util.py
    - (everything else that's already in the `api` folder)

Also, in setup.py, changing the NAME variable to reolink_api or reolinkapi (matching the directory name change above), as having a - in a package name in Python can result in unexpected issues when performing a standard import.

Anyway, just thought I'd bring this up in case your goal was for this project to behave more like a "standard" Python library. I'm certain there are other ways to maintain a repo than what I've suggested, so I accept that I might be wrong in my assumptions about your project. That said, if you'd like some help in moving your project in the direction I've suggested I'd be happy to help out.

Cheers,

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions