Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoiding class methods to simplify API usage #81

Open
tmbo opened this issue Mar 2, 2021 · 1 comment
Open

Avoiding class methods to simplify API usage #81

tmbo opened this issue Mar 2, 2021 · 1 comment

Comments

@tmbo
Copy link

tmbo commented Mar 2, 2021

Is your feature request related to a problem? Please describe.
Looking at the API, it does look a bit odd to me that one needs to call a class method (and import the class) to read files. Is there a need for the class object? From a style perspective, calling class methods breaks with the otherwise very functional method style of the other parts of the lib (e.g. chaining).

Describe the solution you'd like

import clumper

clump = clumper.read_json('https://calmcode.io/datasets/pokemon.json')
@koaning
Copy link
Owner

koaning commented Mar 6, 2021

It's a fair observation.

Originally I had the idea that there may be different types of Clumper objects in the future. The functional style that I have here is nice, but it does come at a performance cost. There's something to be said for a Clumper that is based on generators, which can be designed to be more lazy. Now, a few months later, I wonder if I'll ever really be able to get to that.

I'll keep this idea in mind for a 1.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants