Coder Social home page Coder Social logo

webflowpy's People

Contributors

harsh-vardhhan avatar rfechtner avatar rk4bir avatar

Stargazers

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

Watchers

 avatar  avatar

webflowpy's Issues

This package is really usefull

I just wanted to say that I really like your Webflow package and it's really easy to use.

I'm just wondering what the item_data file type is supposed to be in create_item().
How is the item_data supposed to look like?

I get a "ValidationError: Invalid request body" when I try to use JSON data.

429 Too Many Requests handling

Hi there,

Great library. I just wanted to check how the code handles a 429 - Too Many Requests.

My expectation is that if a 429 is retrieved, the library should wait and then automatically try the same request again. What I see is that when a 429 is received, the error is logged but not retried and it moves on to the next record. This results in content items not being loaded.

Here is the log:

21:19:40 [ERR ] POST /collections/64de29c434c1092b42a610a4/items?live=true: [429] - Too Many Requests
21:19:40 [INFO] Response: {
    "msg": "Rate limit hit",
    "code": 429,
    "name": "RateLimit",
    "path": "/collections/64de29c434c1092b42a610a4/items",
    "err": "RateLimit: Rate limit hit"
}
21:19:41 [ERR ] POST /collections/64de29c434c1092b42a610a4/items?live=true: [429] - Too Many Requests
21:19:41 [INFO] Response: {
    "msg": "Rate limit hit",
    "code": 429,
    "name": "RateLimit",
    "path": "/collections/64de29c434c1092b42a610a4/items",
    "err": "RateLimit: Rate limit hit"
}
21:19:41 [ERR ] POST /collections/64de29c434c1092b42a610a4/items?live=true: [429] - Too Many Requests
21:19:41 [INFO] Response: {
    "msg": "Rate limit hit",
    "code": 429,
    "name": "RateLimit",
    "path": "/collections/64de29c434c1092b42a610a4/items",
    "err": "RateLimit: Rate limit hit"
}
21:19:42 [ERR ] POST /collections/64de29c434c1092b42a610a4/items?live=true: [429] - Too Many Requests
21:19:42 [INFO] Response: {
    "msg": "Rate limit hit",
    "code": 429,
    "name": "RateLimit",
    "path": "/collections/64de29c434c1092b42a610a4/items",
    "err": "RateLimit: Rate limit hit"
}

Could you confirm if the library should retry the request? If so, is there anything I need to do/configure?

How can I change the logging level in my code?

Hi,

I found the default logging level too verbose and would like to set it to show warnings or errors only. I tried doing logging.getLogger("webflowpy").setLevel(logging.WARNING) in my code, but didn't work and still produces the same output as before.

I also tried logging.getLogger("webflowpy").handlers[-1].setLevel(logging.WARNING), same result.

In https://github.com/rfechtner/webflowpy/blob/master/webflowpy/log.py#L14 the logger name is set as 'webflowpy', so I'm not sure what I'm doing wrong. Some help here would be super appreciated :D

Thanks!

Raise exceptions on errors

I noticed that even when there are errors, no exceptions are risen, and that makes it harder to use the library effectively.

Would you accept a PR to raise exceptions when the response doesn't have an OK status code and the code in these lines on WebflowResponse is reached?

Great work with the library overall, I'm finding it very useful! :)

Add typing

I noticed that you don't use typing and I find it really useful.

Would you accept a PR which will add types to your code?

Great work with the library overall, I'm finding it very useful! :)

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.