Git Product home page Git Product logo

sympla's Introduction

Hi I'm Hudson Brendon

  • 🔭 I’m currently working on Luizalabs
  • 🌱 I’m currently learning Fastapi
  • 👯 I’m looking to collaborate on automation projects as or Home Assistant

nostr:

npub12g6y7jvexxt4pnzgtzgcpja2qxlj33gm7kvk7wc4x2y0c2pxqc3qkfgs7k

Latest posts from Medium

sympla's People

Contributors

dependabot[bot] avatar hudsonbrendon avatar mldzs avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mldzs

sympla's Issues

Problema ao obter lista de eventos não publicados (published=False)

Realizei alguns testes e aparentemente não é um problema no código deste repositório, ao que parece é um problema no código da própria API, e para contornar este problema bastaria acrescentar int(published) para converter o bool para inteiro (0/1).

Passar published=False não funciona como deveria:

>>> sympla.events(published=False)
{'data': [],
 'pagination': {'has_next': False,
  'has_prev': False,
  'quantity': 0,
  'offset': 0,
  'page': 1,
  'page_size': 100,
  'total_page': 1},
 'sort': {'field_sort': 'start_date', 'sort': 'ASC'}}

Mas passar published=0 funciona:

>>> sympla.events(published=0)
{'data': [{'id': 1836960,
   'start_date': '2023-01-06 12:30:00',
   'end_date': '2023-01-08 12:30:00',
   'name': 'Nome do evento',
   'detail': '',
   'private_event': 0,
   'published': 0,
   'cancelled': 0,
   'image': 'https://images.sympla.com.br/',
   'address': {'name': 'Local a definir',
    'address': '',
    'address_num': '',
    'address_alt': '',
    'neighborhood': '',
    'city': 'Osasco',
    'state': 'SP',
    'zip_code': '',
    'country': 'BRASIL'},
   'host': {'name': 'Álamo', 'description': ''},
   'category_prim': {'name': 'artesanato'},
   'category_sec': {'name': 'feira-festival-ou-exposicao'},
   'url': 'https://www.sympla.com.br/nome-do-evento__1836960'}],
 'pagination': {'has_next': False,
  'has_prev': False,
  'quantity': 1,
  'offset': 0,
  'page': 1,
  'page_size': 100,
  'total_page': 1},
 'sort': {'field_sort': 'start_date', 'sort': 'ASC'}}

Refatorar funções

Será se não vale a pena dividir a função "orders" em outras funções? "Orders" está responsável por 3 endpoints. Tem uma feature ainda não criada que é a de "Participantes", ela contém 5 endpoints, sendo 3 deles do tipo GET e 2 do tipo POST. Ficará inviável usar uma função só, e isso quebrará o padrão atual de centralizar alguns endpoints em uma função.
Ex:
participants_by_order()
orders_by_event()
order_by_identifier()

em vez de só

orders()

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.