Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
Does boto3 Bucket.object.filter retrieve object efficiently?

I want to get a list of all the objects(or max 1000) located at foo-bucket/foo-dir , e.g.

Bucket: foo-bucket

Directory: foo-dir

I see Bucket.objects boto3 API use filtering(Bucket.objects.filter)

I am wondering what it does internally? Does it list all the objects and filter? Or does AWS provide an API that takes filter arguments and return the filtered results.

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The S3 API supports a prefix on the ListObjects request that will filter the responses to include only those objects whose name matches the prefix. So:

import boto3

s3 = boto3.resource('s3')
bucket = s3.Bucket('mybucket')
for obj in bucket.objects.filter(Prefix='foo/bar/fie/baz/'):
    # do something with obj here

Would only return objects whose name begins with the prefix foo/bar/fie/baz/.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda